/** * get all hook off module, return list option hook */ public function ajaxProcessgetModuleHookOption() { $html = ''; $id_module = (int) Tools::getValue('id_module'); $id_hook = (int) Tools::getValue('id_hook'); $hookname = Hook::getNameById($id_hook); $id_option = (int) Tools::getValue('id_option'); $option = new Options($id_option); if ($id_module && Validate::isUnsignedId($id_module) && $hookname && Validate::isHookName($hookname) && $option && Validate::isLoadedObject($option)) { $moduleObject = Module::getInstanceById($id_module); $optionModules = OvicLayoutControl::getModulesHook($option->theme, $option->alias, $hookname); $optionModules = Tools::jsonDecode($optionModules['modules'], true); $html = OvicLayoutControl::getHookOptionByModule($optionModules, $hookname, $moduleObject); } echo $html; }
/** * overide hook process */ public function ajaxProcessdisplayChangeHook() { $result = ""; $pagemeta = Tools::getValue('pagemeta'); $hookcolumn = Tools::getValue('hookcolumn'); $hookName = 'display' . ucfirst(trim($hookColumn)) . 'Column'; if (Validate::isHookName($hookName)) { $id_module = (int) Tools::getValue('id_module'); $id_hookexec = (int) Tools::getValue('id_hookexec'); if ($id_module && Validate::isUnsignedId($id_module) && $id_hookexec && Validate::isUnsignedId($id_hookexec)) { $moduleObject = Module::getInstanceById($id_module); $optionModules = OvicLayoutControl::getSideBarModulesByPage($pagemeta, $hookcolumn, false); //$this->echoArr($optionModules); $hookOptions = OvicLayoutControl::getHookOptionByModule($optionModules, $hookName, $moduleObject, $id_hookexec, true); } $tpl = $this->createTemplate('changehook.tpl'); $tpl->assign(array('postUrl' => self::$currentIndex . '&token=' . Tools::getAdminTokenLite('AdminLayoutSetting'), 'hookcolumn' => $hookcolumn, 'pagemeta' => $pagemeta, 'old_hook' => $id_hookexec, 'id_module' => $id_module, 'hookOptions' => $hookOptions)); $result .= $tpl->fetch(); } die(Tools::jsonEncode($result)); }