Projet

Général

Profil

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

root / drupal7 / sites / all / themes / bootstrap / templates / menu / menu-link.vars.php @ 1f623f01

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

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

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