From 85b99b642f547a13a3d9fbdcbf3e773bb1745dde Mon Sep 17 00:00:00 2001 From: Meik Sievertsen Date: Sun, 1 Jul 2007 18:46:14 +0000 Subject: [PATCH] allow mod authors to plug in info_ language files for population within the menu. git-svn-id: file:///svn/phpbb/trunk@7819 89ea8834-ac86-4346-8a33-228a782c2dd0 --- phpBB/docs/CHANGELOG.html | 1 + phpBB/docs/FAQ.html | 1 - phpBB/docs/INSTALL.html | 1 - phpBB/docs/README.html | 1 - phpBB/docs/auth_api.html | 1 - phpBB/docs/coding-guidelines.html | 1 - phpBB/includes/functions_module.php | 16 ++++++++++++++++ 7 files changed, 17 insertions(+), 5 deletions(-) diff --git a/phpBB/docs/CHANGELOG.html b/phpBB/docs/CHANGELOG.html index 865c8c5e0f..7bcda12e65 100644 --- a/phpBB/docs/CHANGELOG.html +++ b/phpBB/docs/CHANGELOG.html @@ -209,6 +209,7 @@ p a {
  • [Fix] Search boxes not loosing session id (changing method from get to post) (Bug #12643)
  • [Fix] Make sure the automatic update is also working for those having fsockopen disabled
  • [Fix] Simulate recache of theme data on automatic update finished page - recaching it if css data changed
  • +
  • [Feature] Allow dropping in custom "info_[module class]_*.php" files to language/*/mods directory for inclusion into the menu structure without the need to modify phpBB language files for menu placements
  • diff --git a/phpBB/docs/FAQ.html b/phpBB/docs/FAQ.html index 6a010dc5ec..5bda802cd4 100644 --- a/phpBB/docs/FAQ.html +++ b/phpBB/docs/FAQ.html @@ -1,4 +1,3 @@ - diff --git a/phpBB/docs/INSTALL.html b/phpBB/docs/INSTALL.html index 185e18b7e0..8d9cac6cf3 100644 --- a/phpBB/docs/INSTALL.html +++ b/phpBB/docs/INSTALL.html @@ -1,4 +1,3 @@ - diff --git a/phpBB/docs/README.html b/phpBB/docs/README.html index 3c77d11cc5..ff579c1ceb 100644 --- a/phpBB/docs/README.html +++ b/phpBB/docs/README.html @@ -1,4 +1,3 @@ - diff --git a/phpBB/docs/auth_api.html b/phpBB/docs/auth_api.html index 7481be50a8..8f86ae2740 100644 --- a/phpBB/docs/auth_api.html +++ b/phpBB/docs/auth_api.html @@ -1,4 +1,3 @@ - diff --git a/phpBB/docs/coding-guidelines.html b/phpBB/docs/coding-guidelines.html index 8fd904e7c0..14deabf135 100644 --- a/phpBB/docs/coding-guidelines.html +++ b/phpBB/docs/coding-guidelines.html @@ -1,4 +1,3 @@ - diff --git a/phpBB/includes/functions_module.php b/phpBB/includes/functions_module.php index bbb44d4b3d..1010de643b 100644 --- a/phpBB/includes/functions_module.php +++ b/phpBB/includes/functions_module.php @@ -123,6 +123,22 @@ class p_master // Re-index (this is needed, else we are not able to array_slice later) $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); + } + } + // Now build the module array, but exclude completely empty categories... $right_id = false; $names = array();