You are here

function domain_conf_domainbatch in Domain Access 5

Same name and namespace in other branches
  1. 6.2 domain_conf/domain_conf.module \domain_conf_domainbatch()
  2. 7.2 domain_conf/domain_conf.module \domain_conf_domainbatch()

Implement hook_domainbatch()

File

domain_conf/domain_conf.module, line 367
Domain manager configuration options.

Code

function domain_conf_domainbatch() {
  $batch = array();

  // Allows the deletion of all Domain Configuration rows.
  $batch['domain_conf'] = array(
    '#form' => array(
      '#title' => t('Reset configurations'),
      '#type' => 'checkbox',
      '#options' => array(
        t('Reset'),
      ),
      '#description' => t('Delete custom settings for this domain.'),
    ),
    '#domain_action' => 'domain_delete',
    '#system_default' => 0,
    '#variable' => 'domain_conf',
    '#meta_description' => t('Delete custom settings for domains as supplied by Domain Configuration.'),
    '#table' => 'domain_conf',
    '#weight' => -2,
  );

  // Change the email address.
  $batch['site_mail'] = array(
    '#form' => array(
      '#title' => t('Email address'),
      '#type' => 'textfield',
      '#size' => 40,
      '#maxlength' => 255,
      '#description' => t('Set the email address for this domain.'),
    ),
    '#domain_action' => 'domain_conf',
    '#system_default' => variable_get('site_mail', ''),
    '#variable' => 'site_mail',
    '#meta_description' => t('Set the email address for all domains.'),
    '#data_type' => 'string',
    '#weight' => -8,
  );

  // Change the site slogan.
  $batch['site_slogan'] = array(
    '#form' => array(
      '#title' => t('Site slogan'),
      '#type' => 'textfield',
      '#size' => 60,
      '#maxlength' => 255,
      '#description' => t('The slogan of this domain. Some themes display a slogan when available.'),
    ),
    '#domain_action' => 'domain_conf',
    '#system_default' => variable_get('site_slogan', ''),
    '#variable' => 'site_slogan',
    '#meta_description' => t('Set the site slogan for all domains.'),
    '#data_type' => 'string',
    '#weight' => -8,
  );

  // Change the site slogan.
  $batch['site_mission'] = array(
    '#form' => array(
      '#title' => t('Site mission'),
      '#type' => 'textarea',
      '#cols' => 30,
      '#rows' => 5,
      '#description' => t('The mission statement or focus for this domain.'),
    ),
    '#domain_action' => 'domain_conf',
    '#system_default' => variable_get('site_mission', ''),
    '#variable' => 'site_mission',
    '#meta_description' => t('Set the site mission for all domains.'),
    '#data_type' => 'string',
    '#weight' => -8,
  );

  // Change the site footer.
  $batch['site_footer'] = array(
    '#form' => array(
      '#title' => t('Site footer'),
      '#type' => 'textarea',
      '#cols' => 30,
      '#rows' => 5,
      '#description' => t('This text will be displayed at the bottom of each page for this domain.'),
    ),
    '#domain_action' => 'domain_conf',
    '#system_default' => variable_get('site_footer', ''),
    '#variable' => 'site_footer',
    '#meta_description' => t('Set the site footer for all domains.'),
    '#data_type' => 'string',
    '#weight' => -8,
  );

  // Change the site frontpage.
  $batch['site_frontpage'] = array(
    '#form' => array(
      '#title' => t('Site frontpage'),
      '#type' => 'textfield',
      '#size' => 30,
      '#maxlength' => 255,
      '#description' => t('The home page displays content from this relative URL. If unsure, specify "node".'),
    ),
    '#domain_action' => 'domain_conf',
    '#system_default' => variable_get('site_frontpage', 'node'),
    '#variable' => 'site_frontpage',
    '#meta_description' => t('Set the site frontpage for all domains.'),
    '#data_type' => 'string',
    '#weight' => -8,
  );

  // Change the anonymous user name.
  $batch['anonymous'] = array(
    '#form' => array(
      '#title' => t('Anonymous user'),
      '#type' => 'textfield',
      '#size' => 30,
      '#maxlength' => 255,
      '#description' => t('The name used to indicate anonymous users for this domain.'),
    ),
    '#domain_action' => 'domain_conf',
    '#system_default' => variable_get('anonymous', 'Anonymous'),
    '#variable' => 'anonymous',
    '#meta_description' => t('Set the anonymous user label for all domains.'),
    '#data_type' => 'string',
    '#weight' => -8,
  );

  // Change the administrative theme.
  $themes = list_themes();
  ksort($themes);
  $options[] = t('Use domain default theme');
  foreach ($themes as $key => $value) {
    $options[$key] = $key;
  }
  $batch['admin_theme'] = array(
    '#form' => array(
      '#title' => t('Administrative theme'),
      '#type' => 'select',
      '#options' => $options,
      '#description' => t('Select the administrative theme for this domain.'),
    ),
    '#domain_action' => 'domain_conf',
    '#system_default' => variable_get('admin_theme', 0),
    '#variable' => 'admin_theme',
    '#meta_description' => t('Set the administrative theme for all domains.'),
    '#data_type' => 'string',
    '#weight' => -8,
  );

  // Change the timezone.
  $zones = _system_zonelist();
  $batch['date_default_timezone'] = array(
    '#form' => array(
      '#title' => t('Timezone default'),
      '#type' => 'select',
      '#options' => $zones,
      '#description' => t('Select the default site time zone.'),
    ),
    '#domain_action' => 'domain_conf',
    '#system_default' => variable_get('date_default_timezone', 0),
    '#variable' => 'date_default_timezone',
    '#meta_description' => t('Set the default timezone for all domains.'),
    '#data_type' => 'string',
    '#weight' => -8,
  );

  // Toggle the site offline status.
  $batch['site_offline'] = array(
    '#form' => array(
      '#title' => t('Site status'),
      '#type' => 'radios',
      '#options' => array(
        t('Online'),
        t('Off-line'),
      ),
      '#description' => t('Toggle online/offline status.'),
    ),
    '#domain_action' => 'domain_conf',
    '#system_default' => variable_get('site_offline', 0),
    '#variable' => 'site_offline',
    '#meta_description' => t('Set the online / offline status for all domains.'),
    '#data_type' => 'integer',
    '#weight' => -8,
  );

  // Change the site offline message.
  $batch['site_offline_message'] = array(
    '#form' => array(
      '#title' => t('Site offline message'),
      '#type' => 'textarea',
      '#cols' => 30,
      '#rows' => 5,
      '#description' => t('Message to show visitors when this domain is in off-line mode.'),
    ),
    '#domain_action' => 'domain_conf',
    '#system_default' => variable_get('site_offline_message', ''),
    '#variable' => 'site_offline_message',
    '#meta_description' => t('Set the site offline message for all domains.'),
    '#data_type' => 'string',
    '#weight' => -8,
  );
  foreach ($batch as $item => $values) {
    $batch[$item]['#permission'] = 'administer site configuration';
  }
  return $batch;
}