From 3770b7ffccd45b0d668dfee2d6e361145a42fdad Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Thu, 23 Feb 2012 19:42:57 +0100 Subject: [PATCH] Fix: remove obsolete code --- htdocs/core/class/conf.class.php | 53 ++++++++------------------------ 1 file changed, 12 insertions(+), 41 deletions(-) diff --git a/htdocs/core/class/conf.class.php b/htdocs/core/class/conf.class.php index 55ce8e56755..ef91ed7d202 100644 --- a/htdocs/core/class/conf.class.php +++ b/htdocs/core/class/conf.class.php @@ -142,19 +142,18 @@ class Conf if ($value && preg_match('/^MAIN_MODULE_/',$key)) { - // If this is constant for a css file activated by a module - // TODO obsolete (see generic parts) - if (preg_match('/^MAIN_MODULE_([A-Z_]+)_CSS$/i',$key,$reg)) - { - $modulename = strtolower($reg[1]); - $this->css_modules[$modulename]=$value; - } // If this is constant for a new tab page activated by a module. - elseif (preg_match('/^MAIN_MODULE_([A-Z_]+)_TABS_/i',$key)) + if (preg_match('/^MAIN_MODULE_([A-Z_]+)_TABS_/i',$key)) { $params=explode(':',$value,2); $this->tabs_modules[$params[0]][]=$value; } + // If this is constant for a sms engine + elseif (preg_match('/^MAIN_MODULE_([A-Z_]+)_SMS$/i',$key,$reg)) + { + $module=strtolower($reg[1]); + $this->sms_engine_modules[$module]=$module; // Add this module in list of modules that provide SMS + } // If this is constant for hook activated by a module. Value is list of hooked tabs separated with ':' // TODO obsolete (see generic parts) elseif (preg_match('/^MAIN_MODULE_([A-Z_]+)_HOOKS$/i',$key,$reg)) @@ -166,11 +165,12 @@ class Conf $this->hooks_modules[$modulename][]=$value; } } - // If this is constant for a sms engine - elseif (preg_match('/^MAIN_MODULE_([A-Z_]+)_SMS$/i',$key,$reg)) + // If this is constant for a css file activated by a module + // TODO obsolete (see generic parts) + elseif (preg_match('/^MAIN_MODULE_([A-Z_]+)_CSS$/i',$key,$reg)) { - $module=strtolower($reg[1]); - $this->sms_engine_modules[$module]=$module; // Add this module in list of modules that provide SMS + $modulename = strtolower($reg[1]); + $this->css_modules[$modulename]=$value; } // If this is constant for triggers activated by a module // TODO obsolete (see generic parts) @@ -190,35 +190,6 @@ class Conf else $value = ($value == 1 ? '/'.$modulename.'/core/'.$partname.'/' : '/'.$modulename.$value); $this->$varname = array_merge($this->$varname, array($modulename => $value)); } - - // TODO All of this part could be mutualized into one generic part - /* - // If this is constant for login method activated by a module - elseif (preg_match('/^MAIN_MODULE_([A-Z_]+)_LOGIN$/i',$key,$reg)) - { - $modulename = strtolower($reg[1]); - $this->login_modules[$modulename] = '/'.$modulename.'/core/login/'; - } - // If this is constant for a new tab page activated by a module - elseif (preg_match('/^MAIN_MODULE_([A-Z_]+)_MENUS$/i',$key,$reg)) - { - $modulename = strtolower($reg[1]); - $this->menus_modules[$modulename] = '/'.$modulename.'/core/menus/'; - } - // If this is constant for triggers activated by a module - elseif (preg_match('/^MAIN_MODULE_([A-Z_]+)_TRIGGERS$/i',$key,$reg)) - { - $modulename = strtolower($reg[1]); - $this->triggers_modules[$modulename] = '/'.$modulename.'/core/triggers/'; - } - // If this is constant for triggers activated by a module - elseif (preg_match('/^MAIN_MODULE_([A-Z_]+)_SUBSTITUTIONS$/i',$key,$reg)) - { - $modulename = strtolower($reg[1]); - $this->substitutions_modules[$modulename] = '/'.$modulename.'/core/substitutions/'; - } - */ - // If this is a module constant (must be at end) elseif (preg_match('/^MAIN_MODULE_([A-Z_]+)$/i',$key,$reg)) {