function themekey_scan_modules in ThemeKey 6.2
Same name and namespace in other branches
- 6.4 themekey_build.inc \themekey_scan_modules()
- 6.3 themekey_build.inc \themekey_scan_modules()
- 7.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 usage in a drupal variable called 'themekey_modules'.
See also
1 call to themekey_scan_modules()
- themekey_rebuild in ./
themekey_build.inc - Rebuilds all ThemeKey related drupal variables by calling ThemeKey's hooks:
File
- ./
themekey_build.inc, line 117 - 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() {
$modules = array();
$files = file_scan_directory(dirname(__FILE__) . '/modules', '^themekey.[a-z]+.inc$');
foreach ($files as $file) {
list(, $module) = explode('.', $file->name);
if (module_exists($module)) {
$modules[] = $file->name;
}
}
variable_set('themekey_modules', $modules);
}