示例#1
0
 /**
  * @param Varien_Data_Tree_Node $menuTree
  * @return string
  */
 protected function _drawTwoLevelMenu(Varien_Data_Tree_Node $menuTree)
 {
     $children = $menuTree->getChildren();
     $html = '<li>';
     $html .= '<a href="' . $menuTree->getUrl() . '"><span>' . $this->escapeHtml($menuTree->getName()) . '</span></a>';
     $html .= '<div class="drop"><div class="drop-holder"><div class="col-frame"><div class="col-holder">';
     $index = 1;
     foreach ($children as $child) {
         $html .= '<div class="col">';
         $html .= '<strong class="title-drop">' . $this->escapeHtml($child->getName()) . '</strong><ul>';
         $secondLevelChildren = $child->getChildren();
         $childrenCount = $secondLevelChildren->count();
         $key = 0;
         foreach ($secondLevelChildren as $ch) {
             if ($key == 5) {
                 break;
             }
             $html .= '<li><a href="' . $ch->getUrl() . '">' . $this->escapeHtml($ch->getName()) . '</a></li>';
             $key++;
         }
         $html .= '</ul>';
         if ($childrenCount > 5 || $childrenCount == 0) {
             $html .= '<a class="all-links" href="' . $child->getUrl() . '">All ' . $this->escapeHtml($child->getName()) . '</a>';
         }
         $html .= '</div>';
         if ($index % 3 == 0 && $index > 0) {
             $html .= '</div><div class="col-holder">';
         }
         $index++;
     }
     $html .= '</div></div></div></div>';
     $html .= '</li>';
     return $html;
 }
示例#2
0
 protected function _getMenuItemClasses(Varien_Data_Tree_Node $item)
 {
     $classes = array();
     $classes[] = 'level' . $item->getLevel();
     $classes[] = $item->getPositionClass();
     if ($item->getIsFirst()) {
         $classes[] = 'first';
     }
     if ($item->getIsActive()) {
         $classes[] = 'active';
     }
     if (Mage::helper('core/url')->getCurrentUrl() == str_replace(Mage::helper('catalog/product')->getProductUrlSuffix(), "", $item->getUrl())) {
         $classes[] = 'custom-active';
     }
     if ($item->getIsLast()) {
         $classes[] = 'last';
     }
     if ($item->getClass()) {
         $classes[] = $item->getClass();
     }
     if ($item->hasChildren()) {
         $classes[] = 'parent';
     }
     return $classes;
 }
示例#3
0
 /**
  * Format item url
  *
  * @param Varien_Data_Tree_Node $item
  */
 protected function _formatItemUrl(Varien_Data_Tree_Node $item)
 {
     if ($item->getUrlType() == 1) {
         if (!($itemFullUrl = $item->getFullUrl()) && ($itemUrl = $item->getUrl())) {
             if (strpos($itemUrl, '://') === false) {
                 $itemUrl = $this->_getUrlModel()->getDirectUrl($itemUrl != '/' ? $itemUrl : '');
             }
             $item->setFullUrl($itemUrl);
         }
     } else {
         $url = Mage::Helper('cms/page')->getPageUrl($item->getCmsPageIdentifier());
         $item->setFullUrl($url);
     }
 }
示例#4
0
 /**
  * Format item url
  *
  * @param Varien_Data_Tree_Node $item
  */
 protected function _formatItemUrl(Varien_Data_Tree_Node $item)
 {
     if (!($itemFullUrl = $item->getFullUrl()) && ($itemUrl = $item->getUrl())) {
         if (strpos($itemUrl, '://') === false) {
             $itemUrl = $this->_getUrlModel()->getDirectUrl($itemUrl != '/' ? $itemUrl : '');
         }
         $item->setFullUrl($itemUrl);
     }
 }