1
0
mirror of https://github.com/e107inc/e107.git synced 2025-08-02 04:40:44 +02:00

Reduced the number of file includes. Only load admin language files when necessary.

This commit is contained in:
Cameron
2015-02-12 13:09:56 -08:00
parent b03abcff1f
commit 6811c479d1
4 changed files with 17 additions and 4 deletions

View File

@@ -1941,6 +1941,8 @@ function include_lan_admin($path)
//DEPRECATED - use e107::loadLanFiles(); //DEPRECATED - use e107::loadLanFiles();
function loadLanFiles($unitName, $type='runtime') function loadLanFiles($unitName, $type='runtime')
{ {
$info = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS,2);
e107::getMessage()->addDebug("Using deprecated function loanLanFiles(). Replace with e107::loadLanFiles().".print_a($info,true));
return e107::loadLanFiles($unitName, $type); return e107::loadLanFiles($unitName, $type);
} }

View File

@@ -29,13 +29,18 @@ e107::coreLan('footer', true);
// here mostly because of BC reasons // here mostly because of BC reasons
//if(!deftrue('e_MINIMAL')) //if(!deftrue('e_MINIMAL'))
{ {
$_globalLans = e107::pref('core', 'lan_global_list');
$_plugins = e107::getPref('plug_installed'); $_plugins = e107::getPref('plug_installed');
if(is_array($_plugins) && count($_plugins) > 0) if(is_array($_plugins) && count($_plugins) > 0)
{ {
$_plugins = array_keys($_plugins); $_plugins = array_keys($_plugins);
foreach ($_plugins as $_p) foreach ($_plugins as $_p)
{ {
if(in_array($_p, $_globalLans) && e_CURRENT_PLUGIN != $_p) // filter out those with globals unless we are in a plugin folder.
{
continue;
}
e107::loadLanFiles($_p, 'admin'); e107::loadLanFiles($_p, 'admin');
} }
} }
@@ -57,7 +62,7 @@ if(!defset('e_ADMIN_UI') && !defset('e_PAGETITLE'))
$link = str_replace("../","",$val[0]); $link = str_replace("../","",$val[0]);
if(strpos(e_SELF,$link)!==FALSE) if(strpos(e_SELF,$link)!==FALSE)
{ {
define('e_PAGETITLE',$val[1]); // define('e_PAGETITLE',$val[1]);
} }
} }
} }

View File

@@ -825,7 +825,7 @@ class admin_shortcodes
if (is_readable(e_PLUGIN.$plugin_path.'/plugin.xml')) if (is_readable(e_PLUGIN.$plugin_path.'/plugin.xml'))
{ {
$readFile = $xml->loadXMLfile(e_PLUGIN.$plugin_path.'/plugin.xml', true, true); $readFile = $xml->loadXMLfile(e_PLUGIN.$plugin_path.'/plugin.xml', true, true);
e107::loadLanFiles($plugin_path, 'admin'); // e107::loadLanFiles($plugin_path, 'admin');
$eplug_caption = $tp->toHTML($readFile['@attributes']['name'], FALSE, 'defs, emotes_off'); $eplug_caption = $tp->toHTML($readFile['@attributes']['name'], FALSE, 'defs, emotes_off');
$eplug_conffile = $readFile['administration']['configFile']; $eplug_conffile = $readFile['administration']['configFile'];
} }

View File

@@ -943,6 +943,8 @@ i.e-cat_users-32{ background-position: -555px 0; width: 32px; height: 32px; }
$plugs = e107::getObject('e107plugin'); $plugs = e107::getObject('e107plugin');
if(vartrue($pref['plug_installed'])) if(vartrue($pref['plug_installed']))
{ {
foreach($pref['plug_installed'] as $plug=>$vers) foreach($pref['plug_installed'] as $plug=>$vers)
@@ -969,8 +971,12 @@ i.e-cat_users-32{ background-position: -555px 0; width: 32px; height: 32px; }
{ {
continue; continue;
} }
loadLanFiles($plugin_path, 'admin');
if(!in_array($plugin_path, $pref['lan_global_list']))
{
e107::loadLanFiles($plugin_path, 'admin');
}
$att = $tag['@attributes']; $att = $tag['@attributes'];