mirror of
https://github.com/torrentpier/torrentpier
synced 2025-08-14 18:48:21 -07:00
misc(render_flag): Hide names for specified ($nameIgnoreList
) flags (#1862)
This commit is contained in:
parent
e9920ab598
commit
83e42bc5db
1 changed files with 9 additions and 2 deletions
|
@ -1184,14 +1184,21 @@ function render_flag(string $code, bool $showName = true): string
|
|||
global $lang;
|
||||
static $iconExtension = '.svg';
|
||||
|
||||
$nameIgnoreList = [
|
||||
'WBW',
|
||||
'PACE',
|
||||
'LGBT'
|
||||
];
|
||||
|
||||
if (isset($lang['COUNTRIES'][$code])) {
|
||||
if ($code === '0') {
|
||||
return ''; // No selected
|
||||
} else {
|
||||
$flagIconPath = BB_ROOT . 'styles/images/flags/' . $code . $iconExtension;
|
||||
if (is_file($flagIconPath)) {
|
||||
$countryName = $showName ? ' ' . str_short($lang['COUNTRIES'][$code], 20) : '';
|
||||
return '<span title="' . $lang['COUNTRIES'][$code] . '"><img src="' . $flagIconPath . '" class="poster-flag" alt="' . $code . '">' . $countryName . '</span>';
|
||||
$langName = $lang['COUNTRIES'][$code];
|
||||
$countryName = ($showName && !in_array($code, $nameIgnoreList)) ? ' ' . str_short($langName, 20) : '';
|
||||
return '<span title="' . $langName . '"><img src="' . $flagIconPath . '" class="poster-flag" alt="' . $code . '">' . $countryName . '</span>';
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue