mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-28 06:08:52 +00:00
Revert "[ticket/14562] Language fallback for extension permissions"
This reverts commit 621b958b1c
.
This commit is contained in:
parent
bd91925fe7
commit
a895640245
1 changed files with 2 additions and 31 deletions
|
@ -2991,47 +2991,18 @@ function tidy_database()
|
||||||
*/
|
*/
|
||||||
function add_permission_language()
|
function add_permission_language()
|
||||||
{
|
{
|
||||||
global $config, $user, $phpEx, $phpbb_extension_manager;
|
global $user, $phpEx, $phpbb_extension_manager;
|
||||||
|
|
||||||
// add permission language files from extensions
|
// add permission language files from extensions
|
||||||
$finder = $phpbb_extension_manager->get_finder();
|
$finder = $phpbb_extension_manager->get_finder();
|
||||||
|
|
||||||
// We grab the language files from the default, English and user's language.
|
$lang_files = $finder
|
||||||
// So we can fall back to the other files like we do when using add_lang()
|
|
||||||
$default_lang_files = $english_lang_files = $user_lang_files = array();
|
|
||||||
|
|
||||||
// Search for board default language if it's not the user language
|
|
||||||
if ($config['default_lang'] != $user->lang_name)
|
|
||||||
{
|
|
||||||
$default_lang_files = $finder
|
|
||||||
->prefix('permissions_')
|
|
||||||
->suffix(".$phpEx")
|
|
||||||
->core_path('language/' . basename($config['default_lang']) . '/')
|
|
||||||
->extension_directory('/language/' . basename($config['default_lang']))
|
|
||||||
->find();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Search for english, if its not the default or user language
|
|
||||||
if ($config['default_lang'] != 'en' && $user->lang_name != 'en')
|
|
||||||
{
|
|
||||||
$english_lang_files = $finder
|
|
||||||
->prefix('permissions_')
|
|
||||||
->suffix(".$phpEx")
|
|
||||||
->core_path('language/en/')
|
|
||||||
->extension_directory('/language/en')
|
|
||||||
->find();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Find files in the user's language
|
|
||||||
$user_lang_files = $finder
|
|
||||||
->prefix('permissions_')
|
->prefix('permissions_')
|
||||||
->suffix(".$phpEx")
|
->suffix(".$phpEx")
|
||||||
->core_path('language/' . $user->lang_name . '/')
|
->core_path('language/' . $user->lang_name . '/')
|
||||||
->extension_directory('/language/' . $user->lang_name)
|
->extension_directory('/language/' . $user->lang_name)
|
||||||
->find();
|
->find();
|
||||||
|
|
||||||
$lang_files = array_merge($english_lang_files, $default_lang_files, $user_lang_files);
|
|
||||||
|
|
||||||
foreach ($lang_files as $lang_file => $ext_name)
|
foreach ($lang_files as $lang_file => $ext_name)
|
||||||
{
|
{
|
||||||
if ($ext_name === '/')
|
if ($ext_name === '/')
|
||||||
|
|
Loading…
Add table
Reference in a new issue