Пример #1
0
 /**
  * Recursively render each level of the page handles hierarchy
  *
  * @param array $hierarchy
  * @return string
  */
 protected function _renderHierarchy(array $hierarchy)
 {
     if (!$hierarchy) {
         return '';
     }
     $result = '<ul>';
     foreach ($hierarchy as $name => $info) {
         $linkUrl = $this->_vdeUrlBuilder->getUrl('design/page/type', array('handle' => $name));
         $class = $info['type'] == Mage_Core_Model_Layout_Merge::TYPE_FRAGMENT ? ' class="vde_option_fragment"' : '';
         $result .= '<li rel="' . $name . '"' . $class . '>';
         $result .= '<a href="' . $linkUrl . '">';
         $result .= $this->escapeHtml($info['label']);
         $result .= '</a>';
         $result .= $this->_renderHierarchy($info['children']);
         $result .= '</li>';
     }
     $result .= '</ul>';
     return $result;
 }