Exemple #1
0
 /**
  * @param string $path
  * @param array &$item
  * @return string|bool
  */
 protected function _findParentPath($path, &$item)
 {
     if ($item) {
         if (!$item['access']) {
             // Parent should be the front page.
             return FALSE;
         }
         $parent_path = $this->pluginEngine->findParent($path, $item);
         if (isset($parent_path)) {
             return $parent_path;
         }
     }
     // fallback: chop off the last fragment of the system path.
     $parent_path = $this->router->reducePath($path);
     return isset($parent_path) ? $parent_path : FALSE;
 }
Exemple #2
0
 /**
  * @param array $trail
  * @return array
  */
 function buildBreadcrumb($trail)
 {
     $breadcrumb = array();
     foreach ($trail as $path => $item) {
         if ($item) {
             $title = $this->pluginEngine->findTitle($path, $item, $breadcrumb);
             if (!isset($title)) {
                 $title = $item['title'];
             }
             // The item will be skipped, if $title === FALSE.
             if (isset($title) && $title !== FALSE && $title !== '') {
                 $item['title'] = $title;
                 $breadcrumb[] = $item;
             }
         }
     }
     return $breadcrumb;
 }