You are here

function save_draft_validate in Save Draft 7

Handles save draft form validation.

1 string reference to 'save_draft_validate'
save_draft_form_node_form_alter in ./save_draft.module
Implements hook_form_FORM_ID_alter().

File

./save_draft.module, line 127
Main file for the Save Draft module, which adds a 'Save as draft' button to content types.

Code

function save_draft_validate($form, &$form_state) {

  // Set the node to be published or unpublished depending on which button was
  // clicked.
  if ($form_state['triggering_element']['#value'] == $form['actions']['draft']['#value']) {
    $form_state['values']['status'] = 0;
  }
  elseif ($form_state['triggering_element']['#value'] == $form['actions']['submit']['#value']) {
    $form_state['values']['status'] = 1;
  }
}