[*] BO : Adding hook on AdminProducts

This commit is contained in:
fSerny
2012-01-27 14:45:35 +00:00
parent 6ce19f8427
commit fd457c56ff
@@ -162,6 +162,16 @@ class AdminProductsControllerCore extends AdminController
'Accounting' => $this->l('Accounting')
);
/* Adding tab if modules are hooked */
$modules_list = Hook::getHookModuleExecList('displayAdminProductsExtra');
if (is_array($modules_list) && count($modules_list) > 0)
{
$this->available_tabs['Others'] = 23;
$this->available_tabs_lang['Others'] = $this->l('Others');
}
/* Join categories table */
if ($id_category = (int)Tools::getValue('productFilter_cl!name'))
{
@@ -3763,6 +3773,17 @@ class AdminProductsControllerCore extends AdminController
$this->tpl_form_vars['input_namepack_items'] = $input_namepack_items;
}
/**
* AdminProducts display hook
*/
public function initFormOthers($obj)
{
$this->tpl_form_vars['custom_form'] = hook::exec('displayAdminProductsExtra');
}
/**
* delete all items in pack, then check if type_product value is 2.
* if yes, add the pack items from input "inputPackItems"