[9.0.17] footer version number in theme

This commit is contained in:
Fred Tempez 2019-04-09 10:05:38 +02:00
parent 1478fec284
commit 2e965880de
7 changed files with 37 additions and 19 deletions

View File

@ -777,7 +777,7 @@ class common {
} }
// Version 9.0.17 // Version 9.0.17
if($this->getData(['core', 'dataVersion']) < 9017) { if($this->getData(['core', 'dataVersion']) < 9017) {
$this->setData(['config','displayVersion', true ]); $this->setData(['theme','footer','displayVersion', true ]);
$this->setData(['core', 'dataVersion', 9017]); $this->setData(['core', 'dataVersion', 9017]);
$this->SaveData(); $this->SaveData();
} }
@ -1717,11 +1717,11 @@ class layout extends common {
public function showCopyright() { public function showCopyright() {
$items = '<div id="footerCopyright">'; $items = '<div id="footerCopyright">';
$items .= '<span id="footerFont">Motorisé&nbsp;par&nbsp;<a href="http://zwiicms.com/" onclick="window.open(this.href);return false" data-tippy-content="Zwii CMS sans base de données, très léger et performant">Zwii'; $items .= '<span id="footerFont">Motorisé&nbsp;par&nbsp;<a href="http://zwiicms.com/" onclick="window.open(this.href);return false" data-tippy-content="Zwii CMS sans base de données, très léger et performant">Zwii';
if ($this->getData(['config','displayVersion']) === TRUE) { $items .= ' <span id="footerDisplayVersion" ' .
$items .= ' ' . common::ZWII_VERSION ; ($this->getData(['theme','footer','displayVersion']) === true ? '>': 'class="displayNone" >' ) .
} common::ZWII_VERSION .
$items .= '</a>'; "</span>" ;
$items .= '</a>';
$items .= '&nbsp;|&nbsp;<a href="' . helper::baseUrl() . 'sitemap" data-tippy-content="Plan du site" >Plan&nbsp;du&nbsp;site</a></span>'; $items .= '&nbsp;|&nbsp;<a href="' . helper::baseUrl() . 'sitemap" data-tippy-content="Plan du site" >Plan&nbsp;du&nbsp;site</a></span>';
if( if(
( (

View File

@ -223,8 +223,7 @@ class config extends common {
], ],
'timezone' => $this->getInput('configTimezone', helper::FILTER_STRING_SHORT, true), 'timezone' => $this->getInput('configTimezone', helper::FILTER_STRING_SHORT, true),
'title' => $this->getInput('configTitle', helper::FILTER_STRING_SHORT, true), 'title' => $this->getInput('configTitle', helper::FILTER_STRING_SHORT, true),
'itemsperPage' => $this->getInput('itemsperPage', helper::FILTER_INT,true), 'itemsperPage' => $this->getInput('itemsperPage', helper::FILTER_INT,true)
'displayVersion' => $this->getInput('configDisplayVersion', helper::FILTER_BOOLEAN)
] ]
]); ]);
if(self::$inputNotices === []) { if(self::$inputNotices === []) {

View File

@ -176,10 +176,6 @@
'label' => 'Fuseau horaire', 'label' => 'Fuseau horaire',
'selected' => $this->getData(['config', 'timezone']) 'selected' => $this->getData(['config', 'timezone'])
]); ?> ]); ?>
<?php echo template::checkbox('configDisplayVersion', true, 'Afficher le numéro de version', [
'checked' => $this->getData(['config', 'displayVersion']),
'help' => 'Afficher le numéro de version dans le pied de page.'
]); ?>
<?php echo template::checkbox('configMaintenance', true, 'Site en maintenance', [ <?php echo template::checkbox('configMaintenance', true, 'Site en maintenance', [
'checked' => $this->getData(['config', 'maintenance']), 'checked' => $this->getData(['config', 'maintenance']),
'help' => 'Le site devient inaccessible sauf pour les administrateurs.' 'help' => 'Le site devient inaccessible sauf pour les administrateurs.'

View File

@ -20,7 +20,6 @@ class install extends common {
'timezone' => 'Europe/Paris', 'timezone' => 'Europe/Paris',
'title' => 'Zwii, votre site en quelques clics !', 'title' => 'Zwii, votre site en quelques clics !',
'itemsperPage' => 10, 'itemsperPage' => 10,
'displayVersion' => true
], ],
'core' => [ 'core' => [
'dataVersion' => 0, 'dataVersion' => 0,
@ -360,7 +359,8 @@ class install extends common {
'textAlign' => 'left', 'textAlign' => 'left',
'textTransform' => 'none', 'textTransform' => 'none',
'socialsPosition' => 'center', 'socialsPosition' => 'center',
'socialsAlign' => 'center' 'socialsAlign' => 'center',
'displayVersion' => true
], ],
'header' => [ 'header' => [
'backgroundColor' => 'rgba(255, 255, 255, 1)', 'backgroundColor' => 'rgba(255, 255, 255, 1)',

View File

@ -289,7 +289,8 @@ class theme extends common {
'textTransform' => $this->getInput('themeFooterTextTransform'), 'textTransform' => $this->getInput('themeFooterTextTransform'),
'font' => $this->getInput('themeFooterFont'), 'font' => $this->getInput('themeFooterFont'),
'fontSize' => $this->getInput('themeFooterFontSize'), 'fontSize' => $this->getInput('themeFooterFontSize'),
'fontWeight' => $this->getInput('themeFooterFontWeight') 'fontWeight' => $this->getInput('themeFooterFontWeight'),
'displayVersion' => $this->getInput('themefooterDisplayVersion', helper::FILTER_BOOLEAN)
]]); ]]);
// Valeurs en sortie // Valeurs en sortie
$this->addOutput([ $this->addOutput([

View File

@ -132,6 +132,18 @@ $("#themeFooterLoginLink").on("change", function() {
} }
}).trigger("change"); }).trigger("change");
// NUméro de version
$("#themefooterDisplayVersion").on("change", function() {
if($(this).is(":checked")) {
console.log("top");
$("#footerDisplayVersion").show();
}
else {
$("#footerDisplayVersion").hide();
}
}).trigger("change");
// Aperçu du texte // Aperçu du texte
$("#themeFooterText").on("change keydown keyup", function() { $("#themeFooterText").on("change keydown keyup", function() {
$("#footerText").html($(this).val()); $("#footerText").html($(this).val());

View File

@ -101,10 +101,20 @@
'label' => 'Contenu (texte ou HTML)', 'label' => 'Contenu (texte ou HTML)',
'value' => $this->getData(['theme', 'footer', 'text']) 'value' => $this->getData(['theme', 'footer', 'text'])
]); ?> ]); ?>
<?php echo template::checkbox('themeFooterLoginLink', true, 'Lien de connexion', [ <div class="row">
'checked' => $this->getData(['theme', 'footer', 'loginLink']), <div class="col6">
'help' => 'Visible seulement sur cette page et lorsque vous n\'êtes pas connecté.' <?php echo template::checkbox('themeFooterLoginLink', true, 'Lien de connexion', [
]); ?> 'checked' => $this->getData(['theme', 'footer', 'loginLink']),
'help' => 'Visible seulement sur cette page et lorsque vous n\'êtes pas connecté.'
]); ?>
</div>
<div class="col6">
<?php echo template::checkbox('themefooterDisplayVersion', true, 'Afficher le numéro de version', [
'checked' => $this->getData(['config', 'displayVersion']),
'help' => 'Afficher le numéro de version dans le pied de page.'
]); ?>
<div>
</div>
</div> </div>
</div> </div>
</div> </div>