You are here

function skinr_current_theme in Skinr 6

Same name and namespace in other branches
  1. 8.2 skinr.module \skinr_current_theme()
  2. 6.2 skinr.module \skinr_current_theme()
  3. 7.2 skinr.module \skinr_current_theme()

Helper function to retrieve the current theme. The global variable $theme_key doesn't work for our purposes when an admin theme is enabled.

Parameters

$exclude_admin_theme: Optional. Set to TRUE to exclude the admin theme from possible themes to return.

5 calls to skinr_current_theme()
skinr_export_form in ./skinr.admin.inc
Skinr settings export form.
skinr_form_alter in ./skinr.module
Implementation of hook_form_alter().
skinr_get in ./skinr.module
Retrieves the desired classes. If no hook or key are specified, it will return all skinr classes.
skinr_import_form in ./skinr.admin.inc
Skinr settings import form.
skinr_preprocess in ./skinr.module
Implementation of hook_preprocess().

File

./skinr.module, line 543

Code

function skinr_current_theme($exclude_admin_theme = FALSE) {
  global $user, $custom_theme;
  if (!empty($user->theme)) {
    $current_theme = $user->theme;
  }
  elseif (!empty($custom_theme) && !($exclude_admin_theme && $custom_theme == variable_get('admin_theme', '0'))) {

    // Don't return the admin theme if we're editing skinr settings.
    $current_theme = $custom_theme;
  }
  else {
    $current_theme = variable_get('theme_default', 'garland');
  }
  return $current_theme;
}