You are here

function webform_conditionals_form_submit in Webform 7.4

Submit handler for webform_conditionals_form().

1 string reference to 'webform_conditionals_form_submit'
webform_conditionals_form in includes/webform.conditionals.inc
Form builder; Provide the form for adding conditionals to a webform node.

File

includes/webform.conditionals.inc, line 261
Form elements and menu callbacks to provide conditional handling in Webform.

Code

function webform_conditionals_form_submit($form, &$form_state) {
  $node = $form['#node'];

  // Get a fresh copy of the node so that we are only saving these changes.
  // Otherwise, changes to the Webform on another tab will be overwritten.
  $node = node_load($node->nid, NULL, TRUE);

  // Remove the new conditional placeholder.
  unset($form_state['values']['conditionals']['new']);
  $node->webform['conditionals'] = $form_state['values']['conditionals'];
  node_save($node);
  drupal_set_message(t('Conditionals for %title saved.', array(
    '%title' => $node->title,
  )));
}