function themekey_scan_modules in ThemeKey 7.3
Same name and namespace in other branches
- 6.4 themekey_build.inc \themekey_scan_modules()
- 6.2 themekey_build.inc \themekey_scan_modules()
- 6.3 themekey_build.inc \themekey_scan_modules()
- 7 themekey_build.inc \themekey_scan_modules()
- 7.2 themekey_build.inc \themekey_scan_modules()
Scans directory themekey/modules for suitable files which provide ThemeKey properties mapping function and so on and stores the file names, for later use, in a Drupal variable called 'themekey_modules'.
Parameters
$blacklist: array of module names that should not be included
See also
3 calls to themekey_scan_modules()
- themekey_invoke_modules in ./
themekey_base.inc - Invokes a hook on all modules stored in the global variable 'themekey_modules'
- themekey_modules_disabled in ./
themekey.module - Implements hook_modules_disabled().
- themekey_rebuild in ./
themekey_build.inc - Rebuilds all ThemeKey-related Drupal variables by calling the hooks:
File
- ./
themekey_build.inc, line 138 - The functions in this file are the back end of ThemeKey which should be used only if you configure something, but not when ThemeKey switches themes.
Code
function themekey_scan_modules($blacklist = array()) {
$modules = array();
$files = file_scan_directory(dirname(__FILE__) . '/modules', '/^themekey\\.[^.]+\\.inc$/');
foreach ($files as $file) {
list(, $module) = explode('.', $file->name);
if (!in_array($module, $blacklist) && module_exists($module)) {
$modules[] = $module;
}
}
variable_set('themekey_modules', $modules);
}