Projet

Général

Profil

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

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

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

    
7
/**
8
 * Pre-processes variables for the "links" theme hook.
9
 *
10
 * See theme function for list of available variables.
11
 *
12
 * @see theme_links()
13
 *
14
 * @ingroup theme_preprocess
15
 */
16
function bootstrap_preprocess_links(&$variables) {
17
  if (isset($variables['attributes']) && isset($variables['attributes']['class'])) {
18
    $string = is_string($variables['attributes']['class']);
19
    if ($string) {
20
      $variables['attributes']['class'] = explode(' ', $variables['attributes']['class']);
21
    }
22

    
23
    if ($key = array_search('inline', $variables['attributes']['class'])) {
24
      $variables['attributes']['class'][$key] = 'list-inline';
25
    }
26

    
27
    if ($string) {
28
      $variables['attributes']['class'] = implode(' ', $variables['attributes']['class']);
29
    }
30
  }
31
}