function themekey_is_active in ThemeKey 7.3
Indicates if ThemeKey rule chains will be evaluated.
Return value
bool
4 calls to themekey_is_active()
- ThemekeyModulePluginsTestCase::testActivePaths in tests/
ThemekeyModulePluginsTestCase.test - themekey_css_init in themekey_css/
themekey_css.module - Implements hook_init().
- themekey_custom_theme in ./
themekey.module - Implements hook_custom_theme().
- themekey_redirect_init in themekey_redirect/
themekey_redirect.module - Implements hook_init().
File
- ./
themekey.module, line 250 - ThemeKey is designed as a generic theme-switching module.
Code
function themekey_is_active() {
// Don't change theme when ...
if ((in_array('system', variable_get('themekey_compat_modules_enabled', array())) || !(variable_get('admin_theme', '0') && path_is_admin($_GET['q']))) && strpos($_GET['q'], 'admin/structure/block/demo') !== 0 && strpos($_SERVER['SCRIPT_FILENAME'], 'cron.php') === FALSE && strpos($_SERVER['SCRIPT_FILENAME'], 'drush.php') === FALSE && (!defined('MAINTENANCE_MODE') || MAINTENANCE_MODE != 'install' && MAINTENANCE_MODE != 'update')) {
require_once DRUPAL_ROOT . '/' . drupal_get_path('module', 'themekey') . '/themekey_base.inc';
$paths = $paths = array_merge_recursive(themekey_invoke_modules('themekey_disabled_paths'), module_invoke_all('themekey_disabled_paths'));
foreach ($paths as $path) {
if (strpos($_GET['q'], $path) === 0) {
return FALSE;
}
}
return TRUE;
}
return FALSE;
}