Blog 8 options d'affichage smarts
This commit is contained in:
parent
0abb336850
commit
261ef2f312
40
module/blog/view/option/option.js.php
Normal file
40
module/blog/view/option/option.js.php
Normal file
@ -0,0 +1,40 @@
|
|||||||
|
/**
|
||||||
|
* This file is part of Zwii.
|
||||||
|
*
|
||||||
|
* For full copyright and license information, please see the LICENSE
|
||||||
|
* file that was distributed with this source code.
|
||||||
|
*
|
||||||
|
* @author Rémi Jean <remi.jean@outlook.com>
|
||||||
|
* @copyright Copyright (C) 2008-2018, Rémi Jean
|
||||||
|
* @author Frédéric Tempez <frederic.tempez@outlook.com>
|
||||||
|
* @copyright Copyright (C) 2018-2024, Frédéric Tempez
|
||||||
|
* @license CC Attribution-NonCommercial-NoDerivatives 4.0 International
|
||||||
|
* @link http://zwiicms.fr/
|
||||||
|
*/
|
||||||
|
|
||||||
|
$(document).ready(function() {
|
||||||
|
// Gestion du changement de la case "Afficher la date"
|
||||||
|
$('#blogOptionShowDate').change(function() {
|
||||||
|
var showDateChecked = $(this).is(':checked');
|
||||||
|
|
||||||
|
// Afficher ou masquer le wrapper de l'heure selon l'état de la date
|
||||||
|
if (showDateChecked) {
|
||||||
|
$('.timeWrapper').show();
|
||||||
|
} else {
|
||||||
|
$('.timeWrapper').hide();
|
||||||
|
// Désactiver l'option "Afficher l'heure" lorsque la date est désactivée
|
||||||
|
$('#blogOptionShowTime').prop('checked', false).trigger('change');
|
||||||
|
}
|
||||||
|
|
||||||
|
// Afficher ou masquer le format de la date
|
||||||
|
$('#blogOptionDateFormatWrapper').toggle(showDateChecked);
|
||||||
|
}).trigger('change'); // Déclenchement au chargement de la page
|
||||||
|
|
||||||
|
// Gestion du changement de la case "Afficher l'heure"
|
||||||
|
$('#blogOptionShowTime').change(function() {
|
||||||
|
var showTimeChecked = $(this).is(':checked');
|
||||||
|
|
||||||
|
// Afficher ou masquer le format de l'heure
|
||||||
|
$('#blogOptionTimeFormatWrapper').toggle(showTimeChecked);
|
||||||
|
}).trigger('change'); // Déclenchement au chargement de la page
|
||||||
|
});
|
@ -29,12 +29,12 @@
|
|||||||
'selected' => $this->getData(['module', $this->getUrl(0), 'config', 'dateFormat'])
|
'selected' => $this->getData(['module', $this->getUrl(0), 'config', 'dateFormat'])
|
||||||
]); ?>
|
]); ?>
|
||||||
</div>
|
</div>
|
||||||
<div class="col3">
|
<div class="col3 timeWrapper">
|
||||||
<?php echo template::checkbox('blogOptionShowTime', true, 'Afficher l\'heure', [
|
<?php echo template::checkbox('blogOptionShowTime', true, 'Afficher l\'heure', [
|
||||||
'checked' => $this->getData(['module', $this->getUrl(0), 'config', 'showTime']),
|
'checked' => $this->getData(['module', $this->getUrl(0), 'config', 'showTime']),
|
||||||
]); ?>
|
]); ?>
|
||||||
</div>
|
</div>
|
||||||
<div class="col3">
|
<div class="col3 timeWrapper">
|
||||||
<?php echo template::select('blogOptionTimeFormat', $module::$timeFormats, [
|
<?php echo template::select('blogOptionTimeFormat', $module::$timeFormats, [
|
||||||
'label' => 'Format des heures',
|
'label' => 'Format des heures',
|
||||||
'selected' => $this->getData(['module', $this->getUrl(0), 'config', 'timeFormat'])
|
'selected' => $this->getData(['module', $this->getUrl(0), 'config', 'timeFormat'])
|
||||||
|
Loading…
Reference in New Issue
Block a user