summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGábor Hojtsy <gabor@hojtsy.hu>2007-06-27 21:59:33 +0000
committerGábor Hojtsy <gabor@hojtsy.hu>2007-06-27 21:59:33 +0000
commit3fdddd8e4bfcac30e263f24d7d5c7258be61025e (patch)
treea921b7d2aa4353c4fa974f260485edf0d2c0b6e6
parent8650d5a77a989c8c70ba3ba5843ec9e6f7b64c05 (diff)
downloadbrdo-3fdddd8e4bfcac30e263f24d7d5c7258be61025e.tar.gz
brdo-3fdddd8e4bfcac30e263f24d7d5c7258be61025e.tar.bz2
#152926 by dww: add hook_system_info_alter() to make .info file data modifiable in PHP code
-rw-r--r--includes/module.inc4
-rw-r--r--modules/system/system.module5
2 files changed, 9 insertions, 0 deletions
diff --git a/includes/module.inc b/includes/module.inc
index 7cd13ec3d..f8a565746 100644
--- a/includes/module.inc
+++ b/includes/module.inc
@@ -123,6 +123,10 @@ function module_rebuild_cache() {
// Merge in defaults and save.
$files[$filename]->info = $file->info + $defaults;
+ // Invoke hook_system_info_alter() to give installed modules a chance to
+ // modify the data in the .info files if necessary.
+ drupal_alter('system_info', $files[$filename]->info, $files[$filename]);
+
// Log the critical hooks implemented by this module.
$bootstrap = 0;
foreach (bootstrap_hooks() as $hook) {
diff --git a/modules/system/system.module b/modules/system/system.module
index dbb40ef93..e2d73b360 100644
--- a/modules/system/system.module
+++ b/modules/system/system.module
@@ -1091,6 +1091,11 @@ function system_theme_data() {
// Read info files for each theme
foreach ($themes as $key => $theme) {
$themes[$key]->info = drupal_parse_info_file($theme->filename) + $defaults;
+
+ // Invoke hook_system_info_alter() to give installed modules a chance to
+ // modify the data in the .info files if necessary.
+ drupal_alter('system_info', $themes[$key]->info, $themes[$key]);
+
if (!empty($themes[$key]->info['base theme'])) {
$sub_themes[] = $key;
}