public function postProcess() { if (Tools::isSubmit('submit' . $this->className)) { if (!$this->manageLinkList()) { return false; } $hook_name = Hook::getNameById(Tools::getValue('id_hook')); if (!Hook::isModuleRegisteredOnHook($this->module, $hook_name, $this->context->shop->id)) { Hook::registerHook($this->module, $hook_name); } $this->module->_clearCache($this->module->templateFile); Tools::redirectAdmin($this->context->link->getAdminLink('Admin' . $this->name)); } elseif (Tools::isSubmit('delete' . $this->className)) { if (!$this->deleteLinkList()) { return false; } $this->module->_clearCache($this->module->templateFile); Tools::redirectAdmin($this->context->link->getAdminLink('Admin' . $this->name)); } return parent::postProcess(); }
/** * Connect module to a hook * * @param string $hook_name Hook name * @param array $shop_list List of shop linked to the hook (if null, link hook to all shops) * @return bool result */ public function registerHook($hook_name, $shop_list = null) { return Hook::registerHook($this, $hook_name, $shop_list); }