Projet

Général

Profil

Révision 05237dd8

Ajouté par Assos Assos il y a presque 7 ans

Weekly update of contrib modules

Voir les différences:

drupal7/sites/all/themes/bootstrap/templates/system/form-element.func.php
59 59
  $element = &$variables['element'];
60 60
  $name = !empty($element['#name']) ? $element['#name'] : FALSE;
61 61
  $type = !empty($element['#type']) ? $element['#type'] : FALSE;
62
  $wrapper = isset($element['#form_element_wrapper']) ? !!$element['#form_element_wrapper'] : TRUE;
63
  $form_group = isset($element['#form_group']) ? !!$element['#form_group'] : $wrapper && $type && $type !== 'hidden';
62 64
  $checkbox = $type && $type === 'checkbox';
63 65
  $radio = $type && $type === 'radio';
64 66

  
......
104 106
  if ($checkbox || $radio) {
105 107
    $wrapper_attributes['class'][] = drupal_html_class($type);
106 108
  }
107
  elseif ($type && $type !== 'hidden') {
109
  elseif ($form_group) {
108 110
    $wrapper_attributes['class'][] = 'form-group';
109 111
  }
110 112

  
111 113
  // Create a render array for the form element.
112 114
  $build = array(
113
    '#theme_wrappers' => array('container__form_element'),
115
    '#form_group' => $form_group,
114 116
    '#attributes' => $wrapper_attributes,
115 117
  );
116 118

  
117
  // Render the label for the form element.
118
  $build['label'] = array(
119
    '#markup' => theme('form_element_label', $variables),
120
    '#weight' => $element['#title_display'] === 'before' ? 0 : 2,
121
  );
119
  if ($wrapper) {
120
    $build['#theme_wrappers'] = array('container__form_element');
121

  
122
    // Render the label for the form element.
123
    $build['label'] = array(
124
      '#markup' => theme('form_element_label', $variables),
125
      '#weight' => $element['#title_display'] === 'before' ? 0 : 2,
126
    );
127
  }
122 128

  
123 129
  // Checkboxes and radios render the input element inside the label. If the
124 130
  // element is neither of those, then the input element must be rendered here.

Formats disponibles : Unified diff