diff --git a/e107_admin/header.php b/e107_admin/header.php index d0d3a1bd6..100a71927 100644 --- a/e107_admin/header.php +++ b/e107_admin/header.php @@ -12,8 +12,8 @@ | GNU General Public License (http://gnu.org). | | $Source: /cvs_backup/e107_0.8/e107_admin/header.php,v $ -| $Revision: 1.23 $ -| $Date: 2008-12-18 16:55:45 $ +| $Revision: 1.24 $ +| $Date: 2008-12-19 14:01:07 $ | $Author: secretr $ +---------------------------------------------------------------+ */ @@ -325,8 +325,26 @@ if ($e107_popup != 1) { $ns = new e107table; $e107_var = array(); - -function e_admin_menu($title, $active_page, $e107_vars, $tmpl = FALSE, $sub_link = FALSE, $sortlist = FALSE) +/** + * Build admin menus - addmin menus are now supporting unlimitted number of submenus + * + * $e107_vars structure: + * $e107_vars['action']['text'] -> link title + * $e107_vars['action']['link'] -> if empty '#action' will be added as href attribute + * $e107_vars['action']['perm'] -> permissions + * $e107_vars['action']['include'] -> additional tag attributes + * $e107_vars['action']['sub'] -> (new) array, exactly the same as $e107_vars' first level e.g. $e107_vars['action']['sub']['action2']['link']... + * $e107_vars['action']['sort'] -> (new) used only if found in 'sub' array - passed as last parameter (recursive call) + * + * @param string $title + * @param string $active_page + * @param array $e107_vars + * @param array $tmpl + * @param array $sub_link + * @param bool $sortlist + * @return string parsed admin menu (or empty string if title is empty) + */ +function e_admin_menu($title, $active_page, $e107_vars, $tmpl = array(), $sub_link = array(), $sortlist = false) { global $E_ADMIN_MENU, $e107; if(!$tmpl) $tmpl = $E_ADMIN_MENU; @@ -435,13 +453,15 @@ function e_admin_menu($title, $active_page, $e107_vars, $tmpl = FALSE, $sub_link $e107->ns->tablerender($title, $text, array('id' => $id, 'style' => 'button_menu')); + return ''; } if (!function_exists('show_admin_menu')) { function show_admin_menu($title, $active_page, $e107_vars, $js = FALSE, $sub_link = FALSE, $sortlist = FALSE) { + + return e_admin_menu($title, $active_page, $e107_vars, false, false, $sortlist); + /* global $ns, $BUTTON, $BUTTON_OVER, $BUTTONS_START, $BUTTONS_END, $SUB_BUTTON, $SUB_BUTTON_OVER, $SUB_BUTTONS_START, $SUB_BUTTONS_END; - e_admin_menu($title, $active_page, $e107_vars, false, false, $sortlist); - return; $id_title = "yop_".str_replace(" ", "", $title); if (!isset($BUTTONS_START)) { @@ -532,7 +552,7 @@ if (!function_exists('show_admin_menu')) { return $text; } else { $ns -> tablerender($title, $text, array('id' => $id_title, 'style' => 'button_menu')); - } + }*/ } } diff --git a/e107_admin/links.php b/e107_admin/links.php index cae755070..739613790 100644 --- a/e107_admin/links.php +++ b/e107_admin/links.php @@ -9,8 +9,8 @@ * Administration Area - Site Links * * $Source: /cvs_backup/e107_0.8/e107_admin/links.php,v $ - * $Revision: 1.17 $ - * $Date: 2008-12-16 11:05:36 $ + * $Revision: 1.18 $ + * $Date: 2008-12-19 14:01:07 $ * $Author: secretr $ * */ @@ -30,7 +30,7 @@ if(!is_object($tp)) // ----- Presets.---------- require_once (e_HANDLER."preset_class.php"); $pst = new e_preset(); -$pst->form = "linkform"; +$pst->form = "core-links-edit-form"; $pst->page = "links.php?create"; $pst->id = "admin_links"; require_once ('auth.php'); diff --git a/e107_admin/prefs.php b/e107_admin/prefs.php index 60c596162..46803d7f8 100644 --- a/e107_admin/prefs.php +++ b/e107_admin/prefs.php @@ -9,8 +9,8 @@ * Administration - Site Preferences * * $Source: /cvs_backup/e107_0.8/e107_admin/prefs.php,v $ - * $Revision: 1.19 $ - * $Date: 2008-12-18 16:55:45 $ + * $Revision: 1.20 $ + * $Date: 2008-12-19 14:01:07 $ * $Author: secretr $ * */ @@ -113,9 +113,11 @@ if(isset($_POST['updateprefs'])) } if($saved) { - $emessage->addSession(PRFLAN_106, E_MESSAGE_SUCCESS); + /*$emessage->addSession(PRFLAN_106, E_MESSAGE_SUCCESS); header("location:".e_ADMIN."prefs.php?u"); - exit(); + exit();*/ + //no redirect, smarter form (remember last used tab + $emessage->add(PRFLAN_106, E_MESSAGE_SUCCESS); } else { @@ -137,21 +139,7 @@ if($e107->sql->db_Select("plugin", "plugin_path", "plugin_installflag='1' AND pl } } -if($authlist) -{ - $auth_dropdown .= ""; -} -else -{ - $auth_dropdown = "".PRFLAN_151; - $pref['auth_method'] = ""; -} + require_once (e_ADMIN."auth.php"); /* @@ -177,25 +165,10 @@ while($file = readdir($handle)) closedir($handle); $text = " - -
-
+
+
- ".PRFLAN_1." + ".PRFLAN_1." @@ -322,7 +295,7 @@ $text .= " $text .= "
- ".PRFLAN_13." + ".PRFLAN_13."
@@ -332,22 +305,19 @@ $text .= " "; @@ -357,8 +327,7 @@ if(function_exists("memory_get_usage")) "; @@ -373,7 +342,7 @@ $text .= " // Admin Display Areas $text .= "
- ".PRFLAN_77." + ".PRFLAN_77."
".PRFLAN_14." -    - + ".$frm->radio_switch('displaythemeinfo', $pref['displaythemeinfo'])."
".PRFLAN_15." -    - + ".$frm->radio_switch('displayrendertime', $pref['displayrendertime'])."
".PRFLAN_16." -    - + ".$frm->radio_switch('displaysql', $pref['displaysql'])."
".PRFLAN_137." -    - + ".$frm->radio_switch('display_memory_usage', $pref['display_memory_usage'])."
@@ -383,16 +352,14 @@ $text .= " @@ -411,7 +378,7 @@ $date3 = $ga->convert_date(time(), "forum"); $text .= "
- ".PRFLAN_21." + ".PRFLAN_21."
".PRFLAN_95." -    - + ".$frm->radio_switch('admin_alerts_ok', $pref['admin_alerts_ok'])."
".PRFLAN_96."
".PRFLAN_97." -    - + ".$frm->radio_switch('admin_alerts_uniquemenu', $pref['admin_alerts_uniquemenu'])."
".PRFLAN_98."
@@ -421,29 +388,29 @@ $text .= " @@ -475,7 +442,7 @@ $text .= " // =========== Registration Preferences. ================== $text .= "
- ".PRFLAN_28." + ".PRFLAN_28."
".PRFLAN_22.": - -
".PRFLAN_83.": {$date1} + ".$frm->text('shortdate', $pref['shortdate'], 50)." +
".PRFLAN_83.": {$date1}
".PRFLAN_23.": - -
".PRFLAN_83.": {$date2} + ".$frm->text('longdate', $pref['longdate'], 50)." +
".PRFLAN_83.": {$date2}
".PRFLAN_24." - -
".PRFLAN_83.": {$date3} -
".PRFLAN_25." ".PRFLAN_93."
+ ".$frm->text('forumdate', $pref['forumdate'], 50)." +
".PRFLAN_83.": {$date3}
+
".PRFLAN_25." ".PRFLAN_93."
".PRFLAN_26." -
".PRFLAN_56.": - + ".$frm->text('timezone', $pref['timezone'], 50)."
@@ -484,24 +451,21 @@ $text .= " - - - @@ -615,7 +576,7 @@ $text .= " $text .= "
- ".PRFLAN_19." + ".PRFLAN_19."
".PRFLAN_29." -    - + + ".$frm->radio_switch('user_reg', $pref['user_reg'])."
".PRFLAN_30."
".PRFLAN_141." -    - + + ".$frm->radio_switch('xup_enabled', $pref['xup_enabled'])."
".PRFLAN_154." - + ".$frm->select_open('user_reg_veri'); $veri_list[0] = PRFLAN_152; $veri_list[1] = PRFLAN_31; @@ -509,98 +473,95 @@ $veri_list[2] = PRFLAN_153; foreach($veri_list as $v => $v_title) { - $sel = ($pref['user_reg_veri'] == $v) ? "selected='selected'" : ""; $text .= " - + ".$frm->option($v_title, $v, ($pref['user_reg_veri'] == $v))." "; } $text .= " +
".PRFLAN_154a."
".PRFLAN_160." -    - + ".$frm->radio_switch('signup_remote_emailcheck', $pref['signup_remote_emailcheck'])."
".PRFLAN_167." -    - + ".$frm->radio_switch('disable_emailcheck', $pref['disable_emailcheck'])."
".PRFLAN_32." -    - -
".PRFLAN_33."
+ ".$frm->radio_switch('anon_post', $pref['anon_post'])." +
".PRFLAN_33."
".PRFLAN_45." -    - -
".PRFLAN_46." ".PRFLAN_94."
+ ".$frm->radio_switch('use_coppa', $pref['use_coppa'])." +
".PRFLAN_46." ".PRFLAN_94."
".PRFLAN_58." -    - -
".PRFLAN_59."
+ ".$frm->radio_switch('membersonly_enabled', $pref['membersonly_enabled'])." +
".PRFLAN_59."
".CUSTSIG_16." - -
".PRFLAN_78."
+ ".$frm->text('signup_pass_len', $pref['signup_pass_len'], 2)." +
".PRFLAN_78."
".PRFLAN_136." - + ".$frm->text('signup_maxip', $pref['signup_maxip'], 3)." +
".PRFLAN_78."
".CUSTSIG_18." - -
".CUSTSIG_19."
+ ".$frm->textarea('signup_disallow_text', $pref['signup_disallow_text'], 3, 1)." +
".CUSTSIG_19."
".PRFLAN_155.": - ".r_userclass('displayname_class', $pref['displayname_class'], 'off', 'nobody,public,admin,classes')." - +
".$e_userclass->uc_dropdown('displayname_class', $pref['displayname_class'], 'nobody,public,admin,classes', "tabindex='".$frm->getNext()."'")."
+ ".$frm->admin_button('submit_resetdisplaynames', PRFLAN_156)."
".PRFLAN_192.": -
".PRFLAN_194." -
".PRFLAN_193."
+ ".$frm->text('predefinedLoginName', $pref['predefinedLoginName'], 50)." +
".PRFLAN_193."
+
".PRFLAN_194."
".PRFLAN_158.": - + ".$frm->text('displayname_maxlength', $pref['displayname_maxlength'], 3)."
".PRFLAN_172.": - + ".$frm->text('loginname_maxlength', $pref['loginname_maxlength'], 3)."
@@ -625,24 +586,26 @@ $text .= " +"; + +/* -"; - +*/ $signup_option_title = array(CUSTSIG_2, CUSTSIG_6, CUSTSIG_7, CUSTSIG_17, CUSTSIG_20); $signup_option_names = array("signup_option_realname", "signup_option_signature", "signup_option_image", "signup_option_class", 'signup_option_customtitle'); @@ -651,10 +614,10 @@ foreach($signup_option_names as $key => $value) $text .= " - "; @@ -672,7 +635,7 @@ $text .= " /* text render options */ -if(! isset($pref['post_html'])) +if(!isset($pref['post_html'])) { $pref['post_html'] = '250'; save_prefs(); @@ -680,7 +643,7 @@ if(! isset($pref['post_html'])) $text .= "
- ".PRFLAN_101." + ".PRFLAN_101."
".PRFLAN_126." - + ".$frm->textarea('signup_text', $pref['signup_text'], 3, 1)."
".PRFLAN_140." - + ".$frm->textarea('signup_text_after', $pref['signup_text_after'], 3, 1)."
".$signup_option_title[$key]." -    -    -    + + ".$frm->radio($value, 0, !$pref[$value]).$frm->label(CUSTSIG_12, $value, 0)."   + ".$frm->radio($value, 1, ($pref[$value] == 1)).$frm->label(CUSTSIG_14, $value, 1)."   + ".$frm->radio($value, 2, ($pref[$value] == 2)).$frm->label(CUSTSIG_15, $value, 2)."
@@ -690,82 +653,77 @@ $text .= " @@ -777,15 +735,14 @@ if(file_exists(e_PLUGIN."geshi/geshi.php")) @@ -816,7 +773,7 @@ $hasGD = extension_loaded("gd"); $text .= "
- ".PRFLAN_47." + ".PRFLAN_47."
".PRFLAN_127.": -    - + ".$frm->radio_switch('make_clickable', $pref['make_clickable'])."
".PRFLAN_128."
".PRFLAN_102."?: -    - + ".$frm->radio_switch('link_replace', $pref['link_replace'])."
".PRFLAN_103."
".PRFLAN_145."?: -    - + ".$frm->radio_switch('links_new_window', $pref['links_new_window'])."
".PRFLAN_146."
".PRFLAN_104.": - + ".$frm->text('link_text', $pref['link_text'], 200)."
".PRFLAN_105."
".PRFLAN_107.": - + ".$frm->text('email_text', $tp->post_toForm($pref['email_text']), 200)."
".PRFLAN_108."
".PRFLAN_109.": - + ".$frm->text('main_wordwrap', $pref['main_wordwrap'], 3)."
".PRFLAN_110."
".PRFLAN_111.": - + ".$frm->text('menu_wordwrap', $pref['menu_wordwrap'], 3)."
".PRFLAN_110."
".PRFLAN_116.": - ".r_userclass('post_html', $pref['post_html'], 'off', 'nobody,public,member,admin,main,classes')." + ".$e_userclass->uc_dropdown('post_html', $pref['post_html'], 'nobody,public,member,admin,main,classes', "tabindex='".$frm->getNext()."'")."
".PRFLAN_117."
".PRFLAN_122.": -    - + ".$frm->radio_switch('wysiwyg', $pref['wysiwyg'])."
".PRFLAN_123."
".PRFLAN_124.": -    - + ".$frm->radio_switch('old_np', $pref['old_np'])."
".PRFLAN_125."
".PRFLAN_131.": - ".r_userclass('php_bbcode', $pref['php_bbcode'], 'off', 'nobody,admin,main,classes')." + ".$e_userclass->uc_dropdown('php_bbcode', $pref['php_bbcode'], 'nobody,admin,main,classes', "tabindex='".$frm->getNext()."'")."
".PRFLAN_132."
".PRFLAN_118."?: -    - + ".$frm->radio_switch('useGeshi', $pref['useGeshi'])."
".PRFLAN_119."
".PRFLAN_120."?: - + ".$frm->text('defaultLanGeshi', ($pref['defaultLanGeshi'] ? $pref['defaultLanGeshi'] : "php"), 20)."
".PRFLAN_121."
@@ -825,8 +782,10 @@ $text .= " - @@ -836,7 +795,7 @@ $text .= " if($hasGD) { - $text .= multi_radio('signcode', array('1' => PRFLAN_112, '0' => PRFLAN_113), $pref['signcode']); + $text .= $frm->radio_switch('signcode', $pref['signcode']); } else { @@ -852,7 +811,7 @@ $text .= " if($hasGD) { - $text .= multi_radio('logcode', array('1' => PRFLAN_112, '0' => PRFLAN_113), $pref['logcode']); + $text .= $frm->radio_switch('logcode', $pref['logcode']); } else { @@ -867,7 +826,7 @@ $text .= " "; if($hasGD) { - $text .= multi_radio('fpwcode', array('1' => PRFLAN_112, '0' => PRFLAN_113), $pref['fpwcode']); + $text .= $frm->radio_switch('fpwcode', $pref['fpwcode']); } else { @@ -879,48 +838,51 @@ $text .= " - - - - - - - - - + @@ -997,7 +963,7 @@ $text .= " $text .= "
- ".PRFLAN_87." + ".PRFLAN_87."
".PRFLAN_60."".multi_radio('ssl_enabled', array('1' => PRFLAN_112, '0' => PRFLAN_113), $pref['ssl_enabled'])." -
".PRFLAN_61."
+ +
+ ".$frm->radio_switch('ssl_enabled', $pref['ssl_enabled'])." +
".PRFLAN_61."
".PRFLAN_92.": ".multi_radio('user_reg_secureveri', array('1' => PRFLAN_112, '0' => PRFLAN_113), $pref['user_reg_secureveri'])." + + ".$frm->radio_switch('user_reg_secureveri', $pref['user_reg_secureveri'])."
".PRFLAN_129.":".multi_radio('disallowMultiLogin', array('1' => PRFLAN_112, '0' => PRFLAN_113), $pref['disallowMultiLogin'])." + + ".$frm->radio_switch('disallowMultiLogin', $pref['disallowMultiLogin'], LAN_YES, LAN_NO)."
".PRFLAN_130."
".PRFLAN_184.":".multi_radio('allowEmailLogin', array('1' => PRFLAN_186, '0' => PRFLAN_187), varset($pref['allowEmailLogin'], 0))." + + ".$frm->radio_switch('allowEmailLogin', $pref['allowEmailLogin'], LAN_YES, LAN_NO)."
".PRFLAN_185."
".PRFLAN_48.":".multi_radio('user_tracking', array('cookie' => PRFLAN_49, 'session' => PRFLAN_50), $pref['user_tracking'])." -
- ".PRFLAN_55.": +
+
".$frm->radio_multi('user_tracking', array('cookie' => PRFLAN_49, 'session' => PRFLAN_50), $pref['user_tracking'])."
+ ".PRFLAN_55.":
".$frm->text('cookie_name', $pref['cookie_name'], 20)."
".PRFLAN_188.":".multi_radio('passwordEncoding', array('0' => PRFLAN_189, '1' => PRFLAN_190), varset($pref['passwordEncoding'], 0))." + + ".$frm->radio_switch('passwordEncoding', varset($pref['passwordEncoding'], 0), PRFLAN_190, PRFLAN_189)."
".PRFLAN_191."
".PRFLAN_178." -
".PRFLAN_40."".multi_radio('profanity_filter', array('1' => PRFLAN_112, '0' => PRFLAN_113), $pref['profanity_filter'])." + + ".$frm->radio_switch('profanity_filter', $pref['profanity_filter'])."
".PRFLAN_41."
".PRFLAN_42.": - + ".$frm->text('profanity_replace', $pref['profanity_replace'], 20)."
".PRFLAN_43.": - -
".PRFLAN_44." + ".$frm->textarea('profanity_words', $pref['profanity_words'], 2, 59)." +
".PRFLAN_44."
".PRFLAN_35.":".multi_radio('antiflood1', array('1' => PRFLAN_112, '0' => PRFLAN_113), $pref['antiflood1'])." + + ".$frm->radio_switch('antiflood1', $pref['antiflood1'])."
".PRFLAN_36.": - + ".$frm->text('antiflood_timeout', $pref['antiflood_timeout'], 3)."
".PRFLAN_38."
".PRFLAN_37." - -
".PRFLAN_91."
+
".PRFLAN_91."
".PRFLAN_139.":".multi_radio('adminpwordchange', array('1' => PRFLAN_112, '0' => PRFLAN_113), $pref['adminpwordchange'])." + ".PRFLAN_139.": + ".$frm->radio_switch('adminpwordchange', $pref['adminpwordchange'])."
@@ -1007,36 +973,31 @@ $text .= " @@ -1048,7 +1009,7 @@ $text .= " //Advanced Features $text .= "
- ".PRFLAN_149." + ".PRFLAN_149."
".PRFLAN_89.": -    - + ".$frm->radio_switch('comments_icon', $pref['comments_icon'], LAN_YES, LAN_NO)."
".PRFLAN_88.": -    - + ".$frm->radio_switch('nested_comments', $pref['nested_comments'], LAN_YES, LAN_NO)."
".PRFLAN_90.": -    - + ".$frm->radio_switch('allowCommentEdit', $pref['allowCommentEdit'], LAN_YES, LAN_NO)."
".PRFLAN_161.": -    - + ".$frm->radio_switch('comments_disabled', $pref['comments_disabled'], LAN_YES, LAN_NO)."
".PRFLAN_166.": -    - + ".$frm->radio_switch('comments_emoticons', $pref['comments_emoticons'], LAN_YES, LAN_NO)."
@@ -1057,20 +1018,44 @@ $text .= " - - - +"; + +$auth_dropdown = ''; +if($authlist) +{ + $auth_dropdown = $frm->select_open('auth_method'); + foreach($authlist as $a) + { + $s = ($pref['auth_method'] == $a ? " selected='selected' " : ""); + $auth_dropdown .= $frm->option($a, $s, ($pref['auth_method'] == $a)); + } + $auth_dropdown .= ""; +} +else +{ + $auth_dropdown = "".PRFLAN_151; + $pref['auth_method'] = ""; +} + +$text .= " - diff --git a/e107_files/jslib/core/admin.js b/e107_files/jslib/core/admin.js index 816097491..a6029a3c3 100644 --- a/e107_files/jslib/core/admin.js +++ b/e107_files/jslib/core/admin.js @@ -8,8 +8,8 @@ * e107 Admin Helper * * $Source: /cvs_backup/e107_0.8/e107_files/jslib/core/admin.js,v $ - * $Revision: 1.6 $ - * $Date: 2008-12-18 16:55:46 $ + * $Revision: 1.7 $ + * $Date: 2008-12-19 14:01:07 $ * $Author: secretr $ * */ @@ -36,15 +36,16 @@ e107Admin.Helper = { * Do it only ONCE per page! * */ - init: function() { + init: function(event) { this.toggleCheckedHandler = this.toggleChecked.bindAsEventListener(this); this.allCheckedEventHandler = this.allChecked.bindAsEventListener(this); this.allUncheckedEventHandler = this.allUnchecked.bindAsEventListener(this); - - $$('.autocheck').invoke('observe', 'click', this.toggleCheckedHandler); - $$('button.action[name=check_all]').invoke('observe', 'click', this.allCheckedEventHandler); - $$('button.action[name=uncheck_all]').invoke('observe', 'click', this.allUncheckedEventHandler); - $$('button.delete', 'input.delete[type=image]', 'a.delete').invoke('observe', 'click', function(e) { + element = event.memo['element'] ? $(event.memo.element) : $$('body')[0]; + + element.select('.autocheck').invoke('observe', 'click', this.toggleCheckedHandler); + element.select('button.action[name=check_all]').invoke('observe', 'click', this.allCheckedEventHandler); + element.select('button.action[name=uncheck_all]').invoke('observe', 'click', this.allUncheckedEventHandler); + element.select('button.delete', 'input.delete[type=image]', 'a.delete').invoke('observe', 'click', function(e) { if(e.element().hasClassName('no-confirm') || (e.element().readAttribute('rel') && e.element().readAttribute('rel').toLowerCase == 'no-confirm')) return; var msg = e.element().readAttribute('title') || e107.getModLan('delete_confirm'); if( !e107Helper.confirm(msg) ) e.stop(); @@ -80,8 +81,6 @@ e107Admin.Helper = { //do nothing if checkbox/form element or link is clicked var tmp = event.element().nodeName.toLowerCase(); if(tmp == 'input' || tmp == 'a' || tmp == 'select' || tmp == 'textarea' || tmp == 'radio') return; - //stop event - //event.stop(); //checkbox container element var element = event.findElement('.autocheck'), check = null; @@ -183,56 +182,68 @@ e107Admin.AdminMenu = { if(this._track.get(id) || !selection) return false; this._track.set(id, selection); + this.id = id; this.location = document.location.hash.substring(1); this.activeTab = null; this.activeBar = null; if(this.location) { - this.activeTab = $(this.location); + replace = new RegExp(this.id.camelize() + 'AdminMenu='); + this.activeTab = $(this.location.replace(replace, '')); if(this.activeTab) { - this.activeTab.show(); + this.activeTab.removeClassName('e-hideme').show(); } } selection.each( function(element, i) { - if(0 === i && !this.activeTab) { //no page hash - - if(!this.activeTab) { - var check = element.select('a[href^=#]:not([href=#])'); - if(check[0]) { - this.switchTab(check[0].hash.substr(1), element); - } + var check = element.select('a[href^=#]:not([href=#])'); + if(!this.activeTab) { //no page hash, set default + if(check[0]) { + this.switchTab(check[0].hash.substr(1), check[0], element); } - } else if(!this.activeBar && this.activeTab) {//there is page hash - var h = this.activeTab; - this.activeBar = element.select('a[href^=#]:not([href=#])').find( function(el){ - return h = el.hash.substr(1); - }); + } else if(!this.activeBar && this.activeTab) {//there is page hash, bar is unknown + var h = this.activeTab.identify(); + var bar = check.find( function(el){ + return h == el.hash.substr(1); + }); + this.switchTab(this.activeTab, bar, element); } - element.select('a[href^=#]:not([href=#])').invoke('observe', 'click', this.observe.bindAsEventListener(this, element)); + check.invoke('observe', 'click', this.observer.bindAsEventListener(this, element)); }.bind(this)); + //search for admin-menu forms + $$('form.admin-menu').invoke('observe', 'submit', function(event) { var form = event.element(); action = form.readAttribute('action') + document.location.hash; form.writeAttribute('action', action) } ); return true; }, - switchTab: function(show, container) { + switchTab: function(show, bar, container) { show = $(show); if(!show) return false; if(this.activeTab && this.activeTab.identify() != show.identify()) { - //console.log(this.activeTab , container, this.activeTab.identify(), show.identify()); - if(container) $(container).select('a.link-active[href^=#])').invoke('removeClassName', 'link-active'); - this.activeTab.hide().removeClassName('link-active'); - this.activeTab = show.show().addClassName('link-active'); - } else if(!this.activeTab) { - //init - if(container) $(container).select('a.link-active[href^=#])').invoke('removeClassName', 'link-active'); - this.activeTab = show.show().addClassName('link-active'); + if(container) $(container).select('a.link-active[href^=#])').invoke('removeClassName', 'link-active').invoke('addClassName', 'link'); + this.activeTab.hide(); + this.activeTab = show; + this.activeTab.removeClassName('e-hideme').show(); + if(bar) this.activeBar = bar; + this.activeBar.removeClassName('link').addClassName('link-active'); + return true; + } else if(!this.activeTab) { //init + if(container) $(container).select('a.link-active[href^=#])').invoke('removeClassName', 'link-active').invoke('addClassName', 'link'); + this.activeTab = show.removeClassName('e-hideme').show(); + if(bar) this.activeBar = bar.removeClassName('link').addClassName('link-active'); + return true; + } else if(!this.activeBar && this.activeTab) {//only bar is unknown + if(container) $(container).select('a.link-active[href^=#])').invoke('removeClassName', 'link-active').invoke('addClassName', 'link'); + if(bar) this.activeBar = bar.removeClassName('link').addClassName('link-active'); + return true; } - return true; + return false; }, - observe: function(event, cont) { - if(this.switchTab(event.element().hash.substr(1)), cont) + observer: function(event, cont) { + if(this.switchTab(event.element().hash.substr(1), event.element(), cont)) { event.stop(); + document.location.hash = this.id.camelize() + 'AdminMenu=' + event.element().hash.substr(1) + } }, _track: $H() diff --git a/e107_files/shortcode/admin_nav.sc b/e107_files/shortcode/admin_nav.sc index 8b23fb538..310dd4580 100644 --- a/e107_files/shortcode/admin_nav.sc +++ b/e107_files/shortcode/admin_nav.sc @@ -1,7 +1,7 @@ /* * e107 website system (c) 2001-2008 Steve Dunstan (e107.org) -* $Id: admin_nav.sc,v 1.7 2008-12-18 16:55:46 secretr Exp $ +* $Id: admin_nav.sc,v 1.8 2008-12-19 14:01:07 secretr Exp $ */ if (ADMIN) { @@ -44,8 +44,8 @@ if (ADMIN) if ($nav_sql -> db_Select("plugin", "*", "plugin_installflag=1")) { $tmp = array(); - $e107_var['plugs']['text'] = ADLAN_95; - $e107_var['plugs']['link'] = ''; + $e107_var['plugm']['text'] = ADLAN_95; + $e107_var['plugm']['link'] = ''; /* SUBLINKS */ //Link Plugin Manager diff --git a/e107_handlers/form_handler.php b/e107_handlers/form_handler.php index 852cd0baa..b3189c256 100644 --- a/e107_handlers/form_handler.php +++ b/e107_handlers/form_handler.php @@ -9,8 +9,8 @@ * Form Handler * * $Source: /cvs_backup/e107_0.8/e107_handlers/form_handler.php,v $ - * $Revision: 1.10 $ - * $Date: 2008-12-17 11:12:44 $ + * $Revision: 1.11 $ + * $Date: 2008-12-19 14:01:07 $ * $Author: secretr $ * */ @@ -116,6 +116,27 @@ class e_form } + function radio_switch($name, $checked_enabled = false, $label_enabled = '', $label_disabled = '') + { + return $this->radio($name, 1, $checked_enabled)."".$this->label($label_enabled ? $label_enabled : LAN_ENABLED, $name, 1)."   + ".$this->radio($name, 0, !$checked_enabled)."".$this->label($label_disabled ? $label_disabled : LAN_DISABLED, $name, 0); + + } + + function radio_multi($name, $elements, $checked) + { + $text = array(); + if(is_string($elements)) parse_str($elements, $elements); + + foreach ($elements as $value => $label) + { + $text[] = $this->radio($name, $value, $checked == $value)."".$this->label($label, $name, $value); + } + + return implode("  \n", $text); + + } + function label($text, $name = '', $value = '') { $for_id = $this->_format_id('', $name, $value, 'for'); diff --git a/e107_languages/English/admin/lan_prefs.php b/e107_languages/English/admin/lan_prefs.php index e0f2bad30..d88f21343 100644 --- a/e107_languages/English/admin/lan_prefs.php +++ b/e107_languages/English/admin/lan_prefs.php @@ -12,9 +12,9 @@ | GNU General Public License (http://gnu.org). | | $Source: /cvs_backup/e107_0.8/e107_languages/English/admin/lan_prefs.php,v $ -| $Revision: 1.14 $ -| $Date: 2008-11-23 22:49:47 $ -| $Author: e107steved $ +| $Revision: 1.15 $ +| $Date: 2008-12-19 14:01:07 $ +| $Author: secretr $ +----------------------------------------------------------------------------+ */ @@ -71,7 +71,7 @@ define("PRFLAN_56", "Timezone"); define("PRFLAN_58", "Restrict website to members only"); define("PRFLAN_59", "ticking will restrict all areas apart from the front page and signup page to members only"); define("PRFLAN_60", "Enable SSL"); -define("PRFLAN_61", "Only enable SSL if you are sure you know what you are doing!"); +define("PRFLAN_61", "Only enable SSL if you are sure you know what you are doing!"); define("PRFLAN_76", "Enable Image-code verification during signup"); define("PRFLAN_77", "Admin Display Options "); define("PRFLAN_78", "Leave blank to disable"); @@ -162,7 +162,7 @@ define("PRFLAN_151", "e107 - No alternate authentication methods installed"); define("PRFLAN_31", "Email Verification"); define("PRFLAN_152", "No Verification"); define("PRFLAN_153", "Admin Approval"); -define("PRFLAN_154", "New user verification method
If 'Admin Approval' is selected, it is recommended that you enable email notification on user signup here."); +define("PRFLAN_154", "New user verification method"); define("PRFLAN_155", "Display name and login name may be different for"); define("PRFLAN_156", "Reset ALL Display Names"); define("PRFLAN_157", "All Display Names have been reset to the Username"); @@ -181,7 +181,7 @@ define("PRFLAN_169", "If the chosen group contains more than one person, the use //define("PRFLAN_170", "Use reverse DNS to allow host banning"); //define("PRFLAN_171", "Turning this option on will allow you to ban users by hostname, rather then just IP or email address.
NOTE: This may affect pageload times on some hosts"); define("PRFLAN_172", "Login Name maximum length (10..100)"); -define("PRFLAN_173", "Check at SourceForge for E107 updates once/day"); +define("PRFLAN_173", "Check at SourceForge for e107 updates once/day"); define("PRFLAN_174", "Name for responses to emails from site"); define("PRFLAN_175", "This will appear in the 'From' field of registration and other emails from this site"); define("PRFLAN_176", "Email address for emails from site"); @@ -202,10 +202,12 @@ define('PRFLAN_190', 'Salted'); define('PRFLAN_191', '(md5 is usually adequate for an Intranet, and often for other sites)'); define('PRFLAN_192', 'Generate random predefined login names according to a pattern'); define('PRFLAN_193', 'To allow users to set their own login names, leave blank'); -define('PRFLAN_194', '# - alpha
. - numeric
* - alphanumeric
Other chars used as entered'); +define('PRFLAN_194', '# - alpha
. - numeric
* - alphanumeric
Other chars used as entered.'); define('PRFLAN_195', 'Changed values:'); -define('PRFLAN_196', 'Log all page accesses to the '.e_FILE_ABS.'logs/ directory'); -define('PRFLAN_197', ''); - +define('PRFLAN_196', 'Log all page accesses'); +//define('PRFLAN_197', ''); +//0.8 +define("PRFLAN_154a", "If 'Admin Approval' is selected, it is recommended that you enable email notification on user signup here."); +define('PRFLAN_196a', 'Log directory:'); ?> \ No newline at end of file diff --git a/e107_themes/_blank/admin_template.php b/e107_themes/_blank/admin_template.php index f6f17b466..59c7d5189 100644 --- a/e107_themes/_blank/admin_template.php +++ b/e107_themes/_blank/admin_template.php @@ -9,8 +9,8 @@ * Admin template - _blank theme * * $Source: /cvs_backup/e107_0.8/e107_themes/_blank/admin_template.php,v $ - * $Revision: 1.8 $ - * $Date: 2008-12-18 16:55:45 $ + * $Revision: 1.9 $ + * $Date: 2008-12-19 14:01:07 $ * $Author: secretr $ * */ @@ -68,18 +68,17 @@ $ADMIN_FOOTER = " {SETSTYLE=admin_menu} {ADMIN_MENU} - {ADMIN_NAV} - {SETSTYLE=none} + {ADMIN_PRESET} + {SETSTYLE=none} {ADMIN_PWORD} {ADMIN_STATUS=request} {ADMIN_LATEST=request} {ADMIN_LOG=request} {ADMIN_MSG} {ADMIN_PLUGINS} - - {ADMIN_PRESET} {ADMIN_UPDATE} + {SETSTYLE=site_info} {ADMIN_HELP} @@ -93,9 +92,9 @@ $ADMIN_FOOTER = " "; -/* REEDIT +/* NEW ADMIN MENU TEMPLATE - * function show_admin_menu() in e107_admin/header.php + * see function e_admin_menu() in e107_admin/header.php */ $E_ADMIN_MENU['start'] = '
".PRFLAN_147.":".multi_radio('developer', array('1' => PRFLAN_112, '0' => PRFLAN_113), $pref['developer'])." + + ".$frm->radio_switch('developer', $pref['developer'])."
".PRFLAN_148."
".PRFLAN_196."".multi_radio('log_page_accesses', array('1' => PRFLAN_112, '0' => PRFLAN_113), $pref['log_page_accesses'])." + + ".$frm->radio_switch('log_page_accesses', $pref['log_page_accesses'])." +
".PRFLAN_196a."
".e_FILE_ABS."logs/
".PRFLAN_17."".multi_radio('compress_output', array('1' => PRFLAN_112, '0' => PRFLAN_113), $pref['compress_output'])." + + ".$frm->radio_switch('compress_output', $pref['compress_output'])."
".PRFLAN_150." @@ -1079,7 +1064,8 @@ $text .= "
".PRFLAN_173."".multi_radio('check_updates', array('1' => PRFLAN_112, '0' => PRFLAN_113), $pref['check_updates'])." + + ".$frm->radio_switch('check_updates', $pref['check_updates'])."