From 4d0a09cad0fab77f46a043e51f1624c0a161621d Mon Sep 17 00:00:00 2001 From: fredtempez Date: Mon, 9 Oct 2023 20:32:12 +0200 Subject: [PATCH] admin width size --- CHANGES.md | 1 + core/class/router.class.php | 20 ++++++++++++++++++++ core/module/theme/theme.php | 9 ++++++++- core/module/theme/view/admin/admin.php | 16 +++++++++++----- 4 files changed, 40 insertions(+), 6 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 3d174af0..23668f0e 100755 --- a/CHANGES.md +++ b/CHANGES.md @@ -4,6 +4,7 @@ ### Améliorations - Ajoute des filtres des membres, groupes/profils, prénoms et noms commençant par telle lettre. - Restaure la gestion d'erreur à l'étape 4 de la mise à jour automatique. +- Nouvelles tailles d'écran en pourcentages de 70% à 100% par pas de 5%. ## Version 13.0.04 ### Corrections diff --git a/core/class/router.class.php b/core/class/router.class.php index 7f44091f..90f1e406 100644 --- a/core/class/router.class.php +++ b/core/class/router.class.php @@ -400,6 +400,26 @@ class core extends common $css .= 'p, div, label, select, input, table, span {font-family:' . $fonts[$this->getData(['admin', 'fontText'])] . '}'; $css .= 'body,.row > div {font-size:' . $this->getData(['admin', 'fontSize']) . '}'; $css .= 'body h1, h2, h3, h4 a, h5, h6 {font-family:' . $fonts[$this->getData(['admin', 'fontTitle'])] . ';color:' . $this->getData(['admin', 'colorTitle']) . ';}'; + $css .= '.container {max-width:' . $this->getData(['admin', 'width']) . '}'; + $margin = $this->getData(['theme', 'site', 'margin']) ? '0' : '20px'; + // Marge supplémentaire lorsque le pied de page est fixe + if ( + $this->getData(['theme', 'footer', 'fixed']) === true && + $this->getData(['theme', 'footer', 'position']) === 'body' + ) { + + $marginBottomLarge = ((str_replace('px', '', $this->getData(['theme', 'footer', 'height'])) * 2) + 31) . 'px'; + $marginBottomSmall = ((str_replace('px', '', $this->getData(['theme', 'footer', 'height'])) * 2) + 93) . 'px'; + } else { + $marginBottomSmall = $margin; + $marginBottomLarge = $margin; + } + $css .= $this->getData(['admin', 'width']) === '100%' + ? '@media (min-width: 769px) {#site{margin:0 auto ' . $marginBottomLarge . ' 0 !important;}}@media (max-width: 768px) {#site{margin:0 auto ' . $marginBottomSmall . ' 0 !important;}}#site.light{margin:5% auto !important;} body{margin:0 auto !important;} #bar{margin:0 auto !important;} body > header{margin:0 auto !important;} body > nav {margin: 0 auto !important;} body > footer {margin:0 auto !important;}' + : '@media (min-width: 769px) {#site{margin: ' . $margin . ' auto ' . $marginBottomLarge . ' auto !important;}}@media (max-width: 768px) {#site{margin: ' . $margin . ' auto ' . $marginBottomSmall . ' auto !important;}}#site.light{margin: 5% auto !important;} body{margin:0px 10px;} #bar{margin: 0 -10px;} body > header{margin: 0 -10px;} body > nav {margin: 0 -10px;} body > footer {margin: 0 -10px;} '; + $css .= $this->getData(['admin', 'width']) === '750px' + ? '.button, button{font-size:0.8em;}' + : ''; // TinyMCE $colors = helper::colorVariants($this->getData(['admin', 'colorText'])); diff --git a/core/module/theme/theme.php b/core/module/theme/theme.php index 8ee4e64d..7202be35 100644 --- a/core/module/theme/theme.php +++ b/core/module/theme/theme.php @@ -214,7 +214,13 @@ class theme extends common '750px' => '750 pixels', '960px' => '960 pixels', '1170px' => '1170 pixels', - '100%' => '100%' + '100%' => '100%', + '95%' => '95%', + '90%' => '90%', + '85%' => '85%', + '80%' => '80%', + '75%' => '75%', + '70%' => '70%', ]; public static $headerWide = [ 'auto auto' => 'Automatique', @@ -269,6 +275,7 @@ class theme extends common 'fontTitle' => $this->getInput('adminFontTitle'), 'backgroundBlockColor' => $this->getInput('adminBackGroundBlockColor'), 'borderBlockColor' => $this->getInput('adminBorderBlockColor'), + 'width' => $this->getInput('adminSiteWidth'), ] ]); // Valeurs en sortie diff --git a/core/module/theme/view/admin/admin.php b/core/module/theme/view/admin/admin.php index f7337524..dc4e251b 100644 --- a/core/module/theme/view/admin/admin.php +++ b/core/module/theme/view/admin/admin.php @@ -32,10 +32,16 @@
-

+

-
+
+ 'Largeur', + 'selected' => $this->getData(['admin', 'width']) + ]); ?> +
+
'colorPicker', 'help' => 'Couleur visible en l\'absence d\'une image.
Le curseur horizontal règle le niveau de transparence.', @@ -43,7 +49,7 @@ 'value' => $this->getData(['admin', 'backgroundColor']) ]); ?>
-
+
'colorPicker', 'help' => 'Couleur visible en l\'absence d\'une image.
Le curseur horizontal règle le niveau de transparence.', @@ -51,7 +57,7 @@ 'value' => $this->getData(['admin', 'colorTitle']) ]); ?>
-
+
'colorPicker', 'help' => 'Couleur visible en l\'absence d\'une image.
Le curseur horizontal règle le niveau de transparence.', @@ -77,7 +83,7 @@ 'value' => $this->getData(['admin', 'borderBlockColor']) ]); ?>
-
+
'colorPicker', 'help' => 'Couleur visible en l\'absence d\'une image.
Le curseur horizontal règle le niveau de transparence.',