Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // ... $form_state and $form_info all populated now.
- if ($js) {
- ctools_include('ajax');
- ctools_include('modal');
- // Neither of these 'ajax' or 'modal' seemed to have any affect.
- $form_state['ajax'] = TRUE;
- $form_state['modal'] = TRUE;
- $form_info['ajax'] = TRUE;
- $form_info['modal'] = TRUE;
- // This seems to work.
- $form_state['ajax render'] = 'my_module_ajax_render';
- $output = ctools_wizard_multistep_form($form_info, $step, $form_state);
- if (empty($output)) {
- drupal_set_message('All done.');
- $output[] = ctools_modal_command_dismiss();
- }
- // JSON object is returned while ajax render is set as above.
- return $output;
- }
- else {
- // Outputs wizard just fine.
- return ctools_wizard_multistep_form($form_info, $step, $form_state);
- }
- }
- function my_module_ajax_render(&$form_state, $output) {
- $messages = theme_status_messages();
- $commands[] = ajax_command_replace("#modal-content", $output);
- return ajax_render($commands);
- }
Add Comment
Please, Sign In to add comment