You are here

function domain_theme_domainbatch in Domain Access 5

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

Implement hook_domainbatch()

File

domain_theme/domain_theme.module, line 208
Domain Theme module for the Domain Access module group.

Code

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

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

  // Change themes for sites.
  $themes = list_themes();
  $options = array();
  foreach ($themes as $theme) {
    if ($theme->status == 1) {
      $options[$theme->name] = $theme->name;
    }
  }
  $batch['site_theme'] = array(
    '#form' => array(
      '#title' => t('Theme settings'),
      '#type' => 'select',
      '#options' => $options,
      '#description' => t('Select the theme for this domain.'),
    ),
    '#domain_action' => 'custom',
    '#lookup' => 'domain_theme_lookup',
    '#submit' => 'domain_theme_batch',
    '#system_default' => variable_get('theme_default', 'garland'),
    '#variable' => 'theme_default',
    '#meta_description' => t('Change the themes for all domains.'),
    '#data_type' => 'integer',
    '#weight' => -6,
  );
  return $batch;
}