You are here

function modalframe_form_submit in Modal Frame API 7

Same name and namespace in other branches
  1. 6 modalframe.module \modalframe_form_submit()

Generic form submit handler.

When we are requested to close a modal dialog, we don't want Form API to perform any redirection once the submitted form has been processed.

When $form_state['redirect'] is set to FALSE, then Form API will simply re-render the form with the values still in its fields. And this is all we need to output the javascript that will tell the parent window to close the child dialog.

2 string references to 'modalframe_form_submit'
modalframe_form_after_build in ./modalframe.module
Form after build callback.
modalframe_form_after_build_recursive in ./modalframe.module
Find form elements with submit handlers recursively.

File

./modalframe.module, line 243
Provides an API to render an iframe within a modal dialog based on the jQuery UI Dialog plugin.

Code

function modalframe_form_submit($form, &$form_state) {
  if (!empty($GLOBALS['modalframe_close_dialog'])) {
    $form_state['redirect'] = FALSE;
  }
}