Drapeaux dans la table

This commit is contained in:
Fred Tempez 2022-09-28 15:13:42 +02:00
parent 7f9f97c6a2
commit 8cf721bfe7
3 changed files with 7 additions and 6 deletions

View File

@ -474,7 +474,7 @@ class template {
/** /**
* Crée un drapeau du site courante * Crée un drapeau du site courante
* @param string $langId Id de la langue à affiche ou selected pour la langue courante * @param string $langId Id de la langue à affiche ou selected pour la langue courante
* @param string $margin Ajoute un margin autour de l'icône (choix : left, right, all) * @param string size en pixels ou en rem
* @return string * @return string
*/ */
public static function flag($langId, $size = 'auto') { public static function flag($langId, $size = 'auto') {
@ -493,11 +493,11 @@ class template {
$lang = 'fr_FR'; $lang = 'fr_FR';
} }
} }
return '<img class="flag" src="' . helper::baseUrl(false) . 'core/vendor/i18n/png/' . $lang . '.png" return '<img class="flag" src="' . helper::baseUrl(false) . 'core/vendor/i18n/png/' . $langId . '.png"
width="' . $size .'" width="' . $size .'"
height="' . $size .'" height="' . $size .'"
title="' . $lang .'" title="' . $langId .'"
alt="(' . $lang . ')"/>'; alt="(' . $langId . ')"/>';
} }
/** /**

View File

@ -128,6 +128,7 @@ class translate extends common {
// tableau des langues installées // tableau des langues installées
if (is_dir(self::DATA_DIR . $keyi18n) ) { if (is_dir(self::DATA_DIR . $keyi18n) ) {
self::$languagesInstalled [] = [ self::$languagesInstalled [] = [
template::flag($keyi18n, '50%') ,
$value . ' (' . $keyi18n . ')' , $value . ' (' . $keyi18n . ')' ,
self::$i18nUI === $keyi18n ? '(langue de l\'interface)' : '', self::$i18nUI === $keyi18n ? '(langue de l\'interface)' : '',
'', '',
@ -209,7 +210,7 @@ class translate extends common {
// Valeurs en sortie // Valeurs en sortie
$this->addOutput([ $this->addOutput([
'redirect' => helper::baseUrl() . $this->getUrl(), 'redirect' => helper::baseUrl() . 'translate',
'notification' => 'Modifications enregistrées', 'notification' => 'Modifications enregistrées',
'state' => true 'state' => true
]); ]);

View File

@ -72,7 +72,7 @@
<div class="row"> <div class="row">
<div class="col12"> <div class="col12">
<?php if($module::$languagesInstalled): ?> <?php if($module::$languagesInstalled): ?>
<?php echo template::table([2, 2, 6, 1, 1], $module::$languagesInstalled, ['Langue', '', '', '', '']); ?> <?php echo template::table([1, 3, 2, 4, 1, 1], $module::$languagesInstalled, ['Langue', '', '', '', '', '']); ?>
<?php endif; ?> <?php endif; ?>
</div> </div>
</div> </div>