Projet

Général

Profil

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

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

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

    
7
/**
8
 * Pre-processes variables for the "bootstrap_modal" theme hook.
9
 *
10
 * See template for list of available variables.
11
 *
12
 * @see bootstrap-modal.tpl.php
13
 *
14
 * @ingroup theme_preprocess
15
 *
16
 * @todo: Replace with "bootstrap_effect_fade" theme setting.
17
 */
18
function bootstrap_preprocess_bootstrap_modal(&$variables) {
19
  if (empty($variables['attributes']['id'])) {
20
    $variables['attributes']['id'] = drupal_html_id(strip_tags($variables['heading']));
21
  }
22
  $variables['attributes']['class'][] = 'modal';
23
  $variables['attributes']['class'][] = 'fade';
24
  $variables['attributes']['tabindex'] = -1;
25
  $variables['attributes']['role'] = 'dialog';
26
  $variables['attributes']['aria-hidden'] = 'true';
27

    
28
  $variables['heading'] = $variables['html_heading'] ? $variables['heading'] : check_plain($variables['heading']);
29
  $variables['dialog_attributes']['class'][] = 'modal-dialog';
30

    
31
  if (!empty($variables['size'])) {
32
    $variables['dialog_attributes']['class'][] = drupal_html_class('modal-' . $variables['size']);
33
  }
34
}
35

    
36
/**
37
 * Processes variables for the "bootstrap_modal" theme hook.
38
 *
39
 * See template for list of available variables.
40
 *
41
 * @see bootstrap-modal.tpl.php
42
 *
43
 * @ingroup theme_process
44
 */
45
function bootstrap_process_bootstrap_modal(&$variables) {
46
  $variables['attributes'] = drupal_attributes($variables['attributes']);
47
  $variables['dialog_attributes'] = drupal_attributes($variables['dialog_attributes']);
48
  $variables['heading'] = _bootstrap_filter_xss(render($variables['heading']));
49
  $variables['body'] = render($variables['body']);
50
  $variables['footer'] = render($variables['footer']);
51
}