aboutsummaryrefslogtreecommitdiffstats
path: root/phpBB/includes/functions_module.php
diff options
context:
space:
mode:
authorMeik Sievertsen <acydburn@phpbb.com>2007-07-24 15:20:32 +0000
committerMeik Sievertsen <acydburn@phpbb.com>2007-07-24 15:20:32 +0000
commit959448c9353b36791ca51b9dc9d84d53b8db8072 (patch)
treea00ea6bab7ccb1cae4bbacaf21dda11c51a62e76 /phpBB/includes/functions_module.php
parent306581d905c508e6d4a7bafebce1b90dbedbbf4a (diff)
downloadforums-959448c9353b36791ca51b9dc9d84d53b8db8072.tar
forums-959448c9353b36791ca51b9dc9d84d53b8db8072.tar.gz
forums-959448c9353b36791ca51b9dc9d84d53b8db8072.tar.bz2
forums-959448c9353b36791ca51b9dc9d84d53b8db8072.tar.xz
forums-959448c9353b36791ca51b9dc9d84d53b8db8072.zip
+ some fixes
git-svn-id: file:///svn/phpbb/trunk@7938 89ea8834-ac86-4346-8a33-228a782c2dd0
Diffstat (limited to 'phpBB/includes/functions_module.php')
-rw-r--r--phpBB/includes/functions_module.php56
1 files changed, 33 insertions, 23 deletions
diff --git a/phpBB/includes/functions_module.php b/phpBB/includes/functions_module.php
index cb5536eb1d..9db2c4fa25 100644
--- a/phpBB/includes/functions_module.php
+++ b/phpBB/includes/functions_module.php
@@ -124,29 +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();
-
- $dir = @opendir($user->lang_path . 'mods');
-
- if ($dir)
- {
- while (($entry = readdir($dir)) !== false)
- {
- if (strpos($entry, 'info_' . strtolower($this->p_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);
- }
- }
+ $this->add_mod_info($this->p_class);
// Now build the module array, but exclude completely empty categories...
$right_id = false;
@@ -824,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