function ctools_modal_form_render in Chaos Tool Suite (ctools) 6
Same name and namespace in other branches
- 7 includes/modal.inc \ctools_modal_form_render()
Render a form into an AJAX display.
4 calls to ctools_modal_form_render()
- ctools_ajax_sample_animal in ctools_ajax_sample/
ctools_ajax_sample.module - A modal login callback.
- ctools_modal_form_wrapper in includes/
modal.inc - Wrap a form so that we can use it properly with AJAX. Essentially if the form wishes to render, it automatically does that, otherwise it returns so we can see submission results.
- ctools_stylizer_edit_style in includes/
stylizer.inc - Add a new style of the specified type.
- ctools_wizard_multistep_form in includes/
wizard.inc - Display a multi-step form.
File
- includes/
modal.inc, line 209 - Implement a modal form using AJAX.
Code
function ctools_modal_form_render($form_state, $output) {
$title = empty($form_state['title']) ? drupal_get_title() : $form_state['title'];
// If there are messages for the form, render them.
if ($messages = theme('status_messages')) {
$output = $messages . $output;
}
$commands = array();
if (isset($form_state['js settings'])) {
$commands[] = ctools_ajax_command_settings($form_state['js settings']);
}
$commands[] = ctools_modal_command_display($title, $output);
return $commands;
}