From f1c42c5b84fb5ad710a34a655a6812575ab0aa6e Mon Sep 17 00:00:00 2001 From: SecretR Date: Fri, 30 Nov 2012 14:46:21 +0200 Subject: [PATCH] plugin language files autoload - backward compatibility, also #15 related --- e107_admin/boot.php | 16 ++++++++++++++-- e107_core/shortcodes/batch/admin_shortcodes.php | 11 ++++++----- 2 files changed, 20 insertions(+), 7 deletions(-) diff --git a/e107_admin/boot.php b/e107_admin/boot.php index 06c1c0f2b..d5387297a 100644 --- a/e107_admin/boot.php +++ b/e107_admin/boot.php @@ -20,10 +20,23 @@ if (!defined('e107_INIT')) header('Content-type: text/html; charset=utf-8', TRUE); - +### Language files e107::coreLan('header', true); e107::coreLan('footer', true); +// DEPRECATED - plugins should load their lans manually +// plugin autoload, will be removed in the future! +// here mostly because of BC reasons +$_plugins = e107::getPref('plug_installed'); +if(is_array($_plugins) && count($_plugins) > 0) +{ + $_plugins = array_keys($_plugins); + foreach ($_plugins as $_p) + { + e107::loadLanFiles($_p, 'admin'); + } +} + // Get Icon constants, theme override (theme/templates/admin_icons_template.php) is allowed include_once(e107::coreTemplatePath('admin_icons')); @@ -383,4 +396,3 @@ if (!function_exists("parse_admin")) } } } - diff --git a/e107_core/shortcodes/batch/admin_shortcodes.php b/e107_core/shortcodes/batch/admin_shortcodes.php index 590c433bd..a96ffce6a 100644 --- a/e107_core/shortcodes/batch/admin_shortcodes.php +++ b/e107_core/shortcodes/batch/admin_shortcodes.php @@ -1224,7 +1224,7 @@ class admin_shortcodes $tmpl = strtoupper(varset($parms['tmpl'], 'E_ADMIN_NAVIGATION')); global $$tmpl; - require(e_ADMIN.'ad_links.php'); + require_once(e_ADMIN.'ad_links.php'); require_once(e_HANDLER.'admin_handler.php'); if($parm == 'home' || $parm == 'logout' || $parm == 'language') @@ -1313,12 +1313,13 @@ class admin_shortcodes { $plug_vars = $plug->plug_vars; - if($row['plugin_path']=='tinymce') - { + //if($row['plugin_path']=='tinymce') + //{ // print_a($plug_vars); - } + //} - e107::loadLanFiles($row['plugin_path'], 'admin'); + // moved to boot.php + // e107::loadLanFiles($row['plugin_path'], 'admin'); if(varset($plug_vars['adminLinks']['link'])) {