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

git-svn-id: http://dev.prestashop.com/svn/v1/branches/1.5.x@14896 b9a71923-0436-4b27-9f14-aed3839534dd
This commit is contained in:
rMalie
2012-04-26 09:23:22 +00:00
parent e01a890c01
commit 37459552a8
+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);
}
}