function _styleswitcher_theme_access in Style Switcher 6.2
Access callback: Allows only for enabled themes.
Parameters
string|object $theme: Either the name of a theme or a full theme object.
See also
1 call to _styleswitcher_theme_access()
- _styleswitcher_config_theme_access in ./
styleswitcher.module - Access callback: Allows only admin and only for enabled themes.
1 string reference to '_styleswitcher_theme_access'
- styleswitcher_menu in ./
styleswitcher.module - Implements hook_menu().
File
- ./
styleswitcher.module, line 249 - Module's hooks implementations and helper functions.
Code
function _styleswitcher_theme_access($theme) {
if (is_string($theme)) {
$themes = list_themes();
if (!isset($themes[$theme])) {
return FALSE;
}
$theme = $themes[$theme];
}
return $theme->status || $theme->name == variable_get('admin_theme', '0');
}