domain_theme_menu

Definition

domain_theme_menu($may_cache)
domain_theme/domain_theme.module, line 21

Description

Implements hook_menu()

Code

function domain_theme_menu($may_cache) {
  $items = array();
  if (!$may_cache) {
    // Menu items for configuring themes.
    $items[] = array(
      'title' => t('Domain theme settings'),
      'path' => 'admin/build/domain/theme',
      'access' => user_access('administer domains'),
      'type' => MENU_CALLBACK,
      'callback' => 'domain_theme_page',
      'callback arguments' => array(arg(4))
    );
    $items[] = array(
      'title' => t('Domain site settings'),
      'path' => 'admin/build/domain/theme-reset',
      'access' => user_access('administer domains'),
      'type' => MENU_CALLBACK,
      'callback' => 'domain_theme_reset',
      'callback arguments' => array(arg(4))
    );
    // Assign the theme selected, based on the active domain.
    global $_domain, $custom_theme;
    $default_theme = variable_get('theme_default', 'garland');
    $theme = domain_theme_lookup($_domain['domain_id']);
    // The above returns -1 on failure.
    if ($theme != -1) {
      $custom_theme = $theme['theme'];
    }
  }
  return $items;
}