You are here

function system_settings_deploy_form_submit in Deploy - Content Staging 5

Same name and namespace in other branches
  1. 6 modules/system_settings_deploy/system_settings_deploy.module \system_settings_deploy_form_submit()

submit handler for systems settings forms that have deployment enabled

File

system_settings_deploy/system_settings_deploy.module, line 38

Code

function system_settings_deploy_form_submit($form_id, $form_values) {
  $pid = $form_values['deploy_plan'];

  // remove the "deploy_plan" key from form_values before
  // we save the array, since its stupid on the other side
  if (array_key_exists("deploy_plan", $form_values)) {
    unset($form_values["deploy_plan"]);
  }

  // serialize and save $form_values
  $data = serialize($form_values);

  // if a deployment plan is submitted then add these settings
  if ($pid != '0') {
    deploy_add_to_plan($pid, 'system_settings', 'Settings: ' . $form_id, $data);
  }

  // either way we still want to update any existing plans that include these
  // settings with these changes
  $result = db_query("select * from {deploy_plan_items} where module = 'system_settings'");
  while ($row = db_fetch_array($result)) {
    deploy_update_item($row['iid'], $data);
  }
}