Projet

Général

Profil

Paste
Télécharger (899 octets) Statistiques
| Branche: | Révision:

root / drupal7 / sites / all / themes / bootstrap / templates / menu / menu-link.vars.php @ 01f36513

1
<?php
2

    
3
/**
4
 * @file
5
 * Stub file for "menu_link" theme hook [pre]process functions.
6
 */
7

    
8
/**
9
 * Pre-processes variables for the "menu_link" theme hook.
10
 *
11
 * See theme function for list of available variables.
12
 *
13
 * @param array $variables
14
 *   An associative array of variables, passed by reference.
15
 *
16
 * @see bootstrap_menu_link()
17
 * @see theme_menu_link()
18
 *
19
 * @ingroup theme_preprocess
20
 */
21
function bootstrap_preprocess_menu_link(array &$variables) {
22
  $element = &$variables['element'];
23

    
24
  // Determine if the link should be shown as "active" based on the current
25
  // active trail (set by core/contrib modules).
26
  // @see https://www.drupal.org/node/2618828
27
  // @see https://www.drupal.org/node/1896674
28
  if (in_array('active-trail', _bootstrap_get_classes($element)) || ($element['#href'] == '<front>' && drupal_is_front_page())) {
29
    $element['#attributes']['class'][] = 'active';
30
  }
31
}