Projet

Général

Profil

Paste
Télécharger (1,11 ko) Statistiques
| Branche: | Révision:

root / drupal7 / sites / all / themes / bootstrap / templates / system / breadcrumb.vars.php @ 7547bb19

1
<?php
2
/**
3
 * @file
4
 * Stub file for "breadcrumb" theme hook [pre]process functions.
5
 */
6

    
7
/**
8
 * Pre-processes variables for the "breadcrumb" theme hook.
9
 *
10
 * See theme function for list of available variables.
11
 *
12
 * @see bootstrap_breadcrumb()
13
 * @see theme_breadcrumb()
14
 *
15
 * @ingroup theme_preprocess
16
 */
17
function bootstrap_preprocess_breadcrumb(&$variables) {
18
  // Do not modify breadcrumbs if the Path Breadcrumbs module should be used.
19
  if (_bootstrap_use_path_breadcrumbs()) {
20
    return;
21
  }
22

    
23
  $breadcrumb = &$variables['breadcrumb'];
24

    
25
  // Optionally get rid of the homepage link.
26
  $show_breadcrumb_home = bootstrap_setting('breadcrumb_home');
27
  if (!$show_breadcrumb_home) {
28
    array_shift($breadcrumb);
29
  }
30

    
31
  if (bootstrap_setting('breadcrumb_title') && !empty($breadcrumb)) {
32
    $item = menu_get_item();
33

    
34
    $page_title = !empty($item['tab_parent']) ? check_plain($item['title']) : drupal_get_title();
35
    if (!empty($page_title)) {
36
      $breadcrumb[] = array(
37
        // If we are on a non-default tab, use the tab's title.
38
        'data' => $page_title,
39
        'class' => array('active'),
40
      );
41
    }
42
  }
43
}