You are here

function fusion_apply_current_theme in Fusion Accelerator 7.2

Same name and namespace in other branches
  1. 7 fusion_apply/fusion_apply.module \fusion_apply_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.

Return value

The current theme name.

4 calls to fusion_apply_current_theme()
fusion_apply_preprocess in fusion_apply/fusion_apply.module
Implements hook_preprocess().
fusion_apply_ui_export_form in fusion_apply/fusion_apply_ui.admin.inc
Form builder for the skin settings export form.
fusion_apply_ui_form_alter in fusion_apply/fusion_apply_ui.module
Implements hook_form_alter().
fusion_apply_ui_form_submit in fusion_apply/fusion_apply_ui.module
Form submission handler for fusion_apply_ui_form_alter().

File

fusion_apply/fusion_apply.module, line 670
Handles core Fusion Apply functionality.

Code

function fusion_apply_current_theme($exclude_admin_theme = FALSE) {
  $custom_theme = menu_get_custom_theme();
  if (!empty($user->theme) && drupal_theme_access($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 Fusion Apply settings.
    $current_theme = $custom_theme;
  }
  else {
    $current_theme = variable_get('theme_default', 'bartik');
  }
  return $current_theme;
}