1
0
mirror of https://github.com/phpbb/phpbb.git synced 2025-08-29 19:20:23 +02:00

[ticket/17191] Add new direction and user_langto helper and language.php

PHPBB3-17191
This commit is contained in:
Christian Schnegelberger
2023-09-21 17:00:37 +02:00
committed by Marc Alexander
parent 06f38a5646
commit 6d07852410
4 changed files with 38 additions and 10 deletions

View File

@@ -253,11 +253,19 @@ class helper
*/
protected function page_header($page_title, $selected_language = false)
{
global $phpbb_container;
// Path to templates
$paths = array($this->phpbb_root_path . 'install/update/new/adm/', $this->phpbb_admin_path);
$paths = array_filter($paths, 'is_dir');
$path = array_shift($paths);
$path = substr($path, strlen($this->phpbb_root_path));
// Get the language helper
/* @var $language_helper \phpbb\language\language_file_helper */
$language_file_helper = $phpbb_container->get('language.helper.language_file');
// Grab the users lang direction and store it for later use
$direction = $language_file_helper->get_lang_key_value('direction');
$this->template->assign_vars(array(
'L_CHANGE' => $this->language->lang('CHANGE'),
@@ -271,13 +279,13 @@ class helper
'T_TEMPLATE_PATH' => $this->path_helper->get_web_root_path() . $path . 'style',
'T_ASSETS_PATH' => $this->path_helper->get_web_root_path() . $path . '../assets',
'S_CONTENT_DIRECTION' => $this->language->lang('DIRECTION'),
'S_CONTENT_FLOW_BEGIN' => ($this->language->lang('DIRECTION') === 'ltr') ? 'left' : 'right',
'S_CONTENT_FLOW_END' => ($this->language->lang('DIRECTION') === 'ltr') ? 'right' : 'left',
'S_CONTENT_DIRECTION' => $direction,
'S_CONTENT_FLOW_BEGIN' => ($direction === 'ltr') ? 'left' : 'right',
'S_CONTENT_FLOW_END' => ($direction === 'ltr') ? 'right' : 'left',
'S_CONTENT_ENCODING' => 'UTF-8',
'S_LANG_SELECT' => $selected_language,
'S_USER_LANG' => $this->language->lang('USER_LANG'),
'S_USER_LANG' => $language_file_helper->get_lang_key_value('user_lang'),
));
$this->render_navigation();