function subform_submit_subform in Subform 7
Submits a subform.
Contains code that is duplicated here.
Parameters
$form_id: The unique string identifying the current form.
$form: An associative array containing the structure of the form.
$form_state: A keyed array containing the current state of the form.
See also
2 calls to subform_submit_subform()
- subform_element_submit in ./
subform.module - Submit handler for submitting a single subform.
- subform_submit_all in ./
subform.module - Submit handler for submitting all subforms.
File
- ./
subform.module, line 925 - Defines a subform element type.
Code
function subform_submit_subform($form_id, &$form, &$form_state) {
if ($form_state['submitted'] && !form_get_errors() && !$form_state['rebuild'] && !$form_state['executed']) {
// Execute form submit handlers.
subform_execute_submit_handlers($form, $form_state);
// Set a flag to indicate the the form has been processed and executed.
$form_state['executed'] = TRUE;
}
// Don't rebuild or cache form submissions invoked via drupal_form_submit().
if (!empty($form_state['programmed'])) {
return;
}
// Rebuild subform if neccesary. The rebuild indicator is propagated up to the
// wrapper form which will take care of the actual rebuild.
if (!$form_state['executed'] && !form_get_errors()) {
$form_state['rebuild'] = TRUE;
}
}