From 0562c7d299ea97c0a27163bfb217d2fb2117bf89 Mon Sep 17 00:00:00 2001 From: Deltacms Date: Sun, 11 Jun 2023 16:55:49 +0200 Subject: [PATCH] menu burger mises au point --- CHANGES.md | 15 ++++- core/core.js.php | 37 ++++++++++- core/core.php | 117 ++++++++++++++++------------------- core/include/update.inc.php | 18 ++++++ core/layout/common.css | 8 +-- core/layout/main.php | 2 +- core/layout/mediaqueries.css | 13 +++- core/module/theme/theme.php | 2 +- 8 files changed, 137 insertions(+), 75 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 000418e..02953e6 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -4,12 +4,23 @@ - Modifications : - Une troisième langue d'administration est disponible : espagnol / castillan, - Thème / Menu : le menu en petit écran (burger) dispose maintenant de ses propres paramètres, + - Edition de page / emplacement dans le menu : une page désactivée est signalée par le curseur 'not-allowed' en grand écran et par son nom barré en petit écran, - Nouveaux gabarits pour l'éditeur Tinymce : accordéon à 3 et 4 paragraphes, - - Statislite 4.7 : comptage des liens cliqués (ils doivent posséder la class="download-link" ). + - Statislite 4.8 : comptage des liens cliqués (ils doivent posséder la class="download-link" ). - Corrections : + - Thème / header : erreur qui permettait l'affichage de la banière sur toutes les pages même si 'Bannière visible uniquement sur la page d'accueil' était cochée - Statislite / configuration : erreur qui effaçait l'information 'configuration validée', - Slider 4.8 / Configuration : les liens sur les images étaient modifiés au changement de l'ordre des pages. +## Version 4.4.09 de Deltacms +- Corrections : + - Statislite / configuration : erreur qui effaçait l'information 'configuration validée', + - Thème / bannière : bannière sur page d'accueil seulement, correction. + +## Version 4.4.08 de Deltacms +- Correction : + - Thème / bannière : perte de contrôle du thème si la case 'Masquer la bannière en écran réduit' était décochée. + ## Version 4.4.07 de Deltacms - Modifications : - Thème / Gestion : possibilité de saisir un nom lors de la sauvegarde ou de l'export d'un thème, @@ -283,6 +294,6 @@ - Export de théme, sauvegarde des images de la bannière personnalisée - Import de thème, modification du nom des fichiers importés pour éviter l'écrasement des fichiers de même nom. -Deltacms a été créé à partir de la version 11.2.00.24 de ZwiiCMS +Deltacms a été créé à partir de la version 11.2.00.24 de ZwiiCMS, les versions 1.x.xx et 2.x.xx de Deltacms n'ont pas été distribuées. diff --git a/core/core.js.php b/core/core.js.php index c451fca..1385e83 100644 --- a/core/core.js.php +++ b/core/core.js.php @@ -598,14 +598,18 @@ $(document).ready(function(){ }); - /* Affichage des items du sous-menu - * après appui sur l'icône down + /* Affichage / masquage des items du sous-menu + * après appui sur l'icône plus / minus + * substitution des icônes down, plus, minus */ if($(window).width() < 800) { + if( $("nav #menu ul li span").hasClass('zwiico-down') ) { + $("nav #menu ul li span").removeClass('zwiico-down').addClass('zwiico-plus'); + } $("nav #menu ul li span").click(function() { // id de la page parent var parentId = $(this).parents().attr("id"); - var select = "nav li ul#"+parentId; + var select = "ul#_"+parentId+".navSub"; if( $(select).css("z-index") === "-1" ) { $(select).css("z-index","1"); $(select).css("opacity","1"); @@ -616,7 +620,34 @@ $(document).ready(function(){ $(select).css("opacity","0"); $(select).css("position","absolute"); } + // Modification de l'icône plus ou minus + var select = "nav #menu ul li #" + parentId + " span"; + if ( $(select).hasClass('zwiico-plus') ) { + $(select).removeClass('zwiico-plus').addClass('zwiico-minus'); + } + else { + $(select).removeClass('zwiico-minus').addClass('zwiico-plus'); + }; }); + } else { + if( $("nav #menu ul li span").hasClass('zwiico-plus') ) { + $("nav #menu ul li span").removeClass('zwiico-plus').addClass('zwiico-down'); + } } + /* Suppression du décalage vertical de la bannière en petit écran + * si menu burger fixe et bannière dans le site et bannière visible + */ + if($(window).width() < 800) { + getData(['theme','menu', 'burgerFixed'])=== true && $this->getData(['theme','header', 'position'])=== 'site' && $this->getData(['theme','header', 'tinyHidden'])=== false && ( $this->getData(['theme','header', 'homePageOnly'])=== false || $this->getUrl(0) === $this->getData(['locale','homePageId']) ) ){ ?> + $("#site.container").css("padding-top","0"); + + } + + /* + * Lien vers une page ou une sous-page désactivée en petit écran + */ + if($(window).width() < 800) { + $("a.disabled-link").css('text-decoration', 'line-through'); + } }); diff --git a/core/core.php b/core/core.php index 8df78f9..7430c56 100644 --- a/core/core.php +++ b/core/core.php @@ -1219,7 +1219,7 @@ class common { $item .= $this->getInput('DELTA_COOKIE_CONSENT') !== 'true' ? '>' : ' class="displayNone">'; // Image titre et bouton de fermeture $item .= '
'; - $item .= '
'; + $item .= '
'; $item .= '
'.$this->getData(['locale', 'cookies', 'cookiesTitleText']) . '
'; $item .= '
'. template::ico('cancel') .'
'; $item .= '
'; @@ -1385,7 +1385,7 @@ class common { ) ) { - echo ''; + echo ''; } } @@ -1755,12 +1755,12 @@ class common { echo '
' . $this->getData(['locale', 'title']) . '
'; break; case 'oneIcon' : - echo '
'; + echo '
'; echo '
'; break; case 'twoIcon' : - echo '
'; - echo '
'; + echo '
'; + echo '
'; break; }?>
@@ -1781,44 +1781,41 @@ class common { $targetBlank = $this->getData(['page', $parentPageId, 'targetBlank']) ? ' target="_blank"' : ''; // Mise en page de l'item $itemsLeft .= '
  • '; - if ( ( $this->getData(['page',$parentPageId,'disable']) === true - AND $this->getUser('password') !== $this->getInput('DELTA_USER_PASSWORD') - ) OR ( - $this->getData(['page',$parentPageId,'disable']) === true - AND $this->getUser('password') === $this->getInput('DELTA_USER_PASSWORD') - AND $this->getUser('group') < self::GROUP_EDITOR - ) - ){ + if ( ( $this->getData(['page',$parentPageId,'disable']) === true AND $this->getUser('password') !== $this->getInput('DELTA_USER_PASSWORD')) + OR ( $this->getData(['page',$parentPageId,'disable']) === true AND $this->getUser('password') === $this->getInput('DELTA_USER_PASSWORD')AND $this->getUser('group') < self::GROUP_EDITOR )) + { $pageUrl = ($this->getData(['locale', 'homePageId']) === $this->getUrl(0)) ? helper::baseUrl(false) : helper::baseUrl() . $this->getUrl(0); - $itemsLeft .= '
    '; + $itemsLeft .= '
    '; } else { $pageUrl = ($this->getData(['locale', 'homePageId']) === $parentPageId) ? helper::baseUrl(false) : helper::baseUrl() . $parentPageId; - $itemsLeft .= '
    '; + $itemsLeft .= '
    '; } $fileLogo = './site/file/source/'. $this->getData(['page', $parentPageId, 'iconUrl']); switch ($this->getData(['page', $parentPageId, 'typeMenu'])) { case '' : - $itemsLeft .= $this->getData(['page', $parentPageId, 'shortTitle']); - break; - case 'text' : - $itemsLeft .= $this->getData(['page', $parentPageId, 'shortTitle']); - break; - case 'icon' : - if ($this->getData(['page', $parentPageId, 'iconUrl']) != "") { - $itemsLeft .= ''.$this->getData(['page', $parentPageId, 'shortTitle']).''; - } else { - $itemsLeft .= $this->getData(['page', $parentPageId, 'shortTitle']); - } - break; - case 'icontitle' : - if ($this->getData(['page', $parentPageId, 'iconUrl']) != "") { - $itemsLeft .= ''.$this->getData(['page', $parentPageId, 'titlshortTitlee']).''; - } else { - $itemsLeft .= $this->getData(['page', $parentPageId, 'shortTitle']); - } + $itemsLeft .= $this->getData(['page', $parentPageId, 'shortTitle']); break; - } + case 'text' : + $itemsLeft .= $this->getData(['page', $parentPageId, 'shortTitle']); + break; + case 'icon' : + if ($this->getData(['page', $parentPageId, 'iconUrl']) != "") { + $itemsLeft .= ''.$this->getData(['page', $parentPageId, 'shortTitle']).''; + } else { + $itemsLeft .= $this->getData(['page', $parentPageId, 'shortTitle']); + } + break; + case 'icontitle' : + if ($this->getData(['page', $parentPageId, 'iconUrl']) != "") { + $itemsLeft .= ''.$this->getData(['page', $parentPageId, 'titlshortTitlee']).''; + } else { + $itemsLeft .= $this->getData(['page', $parentPageId, 'shortTitle']); + } + break; + } + $itemsLeft .= ''; + $itemsLeft .= '
    '; // Cas où les pages enfants enfant sont toutes masquées dans le menu // ne pas afficher de symbole lorsqu'il n'y a rien à afficher $totalChild = 0; @@ -1826,13 +1823,8 @@ class common { foreach($childrenPageIds as $childKey) { $totalChild += 1; } - $itemsLeft .= ''; - $itemsLeft .= '
    '; - if($childrenPageIds && $disableChild !== $totalChild && - $this->getdata(['page',$parentPageId,'hideMenuChildren']) === false) { - $itemsLeft .= '
    '; + if($childrenPageIds && $disableChild !== $totalChild && $this->getdata(['page',$parentPageId,'hideMenuChildren']) === false) { $itemsLeft .= template::ico('down', 'left'); - $itemsLeft .= '
    '; } // ------------------------------------------------ $itemsLeft .= '
    '; @@ -1841,7 +1833,7 @@ class common { empty($childrenPageIds)) { continue; } - $itemsLeft .= '
    '; @@ -2044,18 +2034,18 @@ class common { */ public function showMetaTitle() { echo '' . $this->output['metaTitle'] . '' . PHP_EOL; - echo '' . PHP_EOL; - echo '' . PHP_EOL; + echo '' . PHP_EOL; + echo '' . PHP_EOL; } /** * Affiche les balises meta property propres à Facebook */ public function showMetaPropertyFacebook() { - echo '' . PHP_EOL; - echo '' . PHP_EOL; - echo '' . PHP_EOL; - echo '' . PHP_EOL; + echo '' . PHP_EOL; + echo '' . PHP_EOL; + echo '' . PHP_EOL; + echo '' . PHP_EOL; } /** @@ -2235,7 +2225,7 @@ class common { if( $this->getUrl(0) !== 'theme' ){ if( $this->getUrl(0) !== $this->getData(['locale', 'homePageId' ]) && $this->getData(['theme','header','homePageOnly']) === true) $homePageOnly = true; } - $headerClass = ($this->getData(['theme', 'header', 'position']) === 'hide' || $homePageOnly === true) ? 'displayNone' : ''; + $headerClass = ($this->getData(['theme', 'header', 'position']) === 'hide' || $homePageOnly === true) ? 'displayNone ' : ''; $headerClass .= $this->getData(['theme', 'header', 'tinyHidden']) ? ' bannerDisplay ' : ''; switch ($position){ case 'body' : @@ -2302,7 +2292,7 @@ class common { } else { $heightMod = $size[1] * ( $wclient / $size[0]); $replace = '
  • '; } } @@ -2621,6 +2611,9 @@ class core extends common { $css .= $this->getData(['theme', 'site', 'width']) === '75vw' ? '.button, button{font-size:0.8em;}' : ''; + if( $this->getData([ 'theme', 'menu', 'burgerFixed']) === true) { + $css .= '@media screen and (max-width: 799px) { #site.container { padding-top: 60px; } }'; + } $css .= '#site{background-color:' . $this->getData(['theme', 'site', 'backgroundColor']) . ';border-radius:' . $this->getData(['theme', 'site', 'radius']) . ';box-shadow:' . $this->getData(['theme', 'site', 'shadow']) . ' #212223;}'; $colors = helper::colorVariants($this->getData(['theme', 'button', 'backgroundColor'])); $css .= '.speechBubble,.button,.button:hover,button[type=\'submit\'],.pagination a,.pagination a:hover,input[type=\'checkbox\']:checked + label:before,input[type=\'radio\']:checked + label:before,.helpContent{background-color:' . $colors['normal'] . ';color:' . $colors['text'] . '}'; diff --git a/core/include/update.inc.php b/core/include/update.inc.php index d912d13..f0f2ee7 100644 --- a/core/include/update.inc.php +++ b/core/include/update.inc.php @@ -126,6 +126,24 @@ if ($this->getData(['core', 'dataVersion']) < 4407) { } if ($this->getData(['core', 'dataVersion']) < 4501) { // Mise à jour + if( $this->getData(['theme', 'menu', 'burgerContent' ]) === 'logo') $this->setData(['theme', 'menu', 'burgerContent', 'oneIcon' ]); + $this->setData(['theme', 'menu', 'burgerFixed', $this->getData(['theme', 'menu', 'fixed' ]) ]); + $this->setData(['theme', 'menu', 'burgerBannerColor', $this->getData(['theme', 'menu', 'backgroundColor' ]) ]); + $this->setData(['theme', 'menu', 'burgerIconBgColor', $this->getData(['theme', 'menu', 'backgroundColor' ]) ]); + $this->setData(['theme', 'menu', 'burgerIconColor', $this->getData(['theme', 'menu', 'textColor' ]) ]); + $this->setData(['theme', 'menu', 'burgerTextMenuColor', $this->getData(['theme', 'menu', 'textColor' ]) ]); + $this->setData(['theme', 'menu', 'burgerActiveTextColor', $this->getData(['theme', 'menu', 'activeTextColor' ]) ]); + $this->setData(['theme', 'menu', 'burgerBackgroundColor', $this->getData(['theme', 'menu', 'backgroundColor' ]) ]); + $this->setData(['theme', 'menu', 'burgerBackgroundColorSub', $this->getData(['theme', 'menu', 'backgroundColorSub' ]) ]); + $this->setData(['theme', 'menu', 'burgerActiveColorAuto', $this->getData(['theme', 'menu', 'activeColorAuto' ]) ]); + $this->setData(['theme', 'menu', 'burgerActiveColor', $this->getData(['theme', 'menu', 'activeColor' ]) ]); + $this->setData(['theme', 'menu', 'burgerIconLink1', '' ]); + $this->setData(['theme', 'menu', 'burgerIconLink2', '' ]); + $this->setData(['theme', 'menu', 'burgerIcon1', $this->getData(['theme', 'menu','burgerLogo']) ]); + $this->setData(['theme', 'menu', 'burgerIcon2', '' ]); + $this->deleteData(['theme', 'menu', 'burgerLogo']); + $this->deleteData(['theme', 'menu', 'heightLogo']); + $this->deleteData(['theme', 'menu', 'widthLogo']); $this->setData(['core', 'dataVersion', 4501]); } ?> diff --git a/core/layout/common.css b/core/layout/common.css index 3813e7b..ea82b7b 100644 --- a/core/layout/common.css +++ b/core/layout/common.css @@ -24,6 +24,10 @@ a:active { a.headertitle { display: block; } +/* lien vers une page désactivée*/ +a.disabled-link{ + cursor:not-allowed; +} /* Titres */ h1 { font-size: 1.8em; @@ -325,10 +329,6 @@ nav li ul li { nav .navSub a { text-align: left; } -nav li:hover ul { - z-index: 8; - opacity: 1; -} nav a { display: inherit; transition: background 0.3s ease-out; diff --git a/core/layout/main.php b/core/layout/main.php index e4266f3..080363f 100644 --- a/core/layout/main.php +++ b/core/layout/main.php @@ -87,7 +87,7 @@ else { echo ''; } // fin de la div main_screenshot et bouton screenshot if( isset($_SESSION['screenshot'] ) && $_SESSION['screenshot'] === 'on' ){ ?>
    core/vendor/screenshot/appareil_photo.png" width="100px">
    diff --git a/core/layout/mediaqueries.css b/core/layout/mediaqueries.css index 3844af4..cd125c5 100644 --- a/core/layout/mediaqueries.css +++ b/core/layout/mediaqueries.css @@ -24,6 +24,10 @@ nav #menu { display: block; } + nav li:hover ul { + z-index: 8; + opacity: 1; + } /* Barre de navigation fixe quand le menu est en-dehors du site et fixe*/ #navfixedlogout { position: sticky; @@ -214,7 +218,8 @@ display: none; text-align: left; width: 100%; - height: 80vh; + height: auto; + max-height: 80vh; float: left; overflow-x: hidden; overflow-y: auto; @@ -239,7 +244,8 @@ width:100%; } .navfixedburgerconnected #menu, .navburgerconnected #menu{ - height: 60vh; + height: auto; + max-height: 60vh; } .navfixedburgerconnected #menu a, .navfixedburgerlogout #menu a{ padding: 10px 10px; @@ -252,6 +258,9 @@ font-size: 1.5em; } /* Position du bloc dans le site sur les petits écrans */ + nav ul li span.zwiico-margin-left{ + padding-left: 30px; + } .smallScreenFlags { display: inline-block; position: relative; diff --git a/core/module/theme/theme.php b/core/module/theme/theme.php index e6115d8..d4fc931 100644 --- a/core/module/theme/theme.php +++ b/core/module/theme/theme.php @@ -1068,7 +1068,7 @@ class theme extends common { $swiperContent .= '
    '; } foreach($imageFile as $value ) { - $swiperContent .= '
    '; + $swiperContent .= '
    '; } $swiperContent .= '
    '; $swiperContent .= '