You are here

function themekey_scan_modules in ThemeKey 6.4

Same name and namespace in other branches
  1. 6.2 themekey_build.inc \themekey_scan_modules()
  2. 6.3 themekey_build.inc \themekey_scan_modules()
  3. 7.3 themekey_build.inc \themekey_scan_modules()
  4. 7 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 usage in a drupal variable called 'themekey_modules'.

See also

themekey_rebuild()

themekey_invoke_modules()

2 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_rebuild in ./themekey_build.inc
Rebuilds all ThemeKey related drupal variables by calling ThemeKey's hooks:

File

./themekey_build.inc, line 131
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\\.[^.]+\\.inc$');
  foreach ($files as $file) {
    list(, $module) = explode('.', $file->name);
    if (module_exists($module)) {
      $modules[] = $module;
    }
  }
  variable_set('themekey_modules', $modules);
}