You are here

function webform_form_alter in Webform 6.2

Same name and namespace in other branches
  1. 8.5 includes/webform.form_alter.inc \webform_form_alter()
  2. 5.2 webform.module \webform_form_alter()
  3. 6.3 webform.module \webform_form_alter()
  4. 7.4 webform.module \webform_form_alter()
  5. 7.3 webform.module \webform_form_alter()
  6. 6.x includes/webform.form_alter.inc \webform_form_alter()

Implementation of hook_form_alter().

File

./webform.module, line 1038

Code

function webform_form_alter(&$form, $form_state, $form_id) {
  if ($form_id == 'webform_node_form' && empty($form['nid']['#value'])) {
    $form['buttons']['submit']['#submit'][] = 'webform_form_submit';

    // Force webforms to be unpublished initially.
    if (user_access('administer nodes')) {
      $form['options']['status']['#default_value'] = FALSE;
    }
    else {
      $form['status']['#value'] = FALSE;
    }
  }
}