You are here

protected function crumbs_CurrentPageInfo::breadcrumbHtml in Crumbs, the Breadcrumbs suite 7.2

Build the breadcrumb HTML.

Return value

string

See also

crumbs_CurrentPageInfo::$breadcrumbHtml

File

lib/CurrentPageInfo.php, line 269

Class

crumbs_CurrentPageInfo
Creates various data related to the current page.

Code

protected function breadcrumbHtml() {
  $breadcrumb_items = $this->breadcrumbItems;
  if (empty($breadcrumb_items)) {
    return '';
  }
  $links = array();
  if ($this->showCurrentPage) {
    $last = array_pop($breadcrumb_items);
    foreach ($breadcrumb_items as $i => $item) {
      $links[$i] = theme('crumbs_breadcrumb_link', $item);
    }
    $links[] = theme('crumbs_breadcrumb_current_page', array(
      'item' => $last,
      'show_current_page' => $this->showCurrentPage,
    ));
  }
  else {
    foreach ($breadcrumb_items as $i => $item) {
      $links[$i] = theme('crumbs_breadcrumb_link', $item);
    }
  }
  return theme('breadcrumb', array(
    'breadcrumb' => $links,
    'crumbs_breadcrumb_items' => $breadcrumb_items,
    'crumbs_trail' => $this->trail,
    'crumbs_separator' => $this->separator,
    'crumbs_separator_span' => $this->separatorSpan,
    'crumbs_trailing_separator' => $this->trailingSeparator,
  ));
}