Browse Source

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

master
fredtempez 8 months ago
parent
commit
ddce685a40
  1. 8
      core/include/update.inc.php
  2. 26
      core/layout/main.php
  3. 3
      core/module/install/ressource/defaultdata.php
  4. BIN
      core/module/install/ressource/files.tar.gz
  5. 8
      core/module/theme/theme.php
  6. 4
      core/module/theme/view/menu/menu.js.php
  7. 8
      core/module/theme/view/menu/menu.php

8
core/include/update.inc.php

@ -661,5 +661,13 @@ if ($this->getData(['core', 'dataVersion']) < 11100) {
// Anonymat des adresses iP de la journalisation
$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]);
}

26
core/layout/main.php

@ -44,12 +44,8 @@
?>
<!-- Menu Burger -->
<div id="toggle">
<?php if ($this->getData(['theme','menu','burgerContent']) === 'title' ): ?>
<div class="notranslate" id="burgerText"><?php echo $this->getData(['locale', 'title']);?></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 $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(0).self::FILE_DIR.'source/'. $this->getData(['theme', 'menu', 'burgerLogo']) .'"></div>' : '' ;?>
<?php echo template::ico('menu',null,null,'2em'); ?></div>
<div id="menu" class="
<?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 -->
<nav>
<div id="toggle">
<?php if ($this->getData(['theme','menu','burgerContent']) === 'title' ): ?>
<div class="notranslate" id="burgerText"><?php echo $this->getData(['locale', 'title']);?></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 $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(0).self::FILE_DIR.'source/'. $this->getData(['theme', 'menu', 'burgerLogo']) .'"></div>' : '' ;?>
<?php echo template::ico('menu',null,null,'2em'); ?></div>
<div id="menu" class="container"><?php $this->showMenu(); ?></div>
</nav>
@ -102,12 +94,8 @@
<!-- Menu dans le site avant la bannière -->
<nav>
<div id="toggle">
<?php if ($this->getData(['theme','menu','burgerContent']) === 'title' ): ?>
<div class="notranslate" id="burgerText"><?php echo $this->getData(['locale', 'title']);?></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 $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(0).self::FILE_DIR.'source/'. $this->getData(['theme', 'menu', 'burgerLogo']) .'"></div>' : '' ;?>
<?php echo template::ico('menu',null,null,'2em'); ?></div>
<div id="menu" class="container"><?php $this->showMenu(); ?></div>
</nav>
@ -158,7 +146,7 @@
<div class="notranslate" id="burgerText"><?php echo $this->getData(['locale', 'title']);?></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>
<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 echo template::ico('menu',null,null,'2em'); ?></div>
<div id="menu" class="container"><?php $this->showMenu(); ?></div>

3
core/module/install/ressource/defaultdata.php

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

BIN
core/module/install/ressource/files.tar.gz

Binary file not shown.

8
core/module/theme/theme.php

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

4
core/module/theme/view/menu/menu.js.php

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

8
core/module/theme/view/menu/menu.php

@ -196,11 +196,11 @@
</div>
</div>
<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
$imageFile = file_exists(self::FILE_DIR.'source/'.$this->getData(['theme', 'menu', 'logoBurger'])) ?
$this->getData(['theme', 'menu', 'logoBurger']) : "";
echo template::file('themeMenuLogoBurger', [
$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,

Loading…
Cancel
Save