From 315fba37fc184bb9ca08f3bb7d138b45734c44da Mon Sep 17 00:00:00 2001 From: Regis Houssin Date: Wed, 13 Jun 2012 09:17:55 +0200 Subject: [PATCH] Fix: restore broken feature (hooks) --- htdocs/core/class/conf.class.php | 6 ++---- htdocs/core/class/hookmanager.class.php | 4 ++-- 2 files changed, 4 insertions(+), 6 deletions(-) diff --git a/htdocs/core/class/conf.class.php b/htdocs/core/class/conf.class.php index 2914a1aecd1..32f4634e40e 100644 --- a/htdocs/core/class/conf.class.php +++ b/htdocs/core/class/conf.class.php @@ -52,13 +52,11 @@ class Conf public $smart_menu; public $modules = array(); // List of activated modules - public $modules_parts = array('js'=>array(),'triggers'=>array(),'login'=>array(),'substitutions'=>array(),'menus'=>array(),'theme'=>array(),'tpl'=>array(),'barcode'=>array(),'models'=>array()); // List of modules parts + public $modules_parts = array('js'=>array(),'triggers'=>array(),'login'=>array(),'substitutions'=>array(),'menus'=>array(),'theme'=>array(),'tpl'=>array(),'barcode'=>array(),'models'=>array(),'hooks'=>array()); // List of modules parts // TODO Remove thoose arrays with generic module_parts public $tabs_modules = array(); public $sms_engine_modules = array(); - // TODO Remove thoose arrays with generic module_parts - public $hooks_modules = array(); public $societe_modules = array(); var $logbuffer = array(); @@ -202,7 +200,7 @@ class Conf } $i++; } - + $db->free($resql); } //var_dump($this->modules); diff --git a/htdocs/core/class/hookmanager.class.php b/htdocs/core/class/hookmanager.class.php index a7f0edd173f..46230d678b2 100755 --- a/htdocs/core/class/hookmanager.class.php +++ b/htdocs/core/class/hookmanager.class.php @@ -70,14 +70,14 @@ class HookManager global $conf; // Test if there is hooks to manage - if (! is_array($conf->hooks_modules) || empty($conf->hooks_modules)) return; + if (! is_array($conf->modules_parts['hooks']) || empty($conf->modules_parts['hooks'])) return; // For backward compatibility if (! is_array($arraycontext)) $arraycontext=array($arraycontext); $this->contextarray=array_unique(array_merge($arraycontext,$this->contextarray)); // All contexts are concatenated - foreach($conf->hooks_modules as $module => $hooks) + foreach($conf->modules_parts['hooks'] as $module => $hooks) { if ($conf->$module->enabled) {