You are here

function modalframe_example_form_submit in Modal Frame API 7

Same name and namespace in other branches
  1. 6 modules/modalframe_example/modalframe_example.module \modalframe_example_form_submit()

Submit handler for our node edit form example.

This function is part of the node edit form example.

See also

modalframe_example_node_edit_page()

modalframe_example_form_alter()

1 string reference to 'modalframe_example_form_submit'
modalframe_example_form_alter in modules/modalframe_example/modalframe_example.module
Implementation of hook_form_alter().

File

modules/modalframe_example/modalframe_example.module, line 243
Example for the Modal Frame module.

Code

function modalframe_example_form_submit($form, &$form_state) {

  // Ignore preview requests. Close dialog only when user clicks "Save" button.
  if ($form_state['triggering_element']['#value'] == t('Save')) {

    // Disable form redirection. Required to ensure modelframe_close_dialog
    // will function correctly with node edit form.
    $form_state['redirect'] = FALSE;

    // Tell the parent window to close the modal frame dialog.
    modalframe_close_dialog(array(
      'message' => t('This is an argument sent by the Modal Frame API from the submit handler attached to the node edit form!'),
    ));
  }
}