Projet

Général

Profil

Paste
Télécharger (2,68 ko) Statistiques
| Branche: | Révision:

root / drupal7 / sites / all / themes / bootstrap / includes / deprecated.inc @ bd64b67c

1
<?php
2

    
3
/**
4
 * @file
5
 * deprecated.inc
6
 *
7
 * This contains all the currently deprecated functions that will be removed
8
 * in the next minor or major release.
9
 */
10

    
11
/**
12
 * Pre-render input elements.
13
 *
14
 * @deprecated Use proper hooks instead. Will be removed in 7.x-3.2.
15
 *
16
 * @see hook_pre_render()
17
 *
18
 * @todo Remove in 7.x-3.2.
19
 */
20
function _bootstrap_pre_render_input($element) {
21
  return bootstrap_pre_render($element);
22
}
23

    
24
/**
25
 * Pre-render fieldset element.
26
 *
27
 * @deprecated Use proper hooks instead. Will be removed in 7.x-3.2.
28
 *
29
 * @see hook_pre_render_HOOK()
30
 *
31
 * @todo Remove in 7.x-3.2.
32
 */
33
function _bootstrap_pre_render_fieldset($element) {
34
  return bootstrap_pre_render_fieldset($element);
35
}
36

    
37
/**
38
 * Internal function used to process all elements.
39
 *
40
 * @deprecated Use proper hooks instead. Will be removed in 7.x-3.2.
41
 *
42
 * @see hook_form_process()
43
 *
44
 * @todo Remove in 7.x-3.2.
45
 */
46
function _bootstrap_process_element($element, &$form_state, &$form) {
47
  $element = bootstrap_form_process($element, $form_state, $form);
48

    
49
  // Process form actions.
50
  if (!empty($element['#type']) && $element['#type'] === 'actions') {
51
    $element = bootstrap_form_process_actions($element, $form_state, $form);
52
  }
53

    
54
  // Process text_format elements.
55
  if (isset($element['#type']) && $element['#type'] === 'text_format') {
56
    $element = bootstrap_form_process_text_format($element, $form_state, $form);
57
  }
58

    
59
  return $element;
60
}
61

    
62
/**
63
 * Internal function used to process the fieldset element.
64
 *
65
 * @deprecated Use proper hooks instead. Will be removed in 7.x-3.2.
66
 *
67
 * @see hook_form_process_HOOK()
68
 *
69
 * @todo Remove in 7.x-3.2.
70
 */
71
function _bootstrap_process_fieldset($element, &$form_state, &$form) {
72
  // Purposefully left empty, there's nothing to process (just pre-render now).
73
}
74

    
75
/**
76
 * Helper function for determining if a tooltip can be used for a description.
77
 *
78
 * @param string $description
79
 *   The string of text to process.
80
 *
81
 * @deprecated Will be removed in 7.x-3.2.
82
 *
83
 * @see _bootstrap_simple_string()
84
 * @see bootstrap_element_smart_description()
85
 *
86
 * @todo Remove in 7.x-3.2.
87
 */
88
function _bootstrap_tooltip_description($description) {
89
  // Determine if tooltips are enabled.
90
  static $enabled;
91
  if (!isset($enabled)) {
92
    $enabled = bootstrap_setting('tooltip_enabled') && bootstrap_setting('forms_smart_descriptions');
93
  }
94
  // Immediately return if "simple" tooltip descriptions are not enabled.
95
  if (!$enabled) {
96
    return FALSE;
97
  }
98
  $allowed_tags = array('b', 'code', 'em', 'i', 'kbd', 'span', 'strong');
99
  $length = (int) bootstrap_setting('forms_smart_descriptions_length');
100
  if (empty($length)) {
101
    $length = FALSE;
102
  }
103
  return _bootstrap_is_simple_string($description, $length, $allowed_tags);
104
}