You are here

function deploy_plan_form_submit in Deploy - Content Staging 6

Same name and namespace in other branches
  1. 5 deploy.module \deploy_plan_form_submit()

Submit callback for deploy_plan_form().

File

./deploy.plans.admin.inc, line 116
Page handlers for deploy plan admin.

Code

function deploy_plan_form_submit($form, &$form_state) {
  global $user;

  // If $form_state['values'] has 'pid', then this is an update. Otherwise it is an
  // insert.
  if (array_key_exists('pid', $form_state['values'])) {
    db_query("UPDATE {deploy_plan} SET name = '%s', description = '%s' WHERE pid = %d", $form_state['values']['plan_name'], $form_state['values']['plan_description'], $form_state['values']['pid']);
  }
  else {
    deploy_create_plan($form_state['values']['plan_name'], $form_state['values']['plan_description']);
  }
  $form_state['redirect'] = 'admin/build/deploy';
}