mirror of
https://github.com/phpbb/phpbb.git
synced 2025-06-07 20:08:53 +00:00
[ticket/10824] Use correct language and style composer.json data
PHPBB3-10824
This commit is contained in:
parent
204f81c6f7
commit
adf9f49a42
3 changed files with 32 additions and 17 deletions
|
@ -121,15 +121,29 @@ class acp_language
|
|||
|
||||
$lang_iso = $lang_entries['lang_iso'];
|
||||
|
||||
$template->assign_vars(array(
|
||||
'S_DETAILS' => true,
|
||||
'U_ACTION' => $this->u_action . "&action=details&id=$lang_id",
|
||||
'U_BACK' => $this->u_action,
|
||||
/** @var \phpbb\language\language_file_helper $language_helper */
|
||||
$language_helper = $phpbb_container->get('language.helper.language_file');
|
||||
|
||||
'LANG_LOCAL_NAME' => $lang_entries['lang_local_name'],
|
||||
'LANG_ENGLISH_NAME' => $lang_entries['lang_english_name'],
|
||||
'LANG_ISO' => $lang_iso,
|
||||
'LANG_AUTHOR' => $lang_entries['lang_author'],
|
||||
try
|
||||
{
|
||||
$lang_cfg = $language_helper->get_language_data_from_composer_file("{$phpbb_root_path}language/$lang_iso/composer.json");
|
||||
}
|
||||
catch (\DomainException $e)
|
||||
{
|
||||
trigger_error($user->lang['LANGUAGE_PACK_NOT_EXIST'] . adm_back_link($this->u_action), E_USER_WARNING);
|
||||
}
|
||||
|
||||
$template->assign_vars(array(
|
||||
'S_DETAILS' => true,
|
||||
'U_ACTION' => $this->u_action . "&action=details&id=$lang_id",
|
||||
'U_BACK' => $this->u_action,
|
||||
|
||||
'LANG_LOCAL_NAME' => $lang_entries['lang_local_name'],
|
||||
'LANG_ENGLISH_NAME' => $lang_entries['lang_english_name'],
|
||||
'LANG_ISO' => $lang_iso,
|
||||
'LANG_VERSION' => $lang_cfg['version'],
|
||||
'LANG_PHPBB_VERSION' => $lang_cfg['phpbb_version'],
|
||||
'LANG_AUTHOR' => $lang_entries['lang_author'],
|
||||
'L_MISSING_FILES' => $user->lang('THOSE_MISSING_LANG_FILES', $lang_entries['lang_local_name']),
|
||||
'L_MISSING_VARS_EXPLAIN' => $user->lang('THOSE_MISSING_LANG_VARIABLES', $lang_entries['lang_local_name']),
|
||||
));
|
||||
|
|
|
@ -462,7 +462,7 @@ class acp_styles
|
|||
}
|
||||
|
||||
// Read style configuration file
|
||||
$style_cfg = $this->read_style_cfg($style['style_path']);
|
||||
$style_cfg = $this->read_style_composer_file($style['style_path']);
|
||||
|
||||
// Find all available parent styles
|
||||
$list = $this->find_possible_parents($styles, $id);
|
||||
|
@ -611,13 +611,12 @@ class acp_styles
|
|||
'STYLE_ID' => $style['style_id'],
|
||||
'STYLE_NAME' => htmlspecialchars($style['style_name'], ENT_COMPAT),
|
||||
'STYLE_PATH' => htmlspecialchars($style['style_path'], ENT_COMPAT),
|
||||
'STYLE_VERSION' => htmlspecialchars($style_cfg['style_version'], ENT_COMPAT),
|
||||
'STYLE_VERSION' => htmlspecialchars($style_cfg['version'], ENT_COMPAT),
|
||||
'STYLE_COPYRIGHT' => strip_tags($style['style_copyright']),
|
||||
'STYLE_PARENT' => $style['style_parent_id'],
|
||||
'S_STYLE_ACTIVE' => $style['style_active'],
|
||||
'S_STYLE_DEFAULT' => ($style['style_id'] == $this->default_style)
|
||||
)
|
||||
);
|
||||
));
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -985,7 +984,7 @@ class acp_styles
|
|||
'STYLE_ID' => $style['style_id'],
|
||||
'STYLE_NAME' => htmlspecialchars($style['style_name'], ENT_COMPAT),
|
||||
'STYLE_VERSION' => $style_cfg['style_version'] ?? '-',
|
||||
'STYLE_PHPBB_VERSION' => $style_cfg['phpbb_version'],
|
||||
'STYLE_PHPBB_VERSION' => $this->read_style_composer_file($style['style_path'])['extra']['phpbb-version'],
|
||||
'STYLE_PATH' => htmlspecialchars($style['style_path'], ENT_COMPAT),
|
||||
'STYLE_COPYRIGHT' => strip_tags($style['style_copyright']),
|
||||
'STYLE_ACTIVE' => $style['style_active'],
|
||||
|
|
|
@ -101,10 +101,12 @@ class language_file_helper
|
|||
}
|
||||
|
||||
return array(
|
||||
'iso' => $data['extra']['language-iso'],
|
||||
'name' => $data['extra']['english-name'],
|
||||
'local_name' => $data['extra']['local-name'],
|
||||
'author' => implode(', ', $authors),
|
||||
'iso' => $data['extra']['language-iso'],
|
||||
'name' => $data['extra']['english-name'],
|
||||
'local_name' => $data['extra']['local-name'],
|
||||
'author' => implode(', ', $authors),
|
||||
'version' => $data['version'],
|
||||
'phpbb_version' => $data['extra']['phpbb-version'],
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue