From ca067121f922751393e64b666ea34384791f8214 Mon Sep 17 00:00:00 2001 From: fredtempez Date: Sat, 2 Oct 2021 14:15:27 +0200 Subject: [PATCH] drapeau plutot que du texte --- core/class/template.class.php | 17 +++++++++ core/module/config/view/index/index.php | 16 +++------ core/module/theme/theme.php | 5 +++ core/module/theme/view/footer/footer.php | 45 ++++++++++++++++++++---- 4 files changed, 66 insertions(+), 17 deletions(-) diff --git a/core/class/template.class.php b/core/class/template.class.php index 6eed2096..417526ab 100644 --- a/core/class/template.class.php +++ b/core/class/template.class.php @@ -423,6 +423,23 @@ class template { return ''; } + /** + * Crée un drapeau du site courante + * @param string $margin Ajoute un margin autour de l'icône (choix : left, right, all) + * @param string $size Taille en pixels (default = auto) + * @return string + */ + public static function flag( $size = 'auto') { + if ( isset($_COOKIE['ZWII_I18N_SITE']) + ) { + $lang = $_COOKIE['ZWII_I18N_SITE']; + return '(' . $lang . ')'; + } + } + /** * Crée un label * @param string $for For du label diff --git a/core/module/config/view/index/index.php b/core/module/config/view/index/index.php index 6d2f7bc8..da36e4d3 100644 --- a/core/module/config/view/index/index.php +++ b/core/module/config/view/index/index.php @@ -1,9 +1,3 @@ -
@@ -58,7 +52,7 @@ if ( isset($_COOKIE['ZWII_I18N_SITE']) ) {
'Titre du site '. $i18nSite, + 'label' => 'Titre du site '. template::flag('20px') , 'value' => $this->getData(['locale', 'title']), 'help' => 'Il apparaît dans la barre de titre et les partages sur les réseaux sociaux.' ]); ?> @@ -74,7 +68,7 @@ if ( isset($_COOKIE['ZWII_I18N_SITE']) ) {
'Description du site ' . $i18nSite, + 'label' => 'Description du site ' . template::flag('20px'), 'value' => $this->getData(['locale', 'metaDescription']), 'help' => 'La description d\'une page participe à son référencement, chaque page doit disposer d\'une description différente.' ]); ?> @@ -164,21 +158,21 @@ if ( isset($_COOKIE['ZWII_I18N_SITE']) ) {
'Mentions légales ' . $i18nSite, + 'label' => 'Mentions légales ' . template::flag('20px'), 'placeholder' => 'Mentions légales', 'value' => $this->getData(['locale', 'legalPageLabel']), ]); ?>
'Rechercher ' . $i18nSite, + 'label' => 'Rechercher ' . template::flag('20px'), 'placeholder' => 'Rechercher', 'value' => $this->getData(['locale', 'searchPageLabel']), ]); ?>
'Plan du site ' . $i18nSite, + 'label' => 'Plan du site ' . template::flag('20px'), 'placeholder' => 'Plan du site', 'value' => $this->getData(['locale', 'sitemapPageLabel']), ]); ?> diff --git a/core/module/theme/theme.php b/core/module/theme/theme.php index 792ac6ec..efcb2f68 100644 --- a/core/module/theme/theme.php +++ b/core/module/theme/theme.php @@ -380,6 +380,11 @@ class theme extends common { 'displayMemberBar'=> $this->getInput('themeFooterDisplayMemberBar', helper::FILTER_BOOLEAN), 'template' => $this->getInput('themeFooterTemplate') ]]); + + // Sauvegarder la configuration localisée + $this->setData(['locale','legalPageId', $this->getInput('configLegalPageId')]); + $this->setData(['locale','searchPageId', $this->getInput('configSearchPageId')]); + // Valeurs en sortie $this->addOutput([ 'notification' => 'Modifications enregistrées', diff --git a/core/module/theme/view/footer/footer.php b/core/module/theme/view/footer/footer.php index 9f96f6e3..5840eefb 100644 --- a/core/module/theme/view/footer/footer.php +++ b/core/module/theme/view/footer/footer.php @@ -66,7 +66,7 @@ 'checked' => $this->getData(['theme', 'footer', 'loginLink']), 'help' => 'Pour limiter les tentatives de piratage, enregistrez la page de connexion en favori et désactivez cette option.' ]); ?> -
+
$this->getData(['theme', 'footer', 'displayMemberBar']), @@ -79,24 +79,57 @@

Pages spéciales

+ getData(['page']); + foreach($pages as $page => $pageId) { + if ($this->getData(['page',$page,'block']) === 'bar' || + $this->getData(['page',$page,'disable']) === true) { + unset($pages[$page]); + } + } + $orphans = $this->getData(['page']); + foreach($orphans as $page => $pageId) { + if ($this->getData(['page',$page,'block']) === 'bar' || + $this->getData(['page',$page,'disable']) === true || + $this->getdata(['page',$page, 'position']) !== 0) { + unset($orphans[$page]); + } + } + ?>
-
+
$this->getData(['locale', 'legalPageId']) === 'none' ? false : $this->getData(['theme', 'footer', 'displayLegal']), 'disabled' => $this->getData(['locale', 'legalPageId']) === 'none' ? true : false, 'help' => $this->getData(['locale', 'legalPageId']) === 'none' ? 'Une page contenant les mentions légales n\'est pas définie dans la configuration du site / pages spéciales.' : '' ]); ?>
-
-
-
- + $this->getData(['locale', 'searchPageId']) === 'none' ? false : $this->getData(['theme', 'footer', 'displaySearch']), 'disabled' => $this->getData(['locale', 'searchPageId']) === 'none' ? true : false, 'help' => $this->getData(['locale', 'searchPageId']) === 'none' ? 'Une page contenant un module de recherche n\'est pas définie dans la configuration du site / pages spéciales.' : '' ]); ?>
+
+
+ 'Aucune'] , helper::arrayCollumn($pages, 'title', 'SORT_ASC') ) , [ + 'label' => 'Page Mentions légales ' . template::flag('20px'), + 'selected' => $this->getData(['locale', 'legalPageId']), + 'help' => 'Options identique à la configuration du site', + 'disabled' => true + ]); ?> +
+
+ 'Aucune'] , helper::arrayCollumn($pages, 'title', 'SORT_ASC') ) , [ + 'label' => 'Page Rechercher ' . template::flag('20px'), + 'selected' => $this->getData(['locale', 'searchPageId']), + 'help' => 'Options identique à la configuration du site', + 'disabled' => true + ]); ?> +
+