// Smarty hook can now take a module name for hook execution #PSCFV-1888

This commit is contained in:
rMalie
2012-04-26 09:23:22 +00:00
parent e580832934
commit 85e8ea51be
+10 -2
View File
@@ -172,11 +172,19 @@ function smartyRegisterFunction($smarty, $type, $function, $params, $lazy = true
function smartyHook($params, &$smarty)
{
if (isset($params['h']) && !empty($params['h']))
if (!empty($params['h']))
{
$id_module = null;
$hook_params = $params;
if (!empty($params['mod']))
{
$module = Module::getInstanceByName($params['mod']);
if ($module && $module->id)
$id_module = $module->id;
unset($hook_params['mod']);
}
unset($hook_params['h']);
return Hook::exec($params['h'], $hook_params);
return Hook::exec($params['h'], $hook_params, $id_module);
}
}