You are here

function domain_theme_custom_theme in Domain Access 7.2

Same name and namespace in other branches
  1. 7.3 domain_theme/domain_theme.module \domain_theme_custom_theme()

Implements hook_custom_theme().

File

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

Code

function domain_theme_custom_theme() {
  global $conf;
  $_domain = domain_get_domain();

  // Check for a custom admin theme.
  if (isset($conf['admin_theme']) && path_is_admin(current_path())) {
    $theme = domain_theme_lookup($_domain['domain_id'], $conf['admin_theme']);
  }
  else {

    // Assign the theme selected, based on the active domain.
    $theme = domain_theme_lookup($_domain['domain_id']);
  }

  // The above returns -1 on failure.
  if ($theme != -1) {
    domain_theme_set_variables($theme);
    return $theme['theme'];
  }
}