You are here

function crumbs_BreadcrumbBuilder::buildBreadcrumb in Crumbs, the Breadcrumbs suite 7

Same name and namespace in other branches
  1. 7.2 lib/BreadcrumbBuilder.php \crumbs_BreadcrumbBuilder::buildBreadcrumb()

File

lib/BreadcrumbBuilder.php, line 12

Class

crumbs_BreadcrumbBuilder

Code

function buildBreadcrumb($trail) {
  $breadcrumb = array();
  foreach ($trail as $path => $item) {
    if ($item) {
      $title = $this
        ->_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;
      }
    }
  }
  $this
    ->_decorateBreadcrumb($breadcrumb);
  return $breadcrumb;
}