array()) + (array)$form['#submit']; $plans = deploy_get_plans(); if (!empty($plans)) { $plans['0'] = ''; natsort($plans); $form['deploy']['deploy_plan'] = array( '#type' => 'select', '#title' => t('Deployment Plan'), '#description' => t('A deployment plan to add these settings to, or none'), '#weight' => $deploy_weight, '#options' => $plans, ); } } } /** * submit handler for systems settings forms that have deployment enabled */ 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); } } /** * deployment "hook" */ function system_settings_deploy($url, $api_key, $data) { return xmlrpc($url, 'system_settings.import', $api_key, unserialize($data)); }