You are here

function theme_delta_blocks_breadcrumb in Delta 7.3

Returns the rendered breadcrumb.

1 theme call to theme_delta_blocks_breadcrumb()
delta_blocks_get_content in delta_blocks/delta_blocks.module
Provides individual block content.

File

delta_blocks/includes/delta_blocks.theme.inc, line 126
Theme functions for the Delta blocks module.

Code

function theme_delta_blocks_breadcrumb($variables) {
  $output = '';
  if (!empty($variables['breadcrumb'])) {
    if ($variables['breadcrumb_current']) {
      $variables['breadcrumb'][] = l(drupal_get_title(), current_path(), array(
        'html' => TRUE,
      ));
    }
    $output = '<div id="breadcrumb" class="clearfix"><ul class="breadcrumb">';
    $switch = array(
      'odd' => 'even',
      'even' => 'odd',
    );
    $zebra = 'even';
    $last = count($variables['breadcrumb']) - 1;
    foreach ($variables['breadcrumb'] as $key => $item) {
      $zebra = $switch[$zebra];
      $attributes['class'] = array(
        'depth-' . ($key + 1),
        $zebra,
      );
      if ($key == 0) {
        $attributes['class'][] = 'first';
      }
      if ($key == $last) {
        $attributes['class'][] = 'last';
      }
      $output .= '<li' . drupal_attributes($attributes) . '>' . $item . '</li>';
    }
    $output .= '</ul></div>';
  }
  return $output;
}