You are here

function content_copy_deploy_add_form in Deploy - Content Staging 5

Same name and namespace in other branches
  1. 6 modules/content_copy_deploy/content_copy_deploy.pages.inc \content_copy_deploy_add_form()

deploy content type form

1 string reference to 'content_copy_deploy_add_form'
content_copy_deploy_menu in content_copy_deploy/content_copy_deploy.module
implementation of hook menu

File

content_copy_deploy/content_copy_deploy.module, line 31

Code

function content_copy_deploy_add_form($plans) {
  $types = content_copy_types();
  $form['pid'] = array(
    '#title' => t('Deployment Plan'),
    '#type' => 'select',
    '#options' => $plans,
    '#description' => t('The deployment plan to add this content type to.'),
  );
  if (module_exists('hs_flatlist')) {
    $form['content_type'] = array(
      '#title' => t('Content Type'),
      '#type' => 'hierarchical_select',
      '#required' => TRUE,
      '#config' => array(
        'module' => 'hs_flatlist',
        'params' => array(
          'options' => $types,
        ),
        'dropbox' => array(
          'status' => 1,
          'title' => t('Selected content types'),
        ),
      ),
      '#description' => t('The content types to deploy.'),
    );
  }
  else {
    $form['content_type'] = array(
      '#title' => t('Content Type'),
      '#type' => 'select',
      '#multiple' => TRUE,
      '#required' => TRUE,
      '#options' => $types,
      '#description' => t('The content type to deploy.'),
    );
  }
  $form['submit'] = array(
    '#type' => 'submit',
    '#value' => t('Submit'),
  );
  return $form;
}