diff options
author | OpenShift guest <dachebodt@gmail.com> | 2013-04-13 10:49:59 -0400 |
---|---|---|
committer | OpenShift guest <dachebodt@gmail.com> | 2013-04-13 10:49:59 -0400 |
commit | 474b4a60a527a4c0cd853872ce80ae50fdd2f374 (patch) | |
tree | 46f3b0798ac2d0b8d68efbe67e8f4054f4fa86ab /phpBB/includes/functions_admin.php | |
parent | 323a494cd16bd202d89260f756519c2d76f2f9fe (diff) | |
download | forums-474b4a60a527a4c0cd853872ce80ae50fdd2f374.tar forums-474b4a60a527a4c0cd853872ce80ae50fdd2f374.tar.gz forums-474b4a60a527a4c0cd853872ce80ae50fdd2f374.tar.bz2 forums-474b4a60a527a4c0cd853872ce80ae50fdd2f374.tar.xz forums-474b4a60a527a4c0cd853872ce80ae50fdd2f374.zip |
[ticket/11458] We still auto add language files from the mods and acp
folders in the language directory, so we revert some changes here
PHPBB3-11458
Diffstat (limited to 'phpBB/includes/functions_admin.php')
-rw-r--r-- | phpBB/includes/functions_admin.php | 35 |
1 files changed, 31 insertions, 4 deletions
diff --git a/phpBB/includes/functions_admin.php b/phpBB/includes/functions_admin.php index 5d71f55d1a..b5efa49159 100644 --- a/phpBB/includes/functions_admin.php +++ b/phpBB/includes/functions_admin.php @@ -3045,20 +3045,47 @@ function add_permission_language() // First of all, our own file. We need to include it as the first file because it presets all relevant variables. $user->add_lang('acp/permissions_phpbb'); - // add permission language files from extensions + $files_to_add = array(); + + // Now search in acp and mods folder for permissions_ files. + foreach (array('acp/', 'mods/') as $path) + { + $dh = @opendir($user->lang_path . $user->lang_name . '/' . $path); + + if ($dh) + { + while (($file = readdir($dh)) !== false) + { + if ($file !== 'permissions_phpbb.' . $phpEx && strpos($file, 'permissions_') === 0 && substr($file, -(strlen($phpEx) + 1)) === '.' . $phpEx) + { + $files_to_add[] = $path . substr($file, 0, -(strlen($phpEx) + 1)); + } + } + closedir($dh); + } + } + + // find permission language files from extensions $finder = $phpbb_extension_manager->get_finder(); - $lang_files = $finder + $ext_lang_files = $finder ->prefix('permissions_') ->suffix(".$phpEx") ->extension_directory('/language/' . $user->lang_name) - ->core_path('language/' . $user->lang_name . '/mods') ->find(); - foreach ($lang_files as $lang_file => $ext_name) + foreach ($ext_lang_files as $lang_file => $ext_name) { $user->add_lang_ext($ext_name, $lang_file); } + + if (!sizeof($files_to_add)) + { + return false; + } + + $user->add_lang($files_to_add); + return true; } /** |