You are here

function deploy_plan_form in Deploy - Content Staging 6

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

Display add/edit deployment plan form.

Parameters

$form_state: FAPI form state

$pid: Unique identifier for the plan we're editing, or NULL if creating a new plan.

Return value

FAPI array

See also

deploy_plan_form_submit()

1 string reference to 'deploy_plan_form'
deploy_menu in ./deploy.module
Implementation of hook_menu().

File

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

Code

function deploy_plan_form($form_state, $pid = NULL) {
  $plan = NULL;

  // If we got a PID, get the plan's details.
  if (!is_null($pid)) {
    $plan = deploy_get_plan($pid);
    $form['pid'] = array(
      '#type' => 'hidden',
      '#default_value' => $pid,
    );
  }
  $form['plan_name'] = array(
    '#title' => t('Name'),
    '#type' => 'textfield',
    '#size' => 30,
    '#maxlength' => 50,
    '#required' => TRUE,
    '#default_value' => $plan['name'],
    '#description' => t('A unique name for this deployment plan.'),
  );
  $form['plan_description'] = array(
    '#title' => t('Description'),
    '#type' => 'textarea',
    '#default_value' => $plan['description'],
    '#description' => t('Information about this deployment plan, and the items being deployed.'),
  );
  $form['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Save Deployment Plan'),
  );
  return $form;
}