예제 #1
0
 /**
  * Display Bootstrap MegaMenu
  */
 public function hookDisplayTop()
 {
     $this->context->controller->addCSS($this->_path . 'megamenu.css', 'all');
     $tpl = 'views/templates/hook/megamenu.tpl';
     if (!$this->isCached($tpl, $this->getCacheId())) {
         $link = new Link();
         $params = array();
         $params['params'] = Configuration::get('LEO_MEGAMENU_PARAMS');
         $show_cavas = Configuration::get('LEO_MEGAMENU_CAVAS');
         $current_link = $link->getPageLink('', false, $this->context->language->id);
         if (isset($params['params']) && !empty($params['params'])) {
             # validate module
             $params['params'] = Tools::jsonDecode($params['params']);
         }
         $obj = new Btmegamenu();
         $obj->setModule($this);
         $boostrapmenu = $obj->getFrontTree(1, false, $params['params']);
         $this->smarty->assign('boostrapmenu', $boostrapmenu);
         $this->smarty->assign('current_link', $current_link);
         $this->smarty->assign('show_cavas', $show_cavas);
         return $this->display(__FILE__, $tpl, $this->getCacheId());
     }
     return $this->display(__FILE__, $tpl, $this->getCacheId());
 }
예제 #2
0
 public function hookDisplayTop()
 {
     $theme = $this->getParams()->get('theme', 'default');
     $this->context->controller->addCSS($this->_path . 'themes/' . $theme . '/assets/styles.css');
     $tpl = 'themes/default/default.tpl';
     if (file_exists(dirname(__FILE__) . "/themes/" . $theme . '/default.tpl')) {
         $tpl = 'themes/' . $theme . '/default.tpl';
     }
     $menu_config = array();
     foreach ($this->_configs as $key => $config) {
         $menu_config[$key] = $this->getParams()->get($key, $config);
     }
     $obj = new Btmegamenu();
     $menu_tree = $obj->getFrontTree();
     $this->smarty->assign('leobootstrapmenu_menu_tree', $menu_tree);
     $this->smarty->assign('leobootstrapmenu', $menu_config);
     return $this->display(__FILE__, $tpl);
 }