Example #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;
 }
Example #2
0
 public function testGetRoutePath()
 {
     $this->_helper->expects($this->once())->method('getFrontName')->will($this->returnValue(self::FRONT_NAME));
     $this->_model->setData('route_path', self::ROUTE_PATH);
     $this->assertEquals(self::FRONT_NAME . '/' . self::ROUTE_PATH, $this->_model->getRoutePath());
 }