From 54b05a02d9fb5f9a9aaaed71ccc450367b0a7abe Mon Sep 17 00:00:00 2001 From: fSerny Date: Mon, 21 Nov 2011 23:42:33 +0000 Subject: [PATCH] [*] BO : AdminModules improved performance --- controllers/admin/AdminModulesController.php | 24 +++++++++++++++----- 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/controllers/admin/AdminModulesController.php b/controllers/admin/AdminModulesController.php index 96cf63973..eb89c0861 100644 --- a/controllers/admin/AdminModulesController.php +++ b/controllers/admin/AdminModulesController.php @@ -616,22 +616,34 @@ class AdminModulesControllerCore extends AdminController ** Display Modules Lists ** */ - + private $translationsTab = array(); public function displayModuleOptions($module) - { + { + if (!isset($this->translationsTab['Disable this module'])) + { + $this->translationsTab['Disable this module'] = $this->l('Disable this module'); + $this->translationsTab['Enable this module for all shops'] = $this->l('Enable this module for all shops'); + $this->translationsTab['Disable'] = $this->l('Disable'); + $this->translationsTab['Enable'] = $this->l('Enable'); + $this->translationsTab['Reset'] = $this->l('Reset'); + $this->translationsTab['Configure'] = $this->l('Configure'); + $this->translationsTab['Delete'] = $this->l('Delete'); + $this->translationsTab['This action will permanently remove the module from the server. Are you sure you want to do this ?'] = $this->l('This action will permanently remove the module from the server. Are you sure you want to do this ?'); + } + $return = ''; $href = self::$currentIndex.'&token='.$this->token.'&module_name='.urlencode($module->name).'&tab_module='.$module->tab; if ($module->id) - $return .= 'active && method_exists($module, 'onclickOption')? 'onclick="'.$module->onclickOption('desactive', $href).'"' : '').' href="'.self::$currentIndex.'&token='.$this->token.'&module_name='.urlencode($module->name).'&'.($module->active ? 'enable=0' : 'enable=1').'&tab_module='.$module->tab.'" '.((Shop::isFeatureActive()) ? 'title="'.htmlspecialchars($module->active ? $this->l('Disable this module') : $this->l('Enable this module for all shops')).'"' : '').'>'.($module->active ? $this->l('Disable') : $this->l('Enable')).''; + $return .= 'active && method_exists($module, 'onclickOption')? 'onclick="'.$module->onclickOption('desactive', $href).'"' : '').' href="'.self::$currentIndex.'&token='.$this->token.'&module_name='.urlencode($module->name).'&'.($module->active ? 'enable=0' : 'enable=1').'&tab_module='.$module->tab.'" '.((Shop::isFeatureActive()) ? 'title="'.htmlspecialchars($module->active ? $this->translationsTab['Disable this module'] : $this->translationsTab['Enable this module for all shops']).'"' : '').'>'.($module->active ? $this->translationsTab['Disable'] : $this->translationsTab['Enable']).''; if ($module->id AND $module->active) - $return .= (!empty($result) ? '|' : '').''.$this->l('Reset').''; + $return .= (!empty($result) ? '|' : '').''.$this->translationsTab['Reset'].''; if ($module->id AND (method_exists($module, 'getContent') OR (isset($module->is_configurable) AND $module->is_configurable) OR Shop::isFeatureActive())) - $return .= (!empty($result) ? '|' : '').''.$this->l('Configure').''; + $return .= (!empty($result) ? '|' : '').''.$this->translationsTab['Configure'].''; $hrefDelete = self::$currentIndex.'&delete='.urlencode($module->name).'&token='.$this->token.'&tab_module='.$module->tab.'&module_name='.urlencode($module->name); - $return .= (!empty($result) ? '|' : '').''.$this->l('Delete').''; + $return .= (!empty($result) ? '|' : '').''.$this->translationsTab['Delete'].''; return $return; }