public function RenderFileBrowser($parentId, $depth = 1, $level = 0, $basePath = null, $id = 'fileTree')
 {
     // @todo: deal with selected menu items
     if ($level <= $depth - 1) {
         $links = array();
         $menu = new Model_Menu();
         $children = $menu->getMenuItems($parentId);
         foreach ($children as $child) {
             if (!empty($child->label)) {
                 $label = $child->label;
             } else {
                 $label = $child->title;
             }
             $children = $menu->getMenuItems($child->id);
             if ($children->count() > 0) {
                 $class = 'dir';
                 $newLevel = $level + 1;
                 $submenu = $this->view->RenderFileBrowser($child->id, $depth, $newLevel, $link);
             } else {
                 $class = 'page';
                 $submenu = false;
             }
             $linkId = Digitalus_Toolbox_String::addUnderscores($menu->path, true);
             $links[] = "<li class='menuItem'><a href='/admin/page/open/id/{$child->id}' class='{$class}' id='page-{$child->id}'>{$label}</a>" . $submenu . '</li>';
         }
     }
     if (is_array($links)) {
         if ($level == 0) {
             $strId = "id='{$id}'";
         }
         return "<ul {$strId}>" . implode(null, $links) . '</ul>';
     }
 }
Пример #2
0
 public function renderMenuBrowser($parentId, $basePath = null, $id = 'menuTree')
 {
     $menu = new Model_Menu();
     $children = $menu->getMenuItems($parentId, true);
     foreach ($children as $child) {
         $label = $child->title;
         if (!empty($child->label)) {
             $label = $child->label . ' / ' . $label;
         }
         $class = 'menu';
         $submenu = $this->view->renderMenuBrowser($child->id, $link);
         $linkId = Digitalus_Toolbox_String::addUnderscores($menu->path, true);
         $links[] = '<li class="menuItem"><a href="/admin/navigation/open/id/' . $child->id . '" class="' . $class . '" id="page-' . $child->id . '">' . $label . '</a>' . $submenu . '</li>';
     }
     if (is_array($links)) {
         if ($level == 0) {
             $strId = 'id="' . $id . '"';
         }
         return '<ul ' . $strId . '>' . implode(null, $links) . '</ul>';
     }
 }
Пример #3
0
 public function RenderMenuBrowser($parentId, $basePath = null, $id = 'menuTree')
 {
     $menu = new Model_Menu();
     $children = $menu->getMenuItems($parentId, true);
     foreach ($children as $child) {
         $label = $child->title;
         if (!empty($child->label)) {
             $label = $child->label . ' / ' . $label;
         }
         $class = 'menu';
         $submenu = $this->view->RenderMenuBrowser($child->id, $link);
         $linkId = Digitalus_Toolbox_String::addUnderscores($menu->path, true);
         $links[] = "<li class='menuItem'><a href='/admin/navigation/open/id/{$child->id}' class='{$class}' id='page-{$child->id}'>{$label}</a>" . $submenu . '</li>';
     }
     if (is_array($links)) {
         if ($level == 0) {
             $strId = "id='{$id}'";
         }
         return "<ul {$strId}>" . implode(null, $links) . '</ul>';
     }
 }