Fix: restore broken feature (hooks)
This commit is contained in:
parent
df28f09286
commit
315fba37fc
@ -52,13 +52,11 @@ class Conf
|
|||||||
public $smart_menu;
|
public $smart_menu;
|
||||||
|
|
||||||
public $modules = array(); // List of activated modules
|
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
|
// TODO Remove thoose arrays with generic module_parts
|
||||||
public $tabs_modules = array();
|
public $tabs_modules = array();
|
||||||
public $sms_engine_modules = array();
|
public $sms_engine_modules = array();
|
||||||
// TODO Remove thoose arrays with generic module_parts
|
|
||||||
public $hooks_modules = array();
|
|
||||||
public $societe_modules = array();
|
public $societe_modules = array();
|
||||||
|
|
||||||
var $logbuffer = array();
|
var $logbuffer = array();
|
||||||
|
|||||||
@ -70,14 +70,14 @@ class HookManager
|
|||||||
global $conf;
|
global $conf;
|
||||||
|
|
||||||
// Test if there is hooks to manage
|
// 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
|
// For backward compatibility
|
||||||
if (! is_array($arraycontext)) $arraycontext=array($arraycontext);
|
if (! is_array($arraycontext)) $arraycontext=array($arraycontext);
|
||||||
|
|
||||||
$this->contextarray=array_unique(array_merge($arraycontext,$this->contextarray)); // All contexts are concatenated
|
$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)
|
if ($conf->$module->enabled)
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user