aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/functions_module.php
diff options
context:
space:
mode:
authorNils Adermann <naderman@naderman.de>2010-03-02 01:05:36 +0100
committerNils Adermann <naderman@naderman.de>2010-03-02 01:05:36 +0100
commit75e7ffc317af7ad5b7a420a53115caaa66d3a942 (patch)
tree643b59585bc706acf1c0260dd262f26e52de06c0 /phpBB/includes/functions_module.php
parent1ceddd9eeccde56ab307631a16e40b943eac883a (diff)
parente02e530204a31c7723a73cbfcdba0d6132b1a175 (diff)
downloadforums-75e7ffc317af7ad5b7a420a53115caaa66d3a942.tar
forums-75e7ffc317af7ad5b7a420a53115caaa66d3a942.tar.gz
forums-75e7ffc317af7ad5b7a420a53115caaa66d3a942.tar.bz2
forums-75e7ffc317af7ad5b7a420a53115caaa66d3a942.tar.xz
forums-75e7ffc317af7ad5b7a420a53115caaa66d3a942.zip
Merge commit 'release-3.0-RC4'
Diffstat (limited to 'phpBB/includes/functions_module.php')
-rw-r--r--phpBB/includes/functions_module.php47
1 files changed, 33 insertions, 14 deletions
diff --git a/phpBB/includes/functions_module.php b/phpBB/includes/functions_module.php
index 1010de643b..9db2c4fa25 100644
--- a/phpBB/includes/functions_module.php
+++ b/phpBB/includes/functions_module.php
@@ -124,20 +124,7 @@ class p_master
$this->module_cache['modules'] = array_merge($this->module_cache['modules']);
// Include MOD _info files for populating language entries within the menus
- if (file_exists($user->lang_path . 'mods'))
- {
- $add_files = array();
-
- foreach (glob($user->lang_path . 'mods/info_' . strtolower($this->p_class) . '_*.' . $phpEx, GLOB_NOSORT) as $file)
- {
- $add_files[] = 'mods/' . substr(basename($file), 0, -(strlen($phpEx) + 1));
- }
-
- if (sizeof($add_files))
- {
- $user->add_lang($add_files);
- }
- }
+ $this->add_mod_info($this->p_class);
// Now build the module array, but exclude completely empty categories...
$right_id = false;
@@ -815,6 +802,38 @@ class p_master
}
}
}
+
+ /**
+ * Add custom MOD info language file
+ */
+ function add_mod_info($module_class)
+ {
+ global $user, $phpEx;
+
+ if (file_exists($user->lang_path . 'mods'))
+ {
+ $add_files = array();
+
+ $dir = @opendir($user->lang_path . 'mods');
+
+ if ($dir)
+ {
+ while (($entry = readdir($dir)) !== false)
+ {
+ if (strpos($entry, 'info_' . strtolower($module_class) . '_') === 0 && substr(strrchr($entry, '.'), 1) == $phpEx)
+ {
+ $add_files[] = 'mods/' . substr(basename($entry), 0, -(strlen($phpEx) + 1));
+ }
+ }
+ closedir($dir);
+ }
+
+ if (sizeof($add_files))
+ {
+ $user->add_lang($add_files);
+ }
+ }
+ }
}
?> \ No newline at end of file