Projet

Général

Profil

Révision e4c061ad

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
187 187
/**
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
 * so we can see submission results.
190
 * the render array so we can see submission results.
191 191

  
192 192
 * @param array $form
193 193
 *   An associative array containing the structure of the form.
......
201 201
 *   is set, this will use ctools_modal_form_render so it will be
202 202
 *   a $command object suitable for ajax_render already.
203 203
 *
204
 *   The return will be NULL if the form was successfully submitted unless
205
 *   you specifically set re_render = TRUE. If ajax is set the
206
 *   form will never be redirected.
204
 *   If the form was not rendered, the raw render array will be returned.
205
 *
206
 *   If ajax is set the form will never be redirected.
207 207
 */
208 208
function ctools_modal_form_wrapper($form_id, &$form_state) {
209 209
  // Since this will run again on form rebuild while still in the modal, prevent
......
220 220
  );
221 221

  
222 222
  $output = drupal_build_form($form_id, $form_state);
223
 if (!empty($form_state['ajax']) && (!$form_state['executed'] || $form_state['rebuild'])) {
223
  if (!empty($form_state['ajax']) && (!$form_state['executed'] || $form_state['rebuild'])) {
224 224
     return ctools_modal_form_render($form_state, $output);
225 225
  }
226 226

  

Formats disponibles : Unified diff