Browse Source

Merge branch '11100-tiny' into 11100-newmain

master
Fred Tempez 10 months ago
parent
commit
bec7c69058
  1. 8
      core/include/update.inc.php
  2. 26
      core/layout/main.php
  3. 5
      core/module/install/ressource/defaultdata.php
  4. BIN
      core/module/install/ressource/files.tar.gz
  5. 9
      core/module/theme/theme.php
  6. 15
      core/module/theme/view/menu/menu.js.php
  7. 26
      core/module/theme/view/menu/menu.php
  8. BIN
      site/file/source/logo_zwii.png

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

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

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

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

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

Binary file not shown.

9
core/module/theme/theme.php

@ -239,6 +239,11 @@ class theme extends common {
'3' => 'Trois colonnes : 1/3 - 1/3 - 1/3',
'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
public static $pagesList = [];
@ -511,7 +516,9 @@ class theme extends common {
'activeTextColor' => $this->getInput('themeMenuActiveTextColor'),
'radius' => $this->getInput('themeMenuRadius'),
'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
$this->addOutput([

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

@ -79,7 +79,7 @@ $("input, select").on("change", function() {
) {
css += 'nav{padding:0 10px;}';
}
// Position du menu
switch($("#themeMenuPosition").val()) {
case 'hide':
@ -173,4 +173,15 @@ $("#themeMenuActiveColorAuto").on("change", function() {
} else {
$("#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");

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

@ -176,24 +176,38 @@
<div class="block">
<h4>Contenus</h4>
<div class="row">
<div class="col4">
<div class="col3">
<?php echo template::checkbox('themeMenuLoginLink', true, 'Lien de connexion', [
'checked' => $this->getData(['theme', 'menu', 'loginLink'])
]); ?>
</div>
<div class="col4">
<div class="col3">
<?php echo template::checkbox('themeMenuMemberBar', true, 'Barre de membre', [
'checked' => $this->getData(['theme', 'menu', 'memberBar']),
'help' => 'Icônes de gestion de compte et de déconnexion. Uniquement pour les membres connectés'
]); ?>
</div>
<div class="col4">
<?php echo template::checkbox('themeMenuBurgerTitle', true, 'Titre du site dans le menu réduit', [
'checked' => $this->getData(['theme', 'menu', 'burgerTitle']),
</div>
<div class="col6">
<?php echo template::select('themeMenuBurgerContent', $module::$burgerContent, [
'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.'
]); ?>
</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>

BIN
site/file/source/logo_zwii.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 6.0 KiB

Loading…
Cancel
Save