protected function crumbs_CurrentPageInfo::rawBreadcrumbItems in Crumbs, the Breadcrumbs suite 7.2
Build the raw breadcrumb based on the $page->trail.
Each breadcrumb item is a router item taken from the trail, with two additional/updated keys:
- title: The title of the breadcrumb item as received from a plugin.
- localized_options: An array of options passed to l() if needed.
The altering will happen in a separate step, so
Return value
array
See also
crumbs_CurrentPageInfo::$rawBreadcrumbItems
File
- lib/
CurrentPageInfo.php, line 121
Class
- crumbs_CurrentPageInfo
- Creates various data related to the current page.
Code
protected function rawBreadcrumbItems() {
if ($this->breadcrumbSuppressed) {
return array();
}
if (user_access('administer crumbs')) {
// Remember which pages we are visiting,
// for the autocomplete on admin/structure/crumbs/debug.
unset($_SESSION['crumbs.admin.debug.history'][$this->path]);
$_SESSION['crumbs.admin.debug.history'][$this->path] = TRUE;
// Never remember more than 15 links.
while (15 < count($_SESSION['crumbs.admin.debug.history'])) {
array_shift($_SESSION['crumbs.admin.debug.history']);
}
}
$trail = $this->trail;
if (count($trail) < $this->minTrailItems) {
return array();
}
if (!$this->showFrontPage) {
array_shift($trail);
}
if (!$this->showCurrentPage) {
array_pop($trail);
}
if (!count($trail)) {
return array();
}
$items = $this->breadcrumbBuilder
->buildBreadcrumb($trail);
if (count($items) < $this->minVisibleItems) {
// Some items might get lost due to having an empty title.
return array();
}
return $items;
}