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 @ 749b8a23

1 87dbc3bf Benjamin Luce
<?php
2
/**
3
 * @file
4 caf16a48 Assos Assos
 * Stub file for "links" theme hook [pre]process functions.
5 87dbc3bf Benjamin Luce
 */
6
7
/**
8 caf16a48 Assos Assos
 * 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 87dbc3bf Benjamin Luce
 */
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
}