Пример #1
0
 /**
  * Get Page data as array
  *
  * @return  array  Returns an array of the page data, otherwise an empty array
  */
 protected function _getPageAsArray($item = null)
 {
     if (empty($item)) {
         $item = $this->getItem();
     }
     $baseUrl = $this->view->baseUrl();
     $mdlMenu = new Model_Menu();
     $page = array('active' => $this->isActive(false), 'class' => 'menuItem', 'id' => $item->id, 'label' => Digitalus_Toolbox_Page::getLabel($item), 'name' => $item->name, 'resource' => strtolower(Digitalus_Toolbox_String::replaceEmptySpace($item->name)), 'title' => Digitalus_Toolbox_Page::getLabel($item), 'uri' => $baseUrl . '/' . Digitalus_Toolbox_String::replaceEmptySpace(Digitalus_Toolbox_Page::getUrl($item)), 'visible' => $this->isVisible($item));
     $subPages = array();
     if ($mdlMenu->hasChildren($this->id)) {
         $children = $mdlMenu->getChildren($this->id);
         foreach ($children as $child) {
             $subPages[] = new Digitalus_Menu_Item(null, $child);
         }
         $page['pages'] = $subPages;
     }
     return $page;
 }