1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-02 12:48:26 +02:00

Load admin phrases ASAP

This commit is contained in:
marj
2009-07-18 10:17:56 +00:00
parent 037ae9fd1a
commit 037e91cfee
5 changed files with 64 additions and 56 deletions

View File

@@ -9,9 +9,9 @@
* General purpose file * General purpose file
* *
* $Source: /cvs_backup/e107_0.8/class2.php,v $ * $Source: /cvs_backup/e107_0.8/class2.php,v $
* $Revision: 1.108 $ * $Revision: 1.109 $
* $Date: 2009-07-16 02:55:18 $ * $Date: 2009-07-18 10:17:56 $
* $Author: e107coders $ * $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 $e107Path = str_replace($e107->base_path, '', e_SELF); // Knock off the initial bits
if ( if (
(!$isPluginDir && strpos($e107Path, $ADMIN_DIRECTORY) === 0 ) // Core admin directory (!$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 || (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(!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) /* if (strpos(e_SELF, "newspost.php") !== FALSE)
{ {
define("MAINTHEME", e_THEME.$pref['sitetheme']."/"); MAINTHEME no longer used in core distribution 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) elseif (USERTHEME !== false && USERTHEME != 'USERTHEME' && !$inAdminDir)
{ {
checkvalidtheme(USERTHEME); checkvalidtheme(USERTHEME);
} }
else else
{ {
checkvalidtheme($pref['sitetheme']); checkvalidtheme($pref['sitetheme']);
} }

View File

@@ -9,20 +9,23 @@
* Administration Area Authorization * Administration Area Authorization
* *
* $Source: /cvs_backup/e107_0.8/e107_admin/auth.php,v $ * $Source: /cvs_backup/e107_0.8/e107_admin/auth.php,v $
* $Revision: 1.8 $ * $Revision: 1.9 $
* $Date: 2009-07-07 06:50:55 $ * $Date: 2009-07-18 10:17:56 $
* $Author: e107coders $ * $Author: marj_nl_fr $
*/ */
if (!defined('e107_INIT')) { exit; } if (!defined('e107_INIT')) { exit; }
/* done in class2
@include_once(e_LANGUAGEDIR.e_LANGUAGE."/admin/lan_admin.php"); @include_once(e_LANGUAGEDIR.e_LANGUAGE."/admin/lan_admin.php");
@include_once(e_LANGUAGEDIR."English/admin/lan_admin.php"); @include_once(e_LANGUAGEDIR."English/admin/lan_admin.php");
*/
if (ADMIN) if (ADMIN)
{ {
define("ADMIN_PAGE", true); define("ADMIN_PAGE", true);
//don't include it if it'a an AJAX call or not wanted //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 * FIXME - missing $style for tablerender
* The Solution: parse_admin() without sending it to the browser if it's an ajax call * The Solution: parse_admin() without sending it to the browser if it's an ajax call

View File

@@ -9,9 +9,9 @@
* News Administration * News Administration
* *
* $Source: /cvs_backup/e107_0.8/e107_admin/newspost.php,v $ * $Source: /cvs_backup/e107_0.8/e107_admin/newspost.php,v $
* $Revision: 1.44 $ * $Revision: 1.45 $
* $Date: 2009-07-17 07:53:13 $ * $Date: 2009-07-18 10:17:56 $
* $Author: e107coders $ * $Author: marj_nl_fr $
*/ */
require_once("../class2.php"); 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->page = "newspost.php?create"; // display preset options on which page(s).
$pst->id = "admin_newspost"; $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); $newspost = new admin_newspost(e_QUERY, $pst);
$gen = new convert(); $gen = new convert();
@@ -546,7 +546,7 @@ class admin_newspost
$temp['news_newdateheader'] = intval($_POST['news_newdateheader']); $temp['news_newdateheader'] = intval($_POST['news_newdateheader']);
$temp['news_unstemplate'] = intval($_POST['news_unstemplate']); $temp['news_unstemplate'] = intval($_POST['news_unstemplate']);
$temp['news_editauthor'] = intval($_POST['news_editauthor']); $temp['news_editauthor'] = intval($_POST['news_editauthor']);
if ($admin_log->logArrayDiffs($temp, $pref, 'NEWS_06')) if ($admin_log->logArrayDiffs($temp, $pref, 'NEWS_06'))
{ {
save_prefs(); // Only save if changes save_prefs(); // Only save if changes
@@ -1524,7 +1524,7 @@ class admin_newspost
$frm = new e_form(true); $frm = new e_form(true);
echo $frm->filterValue($_POST['filtertype'],$this->_fields); echo $frm->filterValue($_POST['filtertype'],$this->_fields);
} }
function show_news_prefs() function show_news_prefs()
{ {
@@ -1730,7 +1730,7 @@ class admin_newspost
function showMaintenance() function showMaintenance()
{ {
require_once(e_HANDLER."form_handler.php"); require_once(e_HANDLER."form_handler.php");
$frm = new e_form(true); //enable inner tabindex counter $frm = new e_form(true); //enable inner tabindex counter
@@ -1745,7 +1745,7 @@ class admin_newspost
<colgroup span='2'> <colgroup span='2'>
<col class='col-label'></col> <col class='col-label'></col>
<col class='col-control'></col> <col class='col-control'></col>
</colgroup> </colgroup>
<tbody> <tbody>
<tr> <tr>
<td class='label'>".LAN_NEWS_56."</td> <td class='label'>".LAN_NEWS_56."</td>
@@ -1769,13 +1769,13 @@ class admin_newspost
global $sql2; global $sql2;
$e107 = &e107::getInstance(); $e107 = &e107::getInstance();
$qry = "SELECT $qry = "SELECT
COUNT(`comment_id`) AS c_count, COUNT(`comment_id`) AS c_count,
`comment_item_id` `comment_item_id`
FROM `#comments` FROM `#comments`
WHERE (`comment_type`='0') OR (`comment_type`='news') WHERE (`comment_type`='0') OR (`comment_type`='news')
GROUP BY `comment_item_id`"; GROUP BY `comment_item_id`";
if ($e107->sql->db_Select_gen($qry)) if ($e107->sql->db_Select_gen($qry))
{ {
while ($row = $e107->sql->db_Fetch(MYSQL_ASSOC)) while ($row = $e107->sql->db_Fetch(MYSQL_ASSOC))
@@ -1837,4 +1837,3 @@ function newspost_adminmenu()
global $newspost; global $newspost;
$newspost->show_options(); $newspost->show_options();
} }
?>

View File

@@ -9,9 +9,9 @@
* Administration - Site Preferences * Administration - Site Preferences
* *
* $Source: /cvs_backup/e107_0.8/e107_admin/prefs.php,v $ * $Source: /cvs_backup/e107_0.8/e107_admin/prefs.php,v $
* $Revision: 1.31 $ * $Revision: 1.32 $
* $Date: 2009-07-09 02:47:11 $ * $Date: 2009-07-18 10:17:56 $
* $Author: e107coders $ * $Author: marj_nl_fr $
* *
*/ */
require_once ("../class2.php"); require_once ("../class2.php");
@@ -63,7 +63,7 @@ if(isset($_POST['updateprefs']))
$_POST['siteurl'] = trim($_POST['siteurl']) ? trim($_POST['siteurl']) : SITEURL; $_POST['siteurl'] = trim($_POST['siteurl']) ? trim($_POST['siteurl']) : SITEURL;
$_POST['siteurl'] = substr($_POST['siteurl'], - 1) == "/" ? $_POST['siteurl'] : $_POST['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) if($_POST['user_reg_veri'] == 1 && $_POST['allowEmailLogin'] == 1)
{ {
$_POST['disable_emailcheck'] = 0; $_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 // 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), $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), 'antiflood_timeout' => array('min' => 3, 'max' => 300, 'default' => 10),
'signup_pass_len' => array('min' => 2, 'max' => 100, 'default' => 4) 'signup_pass_len' => array('min' => 2, 'max' => 100, 'default' => 4)
); );
@@ -129,7 +129,7 @@ if(isset($_POST['updateprefs']))
} }
else 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); $emessage->add(LAN_NO_CHANGE);
} }
} }
@@ -1176,4 +1176,3 @@ function headerjs()
return $ret; return $ret;
} }
?>

View File

@@ -1,27 +1,27 @@
<?php <?php
/* /*
+ ----------------------------------------------------------------------------+ * e107 website system
| e107 website system *
| * Copyright (C) 2001-2008 e107 Inc (e107.org)
| <20>Steve Dunstan 2001-2002 * Released under the terms and conditions of the
| http://e107.org * GNU General Public License (http://www.gnu.org/licenses/gpl.txt)
| jalist@e107.org *
| * Administration menu
| Released under the terms and conditions of the *
| GNU General Public License (http://gnu.org). * $Source: /cvs_backup/e107_0.8/e107_plugins/admin_menu/admin_menu.php,v $
| * $Revision: 1.2 $
| $Source: /cvs_backup/e107_0.8/e107_plugins/admin_menu/admin_menu.php,v $ * $Date: 2009-07-18 10:17:56 $
| $Revision: 1.1.1.1 $ * $Author: marj_nl_fr $
| $Date: 2006-12-02 04:34:43 $
| $Author: mcfly_e107 $
+----------------------------------------------------------------------------+
*/ */
//@TODO make it 0.8 compatible
if (!defined('e107_INIT')) { exit; } if (!defined('e107_INIT')) { exit; }
global $tp; global $tp;
if (ADMIN == TRUE) { if (ADMIN == TRUE)
@include_once(e_LANGUAGEDIR.e_LANGUAGE."/admin/lan_admin.php"); {
@include_once(e_LANGUAGEDIR."English/admin/lan_admin.php"); // We're not in admin - load generic admin phrases
include_lan(e_LANGUAGEDIR.e_LANGUAGE.'/admin/lan_admin.php');
require_once(e_HANDLER."userclass_class.php"); require_once(e_HANDLER."userclass_class.php");
require_once(e_ADMIN."ad_links.php"); require_once(e_ADMIN."ad_links.php");
@@ -29,10 +29,13 @@ if (ADMIN == TRUE) {
$array_functions[] = array(e_ADMIN."plugin.php", ADLAN_98, "Z"); $array_functions[] = array(e_ADMIN."plugin.php", ADLAN_98, "Z");
if ($sql->db_Select("plugin", "*", "plugin_installflag=1")) { if ($sql->db_Select("plugin", "*", "plugin_installflag=1"))
while ($row = $sql->db_Fetch()) { {
while ($row = $sql->db_Fetch())
{
include(e_PLUGIN.$row['plugin_path']."/plugin.php"); 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']); $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); unset($eplug_conffile, $eplug_name, $eplug_caption, $eplug_icon_small);
@@ -44,7 +47,8 @@ if (ADMIN == TRUE) {
$amtext = "<div style='text-align:center'> $amtext = "<div style='text-align:center'>
<select name='activate' onchange='urljump(this.options[selectedIndex].value)' class='tbox'> <select name='activate' onchange='urljump(this.options[selectedIndex].value)' class='tbox'>
<option>".LAN_SELECT."</option>\n"; <option>".LAN_SELECT."</option>\n";
foreach ($array_functions as $link_value) { foreach ($array_functions as $link_value)
{
$amtext .= render_admin_links($link_value[0], $link_value[1], $link_value[2]); $amtext .= render_admin_links($link_value[0], $link_value[1], $link_value[2]);
} }
@@ -53,9 +57,10 @@ if (ADMIN == TRUE) {
$ns->tablerender(LAN_ADMIN, $amtext, 'admin_menu'); $ns->tablerender(LAN_ADMIN, $amtext, 'admin_menu');
} }
function render_admin_links($link, $title, $perms) { function render_admin_links($link, $title, $perms)
if (getperms($perms)) { {
if (getperms($perms))
{
return "<option value='".$link."'>".$title."</option>"; return "<option value='".$link."'>".$title."</option>";
} }
} }
?>