You are here

function _path_breadcrumbs_build_breadcrumbs in Path Breadcrumbs 7

Same name and namespace in other branches
  1. 7.3 path_breadcrumbs.module \_path_breadcrumbs_build_breadcrumbs()
  2. 7.2 path_breadcrumbs.module \_path_breadcrumbs_build_breadcrumbs()

Builds array with breadcrumbs.

1 call to _path_breadcrumbs_build_breadcrumbs()
path_breadcrumbs_page_alter in ./path_breadcrumbs.module
Implements hook_page_alter().

File

./path_breadcrumbs.module, line 82

Code

function _path_breadcrumbs_build_breadcrumbs($path_breadcrumb) {
  $breadcrumb = array();

  // Add HOME link.
  if ($path_breadcrumb->home) {
    $breadcrumb[] = l(t('Home'), '<front>');
  }
  $titles = explode("\r\n", $path_breadcrumb->titles);
  $paths = explode("\r\n", $path_breadcrumb->paths);
  foreach ($titles as $key => $title) {
    if (isset($paths[$key]) && $paths[$key] != '<none>') {
      $breadcrumb[] = l(t(check_plain($title)), $paths[$key]);
    }
    elseif (isset($paths[$key]) && $paths[$key] == '<none>') {
      $breadcrumb[] = check_plain($title);
    }
  }
  return $breadcrumb;
}