You are here

function themekey_scan_modules in ThemeKey 7

Same name and namespace in other branches
  1. 6.4 themekey_build.inc \themekey_scan_modules()
  2. 6.2 themekey_build.inc \themekey_scan_modules()
  3. 6.3 themekey_build.inc \themekey_scan_modules()
  4. 7.3 themekey_build.inc \themekey_scan_modules()
  5. 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

themekey_rebuild()

themekey_invoke_modules()

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 ThemeKey's hooks:

File

./themekey_build.inc, line 136
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\\.[a-z]+\\.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);
}