You are here

function deploy_managed_ui_form_elements in Deploy - Content Staging 7.3

Same name and namespace in other branches
  1. 7.2 modules/deploy_managed_ui/deploy_managed_ui.module \deploy_managed_ui_form_elements()

Generates form elements for hook_form_alter() implementations to call.

1 call to deploy_managed_ui_form_elements()
deploy_managed_ui_form_alter in modules/deploy_managed_ui/deploy_managed_ui.module
Implements hook form_alter().

File

modules/deploy_managed_ui/deploy_managed_ui.module, line 41
Deploy Managed UI module functions.

Code

function deploy_managed_ui_form_elements(&$form, $submit_handler, $vertical_tabs = FALSE) {
  $weight = 999;
  if ($vertical_tabs) {
    $weight = -999;
  }
  if (!user_access('access managed aggregator ui')) {
    return;
  }
  $plans = deploy_manager_plan_get_options();
  if (!count($plans)) {
    return;
  }
  $form['deploy_managed_ui'] = array(
    '#type' => 'fieldset',
    '#title' => t('Deployment plans'),
    '#collapsible' => TRUE,
    '#collapsed' => FALSE,
    '#group' => 'additional_settings',
    /*
        // Skipping fancy JS for now.
        '#attached' => array(
          'js' => array(
            'vertical-tabs' => drupal_get_path('module', 'deploy_managed_ui') . '/deploy_managed_ui.js',
          ),
        ),
    */
    '#tree' => TRUE,
    '#weight' => $weight,
  );
  $form['deploy_managed_ui']['text'] = array(
    '#markup' => t('Select the plans to include these changes in.'),
  );
  $form['deploy_managed_ui']['plans'] = array(
    '#type' => 'checkboxes',
    '#title' => t('Plans'),
    '#options' => $plans,
  );
  if (!$vertical_tabs) {
    $form['actions']['#weight'] = $weight + 1;
  }
  $form['#submit'][] = $submit_handler;
}