From 037e91cfee4f6f05e7d4eec9c06a7c6fd41debf8 Mon Sep 17 00:00:00 2001 From: marj Date: Sat, 18 Jul 2009 10:17:56 +0000 Subject: [PATCH] Load admin phrases ASAP --- class2.php | 20 +++++----- e107_admin/auth.php | 11 ++++-- e107_admin/newspost.php | 21 +++++----- e107_admin/prefs.php | 13 +++--- e107_plugins/admin_menu/admin_menu.php | 55 ++++++++++++++------------ 5 files changed, 64 insertions(+), 56 deletions(-) diff --git a/class2.php b/class2.php index da2824ef0..1117785a7 100644 --- a/class2.php +++ b/class2.php @@ -9,9 +9,9 @@ * General purpose file * * $Source: /cvs_backup/e107_0.8/class2.php,v $ -* $Revision: 1.108 $ -* $Date: 2009-07-16 02:55:18 $ -* $Author: e107coders $ +* $Revision: 1.109 $ +* $Date: 2009-07-18 10:17:56 $ +* $Author: marj_nl_fr $ * */ // @@ -963,31 +963,33 @@ $isPluginDir = strpos(e_SELF,'/'.$PLUGINS_DIRECTORY) !== FALSE; // True if we'r $e107Path = str_replace($e107->base_path, '', e_SELF); // Knock off the initial bits if ( (!$isPluginDir && strpos($e107Path, $ADMIN_DIRECTORY) === 0 ) // Core admin directory - || ($isPluginDir && (strpos(e_PAGE,'admin_') === 0 || strpos($e107Path, 'admin/') !== false)) // Plugin admin file or directory + || ($isPluginDir && (strpos(e_PAGE,'admin_') === 0 || strpos($e107Path, 'admin/') !== FALSE)) // Plugin admin file or directory || (varsettrue($eplug_admin)) // Admin forced ) { - $inAdminDir = true; + $inAdminDir = TRUE; + // Load admin phrases ASAP + include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/admin/lan_admin.php'); } if(!defined('THEME')) { - if ($inAdminDir && varsettrue($pref['admintheme'])&& (strpos(e_SELF.'?'.e_QUERY, 'menus.php?configure') === false)) + if ($inAdminDir && varsettrue($pref['admintheme'])&& (strpos(e_SELF.'?'.e_QUERY, 'menus.php?configure') === FALSE)) { /* if (strpos(e_SELF, "newspost.php") !== FALSE) { define("MAINTHEME", e_THEME.$pref['sitetheme']."/"); MAINTHEME no longer used in core distribution } */ - checkvalidtheme($pref['admintheme']); + checkvalidtheme($pref['admintheme']); } elseif (USERTHEME !== false && USERTHEME != 'USERTHEME' && !$inAdminDir) { - checkvalidtheme(USERTHEME); + checkvalidtheme(USERTHEME); } else { - checkvalidtheme($pref['sitetheme']); + checkvalidtheme($pref['sitetheme']); } diff --git a/e107_admin/auth.php b/e107_admin/auth.php index 05c6e4865..473902073 100644 --- a/e107_admin/auth.php +++ b/e107_admin/auth.php @@ -9,20 +9,23 @@ * Administration Area Authorization * * $Source: /cvs_backup/e107_0.8/e107_admin/auth.php,v $ - * $Revision: 1.8 $ - * $Date: 2009-07-07 06:50:55 $ - * $Author: e107coders $ + * $Revision: 1.9 $ + * $Date: 2009-07-18 10:17:56 $ + * $Author: marj_nl_fr $ */ if (!defined('e107_INIT')) { exit; } +/* done in class2 @include_once(e_LANGUAGEDIR.e_LANGUAGE."/admin/lan_admin.php"); @include_once(e_LANGUAGEDIR."English/admin/lan_admin.php"); +*/ if (ADMIN) { define("ADMIN_PAGE", true); //don't include it if it'a an AJAX call or not wanted - if(!e_AJAX_REQUEST && !defset('NO_HEADER')) require_once(e_ADMIN."header.php"); + if(!e_AJAX_REQUEST && !defset('NO_HEADER')) + require_once(e_ADMIN."header.php"); /* * FIXME - missing $style for tablerender * The Solution: parse_admin() without sending it to the browser if it's an ajax call diff --git a/e107_admin/newspost.php b/e107_admin/newspost.php index 8a7a9a205..e0a286a68 100644 --- a/e107_admin/newspost.php +++ b/e107_admin/newspost.php @@ -9,9 +9,9 @@ * News Administration * * $Source: /cvs_backup/e107_0.8/e107_admin/newspost.php,v $ - * $Revision: 1.44 $ - * $Date: 2009-07-17 07:53:13 $ - * $Author: e107coders $ + * $Revision: 1.45 $ + * $Date: 2009-07-18 10:17:56 $ + * $Author: marj_nl_fr $ */ require_once("../class2.php"); @@ -29,7 +29,7 @@ $pst->form = "core-newspost-create-form"; // form id of the form that will have $pst->page = "newspost.php?create"; // display preset options on which page(s). $pst->id = "admin_newspost"; // ------------------------------ -require_once(e_LANGUAGEDIR.e_LANGUAGE."/admin/lan_admin.php"); // maybe this should be put in class2.php when 'admin' is detected. +// done in class2: require_once(e_LANGUAGEDIR.e_LANGUAGE."/admin/lan_admin.php"); // maybe this should be put in class2.php when 'admin' is detected. $newspost = new admin_newspost(e_QUERY, $pst); $gen = new convert(); @@ -546,7 +546,7 @@ class admin_newspost $temp['news_newdateheader'] = intval($_POST['news_newdateheader']); $temp['news_unstemplate'] = intval($_POST['news_unstemplate']); $temp['news_editauthor'] = intval($_POST['news_editauthor']); - + if ($admin_log->logArrayDiffs($temp, $pref, 'NEWS_06')) { save_prefs(); // Only save if changes @@ -1524,7 +1524,7 @@ class admin_newspost $frm = new e_form(true); echo $frm->filterValue($_POST['filtertype'],$this->_fields); } - + function show_news_prefs() { @@ -1730,7 +1730,7 @@ class admin_newspost - function showMaintenance() + function showMaintenance() { require_once(e_HANDLER."form_handler.php"); $frm = new e_form(true); //enable inner tabindex counter @@ -1745,7 +1745,7 @@ class admin_newspost - + ".LAN_NEWS_56." @@ -1769,13 +1769,13 @@ class admin_newspost global $sql2; $e107 = &e107::getInstance(); - $qry = "SELECT + $qry = "SELECT COUNT(`comment_id`) AS c_count, `comment_item_id` FROM `#comments` WHERE (`comment_type`='0') OR (`comment_type`='news') GROUP BY `comment_item_id`"; - + if ($e107->sql->db_Select_gen($qry)) { while ($row = $e107->sql->db_Fetch(MYSQL_ASSOC)) @@ -1837,4 +1837,3 @@ function newspost_adminmenu() global $newspost; $newspost->show_options(); } -?> \ No newline at end of file diff --git a/e107_admin/prefs.php b/e107_admin/prefs.php index 5a0bf1244..138a09786 100644 --- a/e107_admin/prefs.php +++ b/e107_admin/prefs.php @@ -9,9 +9,9 @@ * Administration - Site Preferences * * $Source: /cvs_backup/e107_0.8/e107_admin/prefs.php,v $ - * $Revision: 1.31 $ - * $Date: 2009-07-09 02:47:11 $ - * $Author: e107coders $ + * $Revision: 1.32 $ + * $Date: 2009-07-18 10:17:56 $ + * $Author: marj_nl_fr $ * */ require_once ("../class2.php"); @@ -63,7 +63,7 @@ if(isset($_POST['updateprefs'])) $_POST['siteurl'] = trim($_POST['siteurl']) ? trim($_POST['siteurl']) : SITEURL; $_POST['siteurl'] = substr($_POST['siteurl'], - 1) == "/" ? $_POST['siteurl'] : $_POST['siteurl']."/"; - // If email verification or Email/Password Login Method - email address is required! + // If email verification or Email/Password Login Method - email address is required! if($_POST['user_reg_veri'] == 1 && $_POST['allowEmailLogin'] == 1) { $_POST['disable_emailcheck'] = 0; @@ -71,7 +71,7 @@ if(isset($_POST['updateprefs'])) // Table of range checking values - min and max for numerics. Only do the important ones $pref_limits = array('loginname_maxlength' => array('min' => 10, 'max' => 100, 'default' => 30), - 'displayname_maxlength' => array('min' => 5, 'max' => 30, 'default' => 15), + 'displayname_maxlength' => array('min' => 5, 'max' => 30, 'default' => 15), 'antiflood_timeout' => array('min' => 3, 'max' => 300, 'default' => 10), 'signup_pass_len' => array('min' => 2, 'max' => 100, 'default' => 4) ); @@ -129,7 +129,7 @@ if(isset($_POST['updateprefs'])) } else { - include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/admin/lan_admin.php'); +// done in class2: include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/admin/lan_admin.php'); $emessage->add(LAN_NO_CHANGE); } } @@ -1176,4 +1176,3 @@ function headerjs() return $ret; } -?> \ No newline at end of file diff --git a/e107_plugins/admin_menu/admin_menu.php b/e107_plugins/admin_menu/admin_menu.php index 2b9b2d70c..2ae699765 100644 --- a/e107_plugins/admin_menu/admin_menu.php +++ b/e107_plugins/admin_menu/admin_menu.php @@ -1,27 +1,27 @@ db_Select("plugin", "*", "plugin_installflag=1")) { - while ($row = $sql->db_Fetch()) { + if ($sql->db_Select("plugin", "*", "plugin_installflag=1")) + { + while ($row = $sql->db_Fetch()) + { include(e_PLUGIN.$row['plugin_path']."/plugin.php"); - if ($eplug_conffile) { + if ($eplug_conffile) + { $array_functions[] = array(e_PLUGIN.$row['plugin_path']."/".$eplug_conffile, $tp->toHtml($eplug_name,"","defs,emotes_off, no_make_clickable"), "P".$row['plugin_id']); } unset($eplug_conffile, $eplug_name, $eplug_caption, $eplug_icon_small); @@ -44,7 +47,8 @@ if (ADMIN == TRUE) { $amtext = "