You are here

function skinr_current_theme in Skinr 6.2

Same name and namespace in other branches
  1. 8.2 skinr.module \skinr_current_theme()
  2. 6 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

$exculde_admin_theme: Optional. Set to TRUE to exclude the admin theme from posible themes to return.

9 calls to skinr_current_theme()
skinr_get in ./skinr.module
Retrieves the desired skinr object.
skinr_preprocess in ./skinr.module
Implementation of hook_preprocess().
skinr_skin_extract in ./skinr.module
skinr_skin_get_files in ./skinr.module
Helper function to fetch all css or js files from an array of skins.
skinr_ui_export_form in ./skinr_ui.admin.inc
Skinr settings export form.

... See full list

File

./skinr.module, line 571

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;
}