示例#1
0
文件: Top.php 项目: booklein/bookle
 function _toHtml()
 {
     $show_megamenu = $this->getConfig('show');
     if (!$show_megamenu && is_object($this->getLayout()->getBlock('catalog.topnav'))) {
         return $this->getLayout()->getBlock('catalog.topnav')->toHtml();
     }
     $this->getLayout()->unsetBlock('catalog.topnav');
     //get store
     $store_id = Mage::app()->getStore()->getId();
     $this->assign('store_id', $store_id);
     $parent = $this->getConfig('root_menu_id', 1);
     $parent = !empty($parent) ? (int) $parent : 1;
     $html = $this->getTree($parent, true, $store_id);
     $this->assign('menuHtml', $html);
     $this->assign('config', $this->_config);
     return parent::_toHtml();
 }
示例#2
0
 function _toHtml()
 {
     $show_megamenu = $this->getConfig('show');
     if (!$show_megamenu && is_object($this->getLayout()->getBlock('catalog.topnav'))) {
         return $this->getLayout()->getBlock('catalog.topnav')->toHtml();
     }
     $this->getLayout()->unsetBlock('catalog.topnav');
     //get store
     $store_id = Mage::app()->getStore()->getId();
     $this->assign('store_id', $store_id);
     $parent = '1';
     $html = $this->getTree($parent, true, $store_id);
     $my_template = $this->getTemplate();
     if (empty($my_template)) {
         $this->_config['template'] = 'ves/megamenu/default.phtml';
     } else {
         $this->_config['template'] = $my_template;
     }
     $this->assign('menuHtml', $html);
     $this->assign('config', $this->_config);
     $this->setTemplate($this->_config['template']);
     return parent::_toHtml();
 }