name = 'cms_menu'; $this->tab = 'front_office_features'; $this->version = '1.0'; $this->author = 'Antadis'; $this->need_instance = 0; $this->bootstrap = true; parent::__construct(); $this->displayName = $this->l('Menu for CMS ANTADIS'); $this->description = $this->l('Display menu for CMS Antadis'); $this->secure_key = Tools::encrypt($this->name); $this->ps_versions_compliancy = array('min' => '1.6', 'max' => _PS_VERSION_); } public function install() { if (Shop::isFeatureActive()) Shop::setContext(Shop::CONTEXT_ALL); if (!parent::install() || !$this->createTables() || !$this->registerHook('displaytopMenu') || !$this->registerHook('displaybottomMenu') ) return false; } public function createTables () { return true; } public function hookdisplaytopMenu($params) { $id_lang = Context::getContext()->language->id; $categories = $this->getRootCategory($id_lang); $this->smarty->assign(array( 'categories' => $categories, )); return $this->display(__FILE__, 'menu.tpl'); } protected function getRootCategory($id_lang) { $collection_post = new Collection('CmsPsCategory', $id_lang); $collection_post->where('id_parent', '=', 0); $collection_post->where('active', '=', 1); return $collection_post->getResults(); } }