You are here

function domain_domain_batch in Domain Access 7.3

Implements hook_domain_batch().

File

./domain.module, line 3179
Core module functions for the Domain Access suite.

Code

function domain_domain_batch() {

  // Change all the domain names at once.
  $batch = array();
  $batch['subdomain'] = array(
    '#form' => array(
      '#title' => t('Domains'),
      '#type' => 'textfield',
      '#size' => 40,
      '#maxlength' => 80,
      '#description' => t('Enter the host value of the domain.  No http:// or slashes.'),
      '#required' => TRUE,
    ),
    '#domain_action' => 'domain',
    '#meta_description' => t('Edit all domain values.'),
    '#data_type' => 'string',
    '#update_all' => FALSE,
    '#weight' => -10,
  );

  //Change all the site names at once.
  $batch['sitename'] = array(
    '#form' => array(
      '#title' => t('Names'),
      '#type' => 'textfield',
      '#size' => 40,
      '#maxlength' => 80,
      '#description' => t('The human-readable name for this domain.'),
      '#required' => TRUE,
    ),
    '#domain_action' => 'domain',
    '#meta_description' => t('Edit all domain names.'),
    '#data_type' => 'string',
    '#update_all' => FALSE,
    '#weight' => -10,
  );

  // Change all the schemes at once.
  $batch['scheme'] = array(
    '#form' => array(
      '#title' => t('URL schemes'),
      '#type' => 'radios',
      '#options' => array(
        'http' => 'http://',
        'https' => 'https://',
      ),
      '#description' => t('The URL scheme for accessing this domain.'),
    ),
    '#domain_action' => 'domain',
    '#meta_description' => t('Edit all domain URL schemes.'),
    '#system_default' => variable_get('domain_scheme', 'http://'),
    '#data_type' => 'string',
    '#update_all' => TRUE,
    '#weight' => -10,
  );

  // Change all the valid flags at once.
  $batch['valid'] = array(
    '#form' => array(
      '#title' => t('Valid domains'),
      '#type' => 'radios',
      '#options' => array(
        1 => t('Active'),
        0 => t('Inactive'),
      ),
      '#description' => t('Allows users to access this domain.'),
    ),
    '#domain_action' => 'domain',
    '#meta_description' => t('Edit all domain status flags.'),
    '#system_default' => 1,
    '#data_type' => 'integer',
    '#update_all' => TRUE,
    '#weight' => -10,
  );
  foreach ($batch as $key => $value) {
    $batch[$key]['#module'] = t('Domain Access');
  }
  return $batch;
}