Merge branch '11100-tiny' into 11100-newmain

This commit is contained in:
Fred Tempez 2021-10-26 09:45:17 +02:00
commit bec7c69058
8 changed files with 67 additions and 22 deletions

View File

@ -661,5 +661,13 @@ if ($this->getData(['core', 'dataVersion']) < 11100) {
// Anonymat des adresses iP de la journalisation // Anonymat des adresses iP de la journalisation
$this->setData(['config', 'connect', 'anonymousIp', 2 ]); $this->setData(['config', 'connect', 'anonymousIp', 2 ]);
// Nouvelles options de contenu pour les écrans réduits
if ($this->getData(['theme', 'menu', 'burgerTitle'])) {
$this->setData(['theme', 'menu', 'burgerContent', 'title']);
} else {
$this->setData(['theme', 'menu', 'burgerContent', 'none']);
}
$this->setData(['theme', 'menu', 'burgerLogo', '']);
$this->setData(['core', 'dataVersion', 11100]); $this->setData(['core', 'dataVersion', 11100]);
} }

View File

@ -48,7 +48,8 @@
?> ?>
<!-- Menu Burger --> <!-- Menu Burger -->
<div id="toggle"> <div id="toggle">
<?php echo $this->getData(['theme','menu','burgerTitle']) ? '<div class="notranslate" id="burgerText">' . $this->getData(['locale', 'title']) . '</div>' : '' ;?> <?php echo $this->getData(['theme','menu','burgerContent']) === 'title' ? '<div class="notranslate" id="burgerText">' . $this->getData(['locale', 'title']) . '</div>' : '' ;?>
<?php echo $this->getData(['theme','menu','burgerContent']) === 'logo' ? '<div class="notranslate" id="burgerLogo"><img src="'.helper::baseUrl(false).self::FILE_DIR.'source/'. $this->getData(['theme', 'menu', 'burgerLogo']) .'"></div>' : '' ;?>
<?php echo template::ico('menu',null,null,'2em'); ?></div> <?php echo template::ico('menu',null,null,'2em'); ?></div>
<div id="menu" <?php echo $this->getData(['theme', 'menu', 'position']) === 'top' ? 'class="container-large"' : 'class="container"'; ?> > <div id="menu" <?php echo $this->getData(['theme', 'menu', 'position']) === 'top' ? 'class="container-large"' : 'class="container"'; ?> >
<?php $this->showMenu(); ?> <?php $this->showMenu(); ?>
@ -81,7 +82,8 @@
<nav> <nav>
<div id="toggle"> <div id="toggle">
<?php echo $this->getData(['theme','menu','burgerTitle']) ? '<div class="notranslate" id="burgerText">' . $this->getData(['locale', 'title']) . '</div>' : ''; ?> <?php echo $this->getData(['theme','menu','burgerContent']) === 'title' ? '<div class="notranslate" id="burgerText">' . $this->getData(['locale', 'title']) . '</div>' : '' ;?>
<?php echo $this->getData(['theme','menu','burgerContent']) === 'logo' ? '<div class="notranslate" id="burgerLogo"><img src="'.helper::baseUrl(false).self::FILE_DIR.'source/'. $this->getData(['theme', 'menu', 'burgerLogo']) .'"></div>' : '' ;?>
<?php echo template::ico('menu',null,null,'2em'); ?></div> <?php echo template::ico('menu',null,null,'2em'); ?></div>
<div id="menu" class="container"><?php $this->showMenu(); ?></div> <div id="menu" class="container"><?php $this->showMenu(); ?></div>
</nav> </nav>
@ -93,7 +95,8 @@
<!-- Menu dans le site avant la bannière --> <!-- Menu dans le site avant la bannière -->
<nav> <nav>
<div id="toggle"> <div id="toggle">
<?php echo $this->getData(['theme','menu','burgerTitle']) ? '<div class="notranslate" id="burgerText">' . $this->getData(['locale', 'title']) . '</div>' : ''; ?> <?php echo $this->getData(['theme','menu','burgerContent']) === 'title' ? '<div class="notranslate" id="burgerText">' . $this->getData(['locale', 'title']) . '</div>' : '' ;?>
<?php echo $this->getData(['theme','menu','burgerContent']) === 'logo' ? '<div class="notranslate" id="burgerLogo"><img src="'.helper::baseUrl(false).self::FILE_DIR.'source/'. $this->getData(['theme', 'menu', 'burgerLogo']) .'"></div>' : '' ;?>
<?php echo template::ico('menu',null,null,'2em'); ?></div> <?php echo template::ico('menu',null,null,'2em'); ?></div>
<div id="menu" class="container"><?php $this->showMenu(); ?></div> <div id="menu" class="container"><?php $this->showMenu(); ?></div>
</nav> </nav>
@ -134,14 +137,15 @@
$this->getData(['theme', 'menu', 'position']) === 'hide' $this->getData(['theme', 'menu', 'position']) === 'hide'
AND $this->getUrl(0) === 'theme' AND $this->getUrl(0) === 'theme'
) )
): ?> ): ?>
<!-- Menu dans le site après la bannière --> <!-- Menu dans le site après la bannière -->
<nav <?php echo $this->getData(['theme', 'menu', 'position']) === 'hide' ? 'class="displayNone"' : ''; ?>> <nav <?php if($this->getData(['theme', 'menu', 'position']) === 'hide'): ?>class="displayNone"<?php endif; ?>>
<div id="toggle"> <div id="toggle">
<?php echo $this->getData(['theme','menu','burgerTitle']) ? '<div class="notranslate" id="burgerText">' . $this->getData(['locale', 'title']) . '</div>' : ''; ?> <?php echo $this->getData(['theme','menu','burgerContent']) === 'title' ? '<div class="notranslate" id="burgerText">' . $this->getData(['locale', 'title']) . '</div>' : '' ;?>
<?php echo template::ico('menu',null,null,'2em'); ?></div> <?php echo $this->getData(['theme','menu','burgerContent']) === 'logo' ? '<div class="notranslate" id="burgerLogo"><img src="'.helper::baseUrl(false).self::FILE_DIR.'source/'. $this->getData(['theme', 'menu', 'burgerLogo']) .'"></div>' : '' ;?>
<div id="menu" class="container"><?php $this->showMenu(); ?></div> <?php echo template::ico('menu',null,null,'2em'); ?></div>
</nav> <div id="menu" class="container"><?php $this->showMenu(); ?></div>
</nav>
<?php endif; ?> <?php endif; ?>
<!-- Corps de page --> <!-- Corps de page -->

View File

@ -175,8 +175,9 @@ class init extends common {
'activeColor' => 'rgba(255, 255, 255, 1)', 'activeColor' => 'rgba(255, 255, 255, 1)',
'activeTextColor' => 'rgba(255, 255, 255, 1)', 'activeTextColor' => 'rgba(255, 255, 255, 1)',
'radius' => '0px', 'radius' => '0px',
'burgerTitle' => true, 'memberBar' => true,
'memberBar' => true 'burgerLogo' => '',
'burgerContent' => 'title'
], ],
'site' => [ 'site' => [
'backgroundColor' => 'rgba(255, 255, 255, 1)', 'backgroundColor' => 'rgba(255, 255, 255, 1)',

View File

@ -239,6 +239,11 @@ class theme extends common {
'3' => 'Trois colonnes : 1/3 - 1/3 - 1/3', '3' => 'Trois colonnes : 1/3 - 1/3 - 1/3',
'4' => 'Trois lignes superposées' '4' => 'Trois lignes superposées'
]; ];
public static $burgerContent = [
'none' => 'Aucun',
'title' => 'Titre du site',
'logo' => 'Logo du site'
];
// Variable pour construire la liste des pages du site // Variable pour construire la liste des pages du site
public static $pagesList = []; public static $pagesList = [];
@ -511,7 +516,9 @@ class theme extends common {
'activeTextColor' => $this->getInput('themeMenuActiveTextColor'), 'activeTextColor' => $this->getInput('themeMenuActiveTextColor'),
'radius' => $this->getInput('themeMenuRadius'), 'radius' => $this->getInput('themeMenuRadius'),
'burgerTitle' => $this->getInput('themeMenuBurgerTitle', helper::FILTER_BOOLEAN), 'burgerTitle' => $this->getInput('themeMenuBurgerTitle', helper::FILTER_BOOLEAN),
'memberBar' => $this->getInput('themeMenuMemberBar', helper::FILTER_BOOLEAN) 'memberBar' => $this->getInput('themeMenuMemberBar', helper::FILTER_BOOLEAN),
'burgerLogo' => $this->getInput('themeMenuBurgerLogo'),
'burgerContent' => $this->getInput('themeMenuBurgerContent')
]]); ]]);
// Valeurs en sortie // Valeurs en sortie
$this->addOutput([ $this->addOutput([

View File

@ -79,7 +79,7 @@ $("input, select").on("change", function() {
) { ) {
css += 'nav{padding:0 10px;}'; css += 'nav{padding:0 10px;}';
} }
// Position du menu // Position du menu
switch($("#themeMenuPosition").val()) { switch($("#themeMenuPosition").val()) {
case 'hide': case 'hide':
@ -173,4 +173,15 @@ $("#themeMenuActiveColorAuto").on("change", function() {
} else { } else {
$("#themeMenuActiveColorWrapper").slideDown(); $("#themeMenuActiveColorWrapper").slideDown();
} }
}).trigger("change"); }).trigger("change");
// Affiche / Cache la sélection du logo pour le menu burger
$("#themeMenuBurgerContent").on("change", function() {
console.log( $(this).val());
if($(this).val() === 'logo') {
$("#themeMenuBurgerLogoId").slideDown();
}
else {
$("#themeMenuBurgerLogoId").slideUp();
}
}).trigger("select");

View File

@ -176,24 +176,38 @@
<div class="block"> <div class="block">
<h4>Contenus</h4> <h4>Contenus</h4>
<div class="row"> <div class="row">
<div class="col4"> <div class="col3">
<?php echo template::checkbox('themeMenuLoginLink', true, 'Lien de connexion', [ <?php echo template::checkbox('themeMenuLoginLink', true, 'Lien de connexion', [
'checked' => $this->getData(['theme', 'menu', 'loginLink']) 'checked' => $this->getData(['theme', 'menu', 'loginLink'])
]); ?> ]); ?>
</div> </div>
<div class="col4"> <div class="col3">
<?php echo template::checkbox('themeMenuMemberBar', true, 'Barre de membre', [ <?php echo template::checkbox('themeMenuMemberBar', true, 'Barre de membre', [
'checked' => $this->getData(['theme', 'menu', 'memberBar']), 'checked' => $this->getData(['theme', 'menu', 'memberBar']),
'help' => 'Icônes de gestion de compte et de déconnexion. Uniquement pour les membres connectés' 'help' => 'Icônes de gestion de compte et de déconnexion. Uniquement pour les membres connectés'
]); ?> ]); ?>
</div> </div>
<div class="col4"> <div class="col6">
<?php echo template::checkbox('themeMenuBurgerTitle', true, 'Titre du site dans le menu réduit', [ <?php echo template::select('themeMenuBurgerContent', $module::$burgerContent, [
'checked' => $this->getData(['theme', 'menu', 'burgerTitle']), 'label' => 'Affichage dans le menu burger',
'selected' => $this->getData(['theme', 'menu', 'burgerContent']),
'help' => 'Le menu burger remplace le menu complet lorsque la largeur de l\'écran n\'est pas suffisante.' 'help' => 'Le menu burger remplace le menu complet lorsque la largeur de l\'écran n\'est pas suffisante.'
]); ?> ]); ?>
</div> </div>
</div> </div>
<div class="row">
<div id="themeMenuBurgerLogoId" class="col6 offset6 <?php if( $this->getData(['theme', 'menu', 'burgerContent']) !== 'logo') echo 'displayNone';?>">
<?php
$imageFile = file_exists(self::FILE_DIR.'source/'.$this->getData(['theme', 'menu', 'burgerLogo'])) ?
$this->getData(['theme', 'menu', 'burgerLogo']) : "";
echo template::file('themeMenuBurgerLogo', [
'help' => 'Sélectionner une image de dimensions adaptées',
'label' => 'Logo du menu burger',
'type' => 1,
'value' => $imageFile
]); ?>
</div>
</div>
</div> </div>
</div> </div>
</div> </div>

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB