diff options
Diffstat (limited to 'includes/module.inc')
-rw-r--r-- | includes/module.inc | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/includes/module.inc b/includes/module.inc index 500bc5ebc..28bca2350 100644 --- a/includes/module.inc +++ b/includes/module.inc @@ -178,6 +178,33 @@ function system_list($type) { $lists['filepaths'][] = array('type' => $record->type, 'name' => $record->name, 'filepath' => $record->filename); } } + foreach ($lists['theme'] as $key => $theme) { + if (!empty($theme->info['base theme'])) { + // Make a list of the theme's base themes. + $lists['theme'][$key]->base_themes = drupal_find_base_themes($lists['theme'], $key); + // Don't proceed if there was a problem with the root base theme. + if (!current($lists['theme'][$key]->base_themes)) { + continue; + } + // Determine the root base theme. + $base_key = key($lists['theme'][$key]->base_themes); + // Add to the list of sub-themes for each of the theme's base themes. + foreach (array_keys($lists['theme'][$key]->base_themes) as $base_theme) { + $lists['theme'][$base_theme]->sub_themes[$key] = $lists['theme'][$key]->info['name']; + } + // Add the base theme's theme engine info. + $lists['theme'][$key]->info['engine'] = isset($lists['theme'][$base_key]->info['engine']) ? $lists['theme'][$base_key]->info['engine'] : 'theme'; + } + else { + // A plain theme is its own engine. + $base_key = $key; + if (!isset($lists['theme'][$key]->info['engine'])) { + $lists['theme'][$key]->info['engine'] = 'theme'; + } + } + // Set the theme engine prefix. + $lists['theme'][$key]->prefix = ($lists['theme'][$key]->info['engine'] == 'theme') ? $base_key : $lists['theme'][$key]->info['engine']; + } cache_set('system_list', $lists, 'cache_bootstrap'); } // To avoid a separate database lookup for the filepath, prime the |