update + files.tar.gz + opérateurs ternaires dans main

This commit is contained in:
fredtempez 2021-10-25 12:52:12 +02:00
parent 1c8aeae41c
commit ddce685a40
7 changed files with 26 additions and 31 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

@ -44,12 +44,8 @@
?> ?>
<!-- Menu Burger --> <!-- Menu Burger -->
<div id="toggle"> <div id="toggle">
<?php if ($this->getData(['theme','menu','burgerContent']) === 'title' ): ?> <?php echo $this->getData(['theme','menu','burgerContent']) === 'title' ? '<div class="notranslate" id="burgerText">' . $this->getData(['locale', 'title']) . '</div>' : '' ;?>
<div class="notranslate" id="burgerText"><?php echo $this->getData(['locale', 'title']);?></div> <?php echo $this->getData(['theme','menu','burgerContent']) === 'logo' ? '<div class="notranslate" id="burgerLogo"><img src="'.helper::baseUrl(0).self::FILE_DIR.'source/'. $this->getData(['theme', 'menu', 'burgerLogo']) .'"></div>' : '' ;?>
<?php endif; ?>
<?php if ($this->getData(['theme','menu','burgerContent']) === 'logo' ): ?>
<div class="notranslate" id="burgerLogo"><?php echo '<img src="'.helper::baseUrl(0).self::FILE_DIR.'source/'.$this->getData(['theme', 'menu', 'logoBurger']).'">';?></div>
<?php endif; ?>
<?php echo template::ico('menu',null,null,'2em'); ?></div> <?php echo template::ico('menu',null,null,'2em'); ?></div>
<div id="menu" class=" <div id="menu" class="
<?php if($this->getData(['theme', 'menu', 'position']) === 'top'){echo 'container-large';}else{echo'container';} <?php if($this->getData(['theme', 'menu', 'position']) === 'top'){echo 'container-large';}else{echo'container';}
@ -86,12 +82,8 @@
<!-- Menu dans le fond du site après la bannière --> <!-- Menu dans le fond du site après la bannière -->
<nav> <nav>
<div id="toggle"> <div id="toggle">
<?php if ($this->getData(['theme','menu','burgerContent']) === 'title' ): ?> <?php echo $this->getData(['theme','menu','burgerContent']) === 'title' ? '<div class="notranslate" id="burgerText">' . $this->getData(['locale', 'title']) . '</div>' : '' ;?>
<div class="notranslate" id="burgerText"><?php echo $this->getData(['locale', 'title']);?></div> <?php echo $this->getData(['theme','menu','burgerContent']) === 'logo' ? '<div class="notranslate" id="burgerLogo"><img src="'.helper::baseUrl(0).self::FILE_DIR.'source/'. $this->getData(['theme', 'menu', 'burgerLogo']) .'"></div>' : '' ;?>
<?php endif; ?>
<?php if ($this->getData(['theme','menu','burgerContent']) === 'logo' ): ?>
<div class="notranslate" id="burgerLogo"><?php echo '<img src="'.helper::baseUrl(0).self::FILE_DIR.'source/'.$this->getData(['theme', 'menu', 'logoBurger']).'">';?></div>
<?php endif; ?>
<?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>
@ -102,12 +94,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 if ($this->getData(['theme','menu','burgerContent']) === 'title' ): ?> <?php echo $this->getData(['theme','menu','burgerContent']) === 'title' ? '<div class="notranslate" id="burgerText">' . $this->getData(['locale', 'title']) . '</div>' : '' ;?>
<div class="notranslate" id="burgerText"><?php echo $this->getData(['locale', 'title']);?></div> <?php echo $this->getData(['theme','menu','burgerContent']) === 'logo' ? '<div class="notranslate" id="burgerLogo"><img src="'.helper::baseUrl(0).self::FILE_DIR.'source/'. $this->getData(['theme', 'menu', 'burgerLogo']) .'"></div>' : '' ;?>
<?php endif; ?>
<?php if ($this->getData(['theme','menu','burgerContent']) === 'logo' ): ?>
<div class="notranslate" id="burgerLogo"><?php echo '<img src="'.helper::baseUrl(0).self::FILE_DIR.'source/'.$this->getData(['theme', 'menu', 'logoBurger']).'">';?></div>
<?php endif; ?>
<?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>
@ -158,7 +146,7 @@
<div class="notranslate" id="burgerText"><?php echo $this->getData(['locale', 'title']);?></div> <div class="notranslate" id="burgerText"><?php echo $this->getData(['locale', 'title']);?></div>
<?php endif; ?> <?php endif; ?>
<?php if ($this->getData(['theme','menu','burgerContent']) === 'logo' ): ?> <?php if ($this->getData(['theme','menu','burgerContent']) === 'logo' ): ?>
<div class="notranslate" id="burgerLogo"><?php echo '<img src="'.helper::baseUrl(0).self::FILE_DIR.'source/'.$this->getData(['theme', 'menu', 'logoBurger']).'">';?></div> <div class="notranslate" id="burgerLogo"><?php echo '<img src="'.helper::baseUrl(0).self::FILE_DIR.'source/'.$this->getData(['theme', 'menu', 'burgerLogo']).'">';?></div>
<?php endif; ?> <?php endif; ?>
<?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>

View File

@ -175,9 +175,8 @@ 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,
'logoBurger' => '', 'burgerLogo' => '',
'burgerContent' => 'title' 'burgerContent' => 'title'
], ],
'site' => [ 'site' => [

View File

@ -240,9 +240,9 @@ class theme extends common {
'4' => 'Trois lignes superposées' '4' => 'Trois lignes superposées'
]; ];
public static $burgerContent = [ public static $burgerContent = [
'no' => 'Aucun', 'none' => 'Aucun',
'title' => 'Titre du site', 'title' => 'Titre du site',
'logo' => 'Logo du site' 'logo' => 'Logo du site'
]; ];
// Variable pour construire la liste des pages du site // Variable pour construire la liste des pages du site
@ -517,7 +517,7 @@ class theme extends common {
'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),
'logoBurger' => $this->getInput('themeMenuLogoBurger'), 'burgerLogo' => $this->getInput('themeMenuBurgerLogo'),
'burgerContent' => $this->getInput('themeMenuBurgerContent') 'burgerContent' => $this->getInput('themeMenuBurgerContent')
]]); ]]);
// Valeurs en sortie // Valeurs en sortie

View File

@ -179,9 +179,9 @@ $("#themeMenuActiveColorAuto").on("change", function() {
$("#themeMenuBurgerContent").on("change", function() { $("#themeMenuBurgerContent").on("change", function() {
console.log( $(this).val()); console.log( $(this).val());
if($(this).val() === 'logo') { if($(this).val() === 'logo') {
$("#themeMenuLogoBurgerId").slideDown(); $("#themeMenuBurgerLogoId").slideDown();
} }
else { else {
$("#themeMenuLogoBurgerId").slideUp(); $("#themeMenuBurgerLogoId").slideUp();
} }
}).trigger("select"); }).trigger("select");

View File

@ -196,11 +196,11 @@
</div> </div>
</div> </div>
<div class="row"> <div class="row">
<div id="themeMenuLogoBurgerId" class="col6 offset6 <?php if( $this->getData(['theme', 'menu', 'burgerContent']) !== 'logo') echo 'displayNone';?>"> <div id="themeMenuBurgerLogoId" class="col6 offset6 <?php if( $this->getData(['theme', 'menu', 'burgerContent']) !== 'logo') echo 'displayNone';?>">
<?php <?php
$imageFile = file_exists(self::FILE_DIR.'source/'.$this->getData(['theme', 'menu', 'logoBurger'])) ? $imageFile = file_exists(self::FILE_DIR.'source/'.$this->getData(['theme', 'menu', 'burgerLogo'])) ?
$this->getData(['theme', 'menu', 'logoBurger']) : ""; $this->getData(['theme', 'menu', 'burgerLogo']) : "";
echo template::file('themeMenuLogoBurger', [ echo template::file('themeMenuBurgerLogo', [
'help' => 'Sélectionner une image de dimensions adaptées', 'help' => 'Sélectionner une image de dimensions adaptées',
'label' => 'Logo du menu burger', 'label' => 'Logo du menu burger',
'type' => 1, 'type' => 1,