Beispiel #1
0
 /**
  * Get file node properties.
  *
  * @param string $path
  * @param Tree $tree
  * @param int $depth
  * @return array
  */
 public function getNodeJson($path, $tree, $depth)
 {
     $p = $tree->objectToJson($path, $tree, $depth);
     if (!$p['isFolder']) {
         $p['href'] = (string) url('', array('module', 'view' => 'Edit', 'file' => $path));
     } else {
         $p['expand'] = true;
     }
     return $p;
 }
Beispiel #2
0
 /**
  * Get page tree node properties.
  *
  * @param \Page $page
  * @param Tree $tree
  * @param int $depth
  * @return array
  */
 public function getPageTreeNode($page, Tree $tree, $depth = 0)
 {
     $p = $tree->objectToJson($page, $tree, $depth);
     if ($page->getWorkingPageRevisionId() && $page->getWorkingPageRevisionId() !== $page->getActivePageRevisionId()) {
         $p['title'] .= '*';
         $p['addClass'] = 'page-unpublished';
     }
     $p['expand'] = true;
     $p['href'] = $this->page->url(array('id' => $page->getPageId()));
     // Mark active node
     if (isset($_GET['page_id']) && $_GET['page_id'] == $page->getPageId()) {
         $p['activate'] = $p['focus'] = $p['select'] = true;
     }
     // Icon
     $p['iconClass'] = 'no-icon';
     if (\Curry_Backend_Page::isTemplatePage($page)) {
         if ($page === \Curry_Backend_Page::getTemplatePage()) {
             $p['title'] .= ' <span class="icon-columns"></span>';
         }
     } else {
         $icon = "";
         if (!$page->getEnabled()) {
             $icon .= '<span class="icon-lock" title="Inactive"></span>';
         }
         if (!$page->getVisible()) {
             $icon .= '<span class="icon-eye-close" title="Do not show in menu"></span>';
         }
         if ($page->getRedirectMethod()) {
             $icon .= '<span class="icon-link" title="Redirect"></span>';
         }
         if ($icon) {
             $p['title'] .= " {$icon}";
         }
     }
     return $p;
 }