function deploy_get_server_form in Deploy - Content Staging 6
Standard form with server list. Used in many places.
4 calls to deploy_get_server_form()
- comment_deploy_operations_add_now_form in modules/
comment_deploy/ comment_deploy.pages.inc - Display comment "deploy now" form.
- deploy_plan_push_form in ./
deploy.module - Push a deployment plan live form.
- node_deploy_operations_add_now_form in modules/
node_deploy/ node_deploy.pages.inc - Display node "deploy now" form.
- taxonomy_vocabulary_deploy_add_form in modules/
taxonomy_deploy/ taxonomy_deploy.pages.inc - Display vocabulary deploy form.
File
- ./
deploy.module, line 880 - Deployment API which enables modules to deploy items between servers.
Code
function deploy_get_server_form() {
$servers = deploy_get_servers();
if (empty($servers)) {
drupal_set_message(t("There are no servers defined. Please define a server using the Servers tab before pushing your deployment plan."));
drupal_goto("admin/build/deploy");
}
// Rebuild the server list so we also have an empty option.
$options = array(
'' => t('-- Select a server'),
);
foreach ($servers as $sid => $server) {
$options[$sid] = $server;
}
$form['sid'] = array(
'#title' => t('Server'),
'#type' => 'select',
'#options' => $options,
'#description' => t('Select the server you want to deploy to'),
'#required' => TRUE,
'#ahah' => array(
'path' => 'admin/build/deploy/ahah/auth-form',
'wrapper' => 'deploy-auth-wrapper',
'method' => 'replace',
),
);
$form['auth_wrapper'] = array(
'#prefix' => '<div id="deploy-auth-wrapper">',
'#suffix' => '</div>',
);
// This form element will be replaced with the response from an AHAH request.
$form['auth_wrapper']['settings'] = array(
'#type' => 'hidden',
);
$form['submit'] = array(
'#type' => 'submit',
'#value' => t('Push Deployment Plan'),
);
return $form;
}