Projet

Général

Profil

Révision 96a203dd

Ajouté par Assos Assos il y a plus de 9 ans

Weekly update of contrib modules

Voir les différences:

drupal7/sites/all/modules/ctools/includes/modal.inc
188 188
 * Wrap a form so that we can use it properly with AJAX. Essentially if the
189 189
 * form wishes to render, it automatically does that, otherwise it returns
190 190
 * so we can see submission results.
191

  
192
 * @param array $form
193
 *   An associative array containing the structure of the form.
194
 * @param array $form_state
195
 *   An associative array containing the current state of the form.
196
 *   If the 'reset_html_ids' key is set to TRUE, it will prevent HTML IDs in
197
 *   forms from being incremented.
191 198
 *
192
 * @return
199
 * @return mixed
193 200
 *   The output of the form, if it was rendered. If $form_state['ajax']
194 201
 *   is set, this will use ctools_modal_form_render so it will be
195 202
 *   a $command object suitable for ajax_render already.
......
199 206
 *   form will never be redirected.
200 207
 */
201 208
function ctools_modal_form_wrapper($form_id, &$form_state) {
209
  // Since this will run again on form rebuild while still in the modal, prevent
210
  // form IDs from being incremented.
211
  // @todo https://drupal.org/node/1305882
212
  if (!empty($form_state['reset_html_ids']) && !empty($_POST['ajax_html_ids'])) {
213
    unset($_POST['ajax_html_ids']);
214
  }
215

  
202 216
  // This won't override settings already in.
203 217
  $form_state += array(
204 218
    're_render' => FALSE,

Formats disponibles : Unified diff