function fp_render_breadcrumbs

7.x theme.inc fp_render_breadcrumbs()
6.x theme.inc fp_render_breadcrumbs()

Return the HTML for breadcrumbs for the current page we are on. Will skip any breadcrumbs we do not have permission to access.

1 call to fp_render_breadcrumbs()
AdvisingScreen::output_to_browser in classes/AdvisingScreen.php
This method outputs the screen to the browser by performing an include(path-to-theme-file.php). All necessary information must be placed into certain variables before the include happens.

File

includes/theme.inc, line 1212

Code

function fp_render_breadcrumbs() {
  $rtn = "";

  $c = 0;

  if (isset($GLOBALS ['fp_breadcrumbs']) && is_array($GLOBALS ['fp_breadcrumbs'])) {

    $crumbs = $GLOBALS ['fp_breadcrumbs'];

    $rtn .= "<div id='breadcrumb-inner-wrapper'>
               <ul class='breadcrumbs'>";

    foreach ($crumbs as $crumb) {
      $z_index = 20 - $c;

      $text = @$crumb ['text'];
      $path = @$crumb ['path'];
      $query = @$crumb ['query'];
      $attributes = @$crumb ['attributes'];


      // Do we have permission for this menu item?  If not, do not render this breadcrumb.
      if ($path != "<front>") {
        $item = menu_get_item($path);
        if (!menu_check_user_access($item)) {
          continue;
        }
      }

      if (!$attributes || !is_array($attributes)) {
        $attributes = array();
        $attributes ['style'] = '';
      }

      $attributes ['style'] .= " z-index: $z_index;";


      $link = l($text, $path, $query, $attributes);

      $extra_class = "";
      if ($c == 0) {
        $extra_class .= "first";
      }
      if ($c == count($crumbs) -1) {
        $extra_class .= " last";
      }

      $rtn .= "<li class='crumbs $extra_class' style='z-index: $z_index;' >
                  $link
               </li>";


      $c++;
    }


    $rtn .= "</ul>
                </div>";

  }

  return $rtn;
}