Projet

Général

Profil

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

root / drupal7 / sites / all / themes / bootstrap / theme / system / exposed-filters.func.php @ 87dbc3bf

1
<?php
2
/**
3
 * @file
4
 * exposed-filters.func.php
5
 */
6

    
7
/**
8
 * Overrides theme_exposed_filters().
9
 */
10
function bootstrap_exposed_filters($variables) {
11
  $form = $variables['form'];
12
  $output = '';
13

    
14
  foreach (element_children($form['status']['filters']) as $key) {
15
    $form['status']['filters'][$key]['#field_prefix'] = '<div class="col-sm-10">';
16
    $form['status']['filters'][$key]['#field_suffix'] = '</div>';
17
  }
18
  $form['status']['actions']['#attributes']['class'][] = 'col-sm-offset-2';
19
  $form['status']['actions']['#attributes']['class'][] = 'col-sm-10';
20
  $form['status']['actions']['#prefix'] = '<div class="form-group">';
21
  $form['status']['actions']['#suffix'] = '</div>';
22

    
23
  if (isset($form['current'])) {
24
    $items = array();
25
    foreach (element_children($form['current']) as $key) {
26
      $items[] = drupal_render($form['current'][$key]);
27
    }
28
    $output .= theme('item_list', array(
29
      'items' => $items,
30
      'attributes' => array(
31
        'class' => array(
32
          'clearfix',
33
          'current-filters',
34
        ),
35
      ),
36
    ));
37
  }
38
  $output .= drupal_render_children($form);
39
  return '<div class="form-horizontal">' . $output . '</div>';
40
}