Modifications 4307

This commit is contained in:
Deltacms 2022-10-10 09:10:39 +02:00
parent ceb46bc140
commit 285a4170f7
21 changed files with 169 additions and 114 deletions

View File

@ -1,8 +1,16 @@
# Changelog
## Version 4.3.07 de Deltacms
- Modifications :
- Configuration / Thème / Header : nouvelle option bannière visible uniquement sur la page d'accueil,
- Correction :
- Snipcart : modification dans Core / Page / Edition pour compatibilité avec ce module,
- Agenda 5.4 : correction d'un bug critique lié à la limitation des droits liés aux évènements, mise à jour indispensable,
- Configuration / Thème / Header : correction de plusieurs bugs notamment pour l'affichage en mode aperçu.
## Version 4.3.06 de Deltacms
- Corrections :
- Personnalisation des thémes : color picker absent du paramétrage de la bannière et du footer.
-¨Personnalisation des thémes : color picker absent du paramétrage de la bannière et du footer.
## Version 4.3.05 de Deltacms
- Modifications :

View File

@ -1,5 +1,5 @@
# DeltaCMS 4.3.06
# DeltaCMS 4.3.07
DeltaCMS est un CMS sans base de données (flat-file) qui permet de créer et gérer facilement un site web sans aucune connaissance en programmation.
L'administration du site est bilingue anglais ou français, le site peut être rédigé dans une des principales langues européennes.

View File

@ -48,7 +48,7 @@ class common {
// Numéro de version
const DELTA_UPDATE_URL = 'https://update.deltacms.fr/master/';
const DELTA_VERSION = '4.3.06';
const DELTA_VERSION = '4.3.07';
const DELTA_UPDATE_CHANNEL = "v4";
public static $actions = [];
@ -2388,7 +2388,8 @@ class core extends common {
// Bannière au contenu personnalisé
if ($this->getData(['theme','header','feature']) === 'feature' ) {
// Hauteur de la taille du contenu perso
$css .= 'header {height:'. $this->getData(['theme', 'header', 'height']) . '; min-height:' . $this->getData(['theme', 'header', 'height']) . ';overflow: hidden;}';
// $css .= 'header {height:'. $this->getData(['theme', 'header', 'height']) . '; min-height:' . $this->getData(['theme', 'header', 'height']) . ';overflow: hidden;}';
$css .= 'header {height:'. $this->getData(['theme', 'header', 'height']) . '; min-height:20px;overflow: hidden;}';
//$css .= '.bannerDisplay img { width: auto;max-height:' . $this->getData(['theme', 'header', 'height']) . ';}';
}

View File

@ -60,8 +60,10 @@ if ($this->getData(['core', 'dataVersion']) < 4202) {
$this->setData(['core', 'dataVersion', 4202]);
}
if ($this->getData(['core', 'dataVersion']) < 4306) {
if ($this->getData(['core', 'dataVersion']) < 4307) {
$this->setData(['theme', 'header', 'homePageOnly', false]);
$this->setData(['theme', 'header', 'heightSelect', $this->getData(['theme', 'header', 'height']) ]);
// Mise à jour
$this->setData(['core', 'dataVersion', 4306]);
$this->setData(['core', 'dataVersion', 4307]);
}
?>

View File

@ -106,6 +106,11 @@ a:active {
outline: none;
}
/* pour rendre toute la bannière cliquable */
a.headertitle {
display: block;
}
/* Titres */
h1 {
font-size: 1.8em;

View File

@ -103,15 +103,19 @@ if( $this->getInput('DELTA_I18N_SITE') !== '' && $this->getInput('DELTA_I18N_SIT
<?php endif; ?>
<!-- Bannière dans le fond du site -->
<?php $homePageOnly = false;
if( $this->getUrl(0) !== 'theme' ){
if( $this->getUrl(0) !== $this->getData(['locale', 'homePageId' ]) && $this->getData(['theme','header','homePageOnly']) === true) $homePageOnly = true;
}?>
<?php if($this->getData(['theme', 'header', 'position']) === 'body'): ?>
<?php
$headerClass = $this->getData(['theme', 'header', 'position']) === 'hide' ? 'displayNone' : '';
$headerClass = ($this->getData(['theme', 'header', 'position']) === 'hide' || $homePageOnly === true) ? 'displayNone' : '';
$headerClass .= $this->getData(['theme', 'header', 'tinyHidden']) ? ' bannerDisplay ' : '';
$headerClass .= $this->getData(['theme', 'header', 'wide']) === 'none' ? '' : 'container';
?>
<header <?php echo empty($headerClass) ? '' : 'class="' . $headerClass . '"';?>>
<?php echo ($this->getData(['theme','header','linkHomePage']) && $this->getData(['theme','header','feature']) === 'wallpaper' ) ? '<a href="' . helper::baseUrl(false) . '">' : ''; ?>
<?php if ($this->getData(['theme','header','feature']) === 'wallpaper' ): ?>
<?php echo ($this->getData(['theme','header','linkHomePage']) ) ? '<a class="headertitle" href="' . helper::baseUrl(false) . '">' : ''; ?>
<?php if(
$this->getData(['theme', 'header', 'textHide']) === false
// Affiche toujours le titre de la bannière pour l'édition du thème
@ -121,13 +125,14 @@ if( $this->getInput('DELTA_I18N_SITE') !== '' && $this->getInput('DELTA_I18N_SIT
<?php else: ?>
<span id="themeHeaderTitle">&nbsp;</span>
<?php endif; ?>
<?php echo ( $this->getData(['theme','header','linkHomePage']) ) ? '</a>' : ''; ?>
<?php else: ?>
<div id="featureContent">
<?php echo $this->getData(['theme','header','featureContent']);?>
</div>
<?php endif; ?>
</header>
<?php echo ( $this->getData(['theme','header','linkHomePage']) && $this->getData(['theme','header','feature']) === 'wallpaper' ) ? '</a>' : ''; ?>
<?php endif; ?>
<!-- Menu dans le fond du site après la bannière -->
@ -169,13 +174,13 @@ if( $this->getInput('DELTA_I18N_SITE') !== '' && $this->getInput('DELTA_I18N_SIT
)
): ?>
<!-- Bannière dans le site -->
<?php echo ( $this->getData(['theme','header','linkHomePage']) && $this->getData(['theme','header','feature']) === 'wallpaper' ) ? '<a href="' . helper::baseUrl(false) . '">' : ''; ?>
<?php
$headerClass = $this->getData(['theme', 'header', 'position']) === 'hide' ? 'displayNone' : '';
$headerClass = ($this->getData(['theme', 'header', 'position']) === 'hide' || $homePageOnly === true) ? 'displayNone' : '';
$headerClass .= $this->getData(['theme', 'header', 'tinyHidden']) ? ' bannerDisplay ' : '';
?>
<header <?php echo empty($headerClass) ? '' : 'class="' . $headerClass . '"';?>>
<?php if ($this->getData(['theme','header','feature']) === 'wallpaper' ): ?>
<?php echo ( $this->getData(['theme','header','linkHomePage']) ) ? '<a class="headertitle" href="' . helper::baseUrl(false) . '">' : ''; ?>
<?php if(
$this->getData(['theme', 'header', 'textHide']) === false
// Affiche toujours le titre de la bannière pour l'édition du thème
@ -185,14 +190,14 @@ if( $this->getInput('DELTA_I18N_SITE') !== '' && $this->getInput('DELTA_I18N_SIT
<?php else: ?>
<span id="themeHeaderTitle">&nbsp;</span>
<?php endif; ?>
<?php echo ( $this->getData(['theme','header','linkHomePage']) ) ? '</a>' : ''; ?>
<?php else: ?>
<div id="featureContent">
<?php echo $this->getData(['theme','header','featureContent']);?>
</diV>
</div>
<?php endif; ?>
</header>
<?php echo ( $this->getData(['theme','header','linkHomePage']) && $this->getData(['theme','header','feature']) === 'wallpaper' ) ? '</a>' : ''; ?>
<?php endif; ?>
<?php endif; ?>
<?php if(
$this->getData(['theme', 'menu', 'position']) === 'site-second' ||
$this->getData(['theme', 'menu', 'position']) === 'site'

View File

@ -70,7 +70,7 @@ class init extends common {
]
],
'core' => [
'dataVersion' => 4306,
'dataVersion' => 4307,
'lastBackup' => 0,
'lastClearTmp' => 0,
'lastAutoUpdate' => 0,
@ -321,6 +321,7 @@ class init extends common {
'fontSize' => '2em',
'fontWeight' => 'normal',
'height' => '200px',
'heightSelect' => '200px',
'image' => 'theme/defaut/banniere_1500x200.jpg',
'imagePosition' => 'center center',
'imageRepeat' => 'no-repeat',
@ -335,7 +336,8 @@ class init extends common {
'tinyHidden' => true,
'feature' => 'wallpaper',
'featureContent' => '<p>Bannière vide</p>',
'width' => 'container'
'width' => 'container',
'homePageOnly' => false
],
'menu' => [
'backgroundColor' => 'rgba(32, 59, 82, 0.85)',

View File

@ -9,7 +9,11 @@ var lang_flatpickr = "<?php echo $lang_flatpickr; ?>";
<?php
// Inclusion de tinymce
echo '<script src="' . helper::baseUrl(false) . 'core/vendor/tinymce/tinymce.min.js' . '"></script>';
echo '<script src="' . helper::baseUrl(false) . 'core/vendor/tinymce/init.js' . '"></script>';
if ($this->getData(['page', $this->getUrl(2), 'moduleId']) === 'snipcart' ){
echo '<script src="'. helper::baseUrl(false).'module/snipcart/vendor/init.js"></script>';
} else {
echo '<script src="' . helper::baseUrl(false) . 'core/vendor/tinymce/init.js' . '"></script>';
}
echo '<link rel="stylesheet" href="' . helper::baseUrl(false) . 'core/vendor/tinymce/init.css' . '">';
echo template::formOpen('pageEditForm'); ?>

View File

@ -134,7 +134,7 @@ $text['core_theme_view']['header'][2] = 'Settings';
$text['core_theme_view']['header'][3] = 'Position';
$text['core_theme_view']['header'][4] = 'Type of content';
$text['core_theme_view']['header'][5] = 'Maximum height';
$text['core_theme_view']['header'][6] = 'The maximum height is 600 pixels, even if the selected image size is larger. <br/>When the adaptation is set to Responsive, the height decreases in proportion to the width.';
$text['core_theme_view']['header'][6] = 'The maximum height is 600 pixels, even if the selected image size is larger.';
$text['core_theme_view']['header'][7] = 'Width';
$text['core_theme_view']['header'][8] = 'Hide banner in small screen';
$text['core_theme_view']['header'][9] = 'Align banner with content';
@ -152,7 +152,7 @@ $text['core_theme_view']['header'][20] = 'Character case';
$text['core_theme_view']['header'][21] = 'Proportional to that defined in the site';
$text['core_theme_view']['header'][22] = 'Content alignment';
$text['core_theme_view']['header'][23] = 'Wallpaper';
$text['core_theme_view']['header'][24] = 'Select an image with the following recommended dimensions';
$text['core_theme_view']['header'][24] = 'Select an image, tips in the documentation';
$text['core_theme_view']['header'][25] = 'Image';
$text['core_theme_view']['header'][26] = 'Repeat';
$text['core_theme_view']['header'][27] = 'Adaptation';
@ -164,6 +164,7 @@ $text['core_theme_view']['header'][32] = ' | ratio : ';
$text['core_theme_view']['header'][33] = 'Custom content';
$text['core_theme_view']['header'][34] ='Save';
$text['core_theme_view']['header'][35] = "Height of the selected image (";
$text['core_theme_view']['header'][36] = "Banner only visible on the home page";
$text['core_theme_view']['index'][0] = 'Click on an area to access its customisation options. You can also display hidden areas using the button below';
$text['core_theme_view']['index'][1] = 'Home';
$text['core_theme_view']['index'][2] = 'Help';
@ -370,7 +371,7 @@ $headerFontSizes = [
'2.4vmax' => 'Very large (240%)'
];
$headerHeights = [
'unset' => 'Free', // texte dynamique cf header.js.php
'unset' => 'Content height',
'100px' => 'Very small (100px) ',
'150px' => 'Small (150px)',
'200px' => 'Medium (200px)',

View File

@ -134,7 +134,7 @@ $text['core_theme_view']['header'][2] = 'Paramètres';
$text['core_theme_view']['header'][3] = 'Position';
$text['core_theme_view']['header'][4] = 'Nature de contenu';
$text['core_theme_view']['header'][5] = 'Hauteur maximale';
$text['core_theme_view']['header'][6] = 'La hauteur maximale est de 600 pixels, même si les dimensions de l\'image sélectionnée sont supérieures. <br />Lorsque l\'adaptation est positionnée sur Responsive, la hauteur diminue proportionnellement à la largeur.';
$text['core_theme_view']['header'][6] = 'La hauteur maximale est de 600 pixels, même si les dimensions de l\'image sélectionnée sont supérieures.';
$text['core_theme_view']['header'][7] = 'Largeur';
$text['core_theme_view']['header'][8] = 'Masquer la bannière en écran réduit';
$text['core_theme_view']['header'][9] = 'Aligner la bannière avec le contenu';
@ -152,7 +152,7 @@ $text['core_theme_view']['header'][20] = 'Casse';
$text['core_theme_view']['header'][21] = 'Proportionnelle à celle définie dans le site.';
$text['core_theme_view']['header'][22] = 'Alignement du contenu';
$text['core_theme_view']['header'][23] = 'Papier peint';
$text['core_theme_view']['header'][24] = 'Sélectionner une image aux dimensions recommandées ci-dessous';
$text['core_theme_view']['header'][24] = 'Sélectionner une image, conseils dans la documentation';
$text['core_theme_view']['header'][25] = 'Image';
$text['core_theme_view']['header'][26] = 'Répétition';
$text['core_theme_view']['header'][27] = 'Adaptation';
@ -164,6 +164,7 @@ $text['core_theme_view']['header'][32] = ' | ratio : ';
$text['core_theme_view']['header'][33] = 'Contenu personnalisé';
$text['core_theme_view']['header'][34] ='Enregistrer';
$text['core_theme_view']['header'][35] = "Hauteur de l\'image sélectionnée (";
$text['core_theme_view']['header'][36] = "Bannière visible uniquement sur la page d'accueil";
$text['core_theme_view']['index'][0] = 'Cliquez sur une zone afin d\'accéder à ses options de personnalisation. Vous pouvez également afficher les zones cachées à l\'aide du bouton ci-dessous.';
$text['core_theme_view']['index'][1] = 'Accueil';
$text['core_theme_view']['index'][2] = 'Aide';
@ -369,7 +370,7 @@ $headerFontSizes = [
'2.4vmax' => 'Très grande (240%)'
];
$headerHeights = [
'unset' => 'Libre', // texte dynamique cf header.js.php
'unset' => 'Hauteur du contenu',
'100px' => 'Très petite (100px) ',
'150px' => 'Petite (150px)',
'200px' => 'Moyenne (200px)',

View File

@ -434,7 +434,7 @@ class theme extends common {
'font' => $this->getInput('themeHeaderFont'),
'fontSize' => $this->getInput('themeHeaderFontSize'),
'fontWeight' => $this->getInput('themeHeaderFontWeight'),
'height' => $this->getInput('themeHeaderHeight'),
'heightSelect' => $this->getInput('themeHeaderHeight'),
'wide' => $this->getInput('themeHeaderWide'),
'image' => $this->getInput('themeHeaderImage'),
'imagePosition' => $this->getInput('themeHeaderImagePosition'),
@ -449,7 +449,8 @@ class theme extends common {
'imageContainer' => $this->getInput('themeHeaderImageContainer'),
'tinyHidden' => $this->getInput('themeHeaderTinyHidden', helper::FILTER_BOOLEAN),
'feature' => $this->getInput('themeHeaderFeature'),
'featureContent' => $featureContent
'featureContent' => $featureContent,
'homePageOnly' => $this->getInput('themeHeaderHomePageOnly', helper::FILTER_BOOLEAN)
]]);
// Modification de la position du menu selon la position de la bannière
if ( $this->getData(['theme','header','position']) == 'site' )
@ -466,6 +467,20 @@ class theme extends common {
) {
$this->setData(['theme', 'menu', 'position','site']);
}
// Suppression de l'image en contenu personnalisé
if( $this->getData(['theme','header','feature']) == 'feature'){
$this->setData(['theme','header', 'image',""]);
}
// Application de la hauteur de l'image sélectionnée si hauteur de l'image sur hauteur du contenu
if( $this->getData(['theme', 'header', 'feature']) ==='wallpaper' &&
$this->getData(['theme', 'header', 'image']) !== '' &&
$this->getData(['theme', 'header', 'heightSelect']) === 'unset' ){
$infoImage = getimagesize( self::FILE_DIR.'source/'. $this->getData(['theme', 'header', 'image']) );
$this->setData(['theme', 'header', 'height', $infoImage[1]."px"]);
} else {
// Si pas d'image ou bannière personnalisée
$this->setData(['theme', 'header', 'height', $this->getData(['theme', 'header', 'heightSelect']) ]);
}
// Valeurs en sortie
$this->addOutput([

View File

@ -27,4 +27,8 @@
text-transform: none;
font-size: 1.0em;
margin: 10px;
}
#site {
overflow: visible;
}

View File

@ -13,8 +13,12 @@
* @author Frédéric Tempez <frederic.tempez@outlook.com>
* @copyright Copyright (C) 2018-2021, Frédéric Tempez
*/
$(document).ready(function(){
var tmpImg = new Image();
$(document).ready(function(){
$("header").css("line-height", "");
$("header").css("height", "");
});
@ -28,73 +32,49 @@ $("input, select").on("change", function() {
// Contenu perso
if ($("#themeHeaderFeature").val() == "feature") {
css = "header{min-height: " + $("#themeHeaderHeight").val() + ";height:" + $("#themeHeaderHeight").val() + "; overflow:hidden; background-position:top; background-repeat: no-repeat; line-height:1.15; background-color:unset; background-image:unset; text-align:unset;}";
// $("#themeHeaderHeight").val() unset pour 'Hauteur du contenu', sinon valeur en px
css = "header{min-height: 20px; height:" + $("#themeHeaderHeight").val() + "; overflow:hidden; background-position:top; background-repeat: no-repeat; line-height:1.15; background-color:unset; background-image:unset; text-align:unset;}";
$("#featureContent").appendTo("header").show();
$("#themeHeaderTitle").hide();
// Modifier le texte du sélecteur de hauteur
$("#themeHeaderHeight option:eq(0)").text("Hauteur du contenu personnalisé");
}
// Couleurs, image, alignement et hauteur de la bannière
if ($("#themeHeaderFeature").val() == "wallpaper") {
// Masque le contenu perso
$("#featureContent").hide();
// Récupérer la taille de l'image
var tmpImg = new Image();
tmpImg.src= "<?php echo helper::baseUrl(false); ?>" + "site/file/source/" + $("#themeHeaderImage").val();
// Déterminer la taille de l'image
tmpImg.onload = function() {
// Informations affichées
$("#themeHeaderImageHeight").html(tmpImg.height + "px");
$("#themeHeaderImageWidth").html(tmpImg.width + "px");
$("#themeHeaderImageRatio").html(tmpImg.width / tmpImg.height);
// Limiter la hauteur à 600 px
if (tmpImg.height > 600) {
tmpImgHeight = 600;
} else {
tmpImgHeight = tmpImg.height;
}
//Modifier la dropdown liste si une image n'est pas sélectionnée
if ($("#themeHeaderImage").val() !== "" ) {
// Une image est ajoutée ou changée
if ($("#themeHeaderHeight option").length === 5) {
// Pas d'image précédemment on ajoute l'option
$("#themeHeaderHeight ").prepend('<option selected="selected" value="0"> Hauteur de l\'image sélectionnée </option>');
}
// Modifier la valeur
$("#themeHeaderHeight option:eq(0)").val(tmpImgHeight + "px");
// Modifier l'option
$("#themeHeaderHeight option:eq(0)").html( textOption + tmpImgHeight + "px)");
}
};
if ($("#themeHeaderImage").val() === "" &&
$("#themeHeaderHeight option").length === 6 ) {
$("#themeHeaderHeight option:eq(0)").remove();
}
tmpImg.src= "<?php echo helper::baseUrl(false); ?>" + "site/file/source/" + $("#themeHeaderImage").val();
var headerFont = $("#themeHeaderFont").val();
css = "header{text-align:" + $("#themeHeaderTextAlign").val() + ";";
if ($("#themeHeaderImage").val()) {
// Une image est sélectionnée
css += "background-image:url('<?php echo helper::baseUrl(false); ?>site/file/source/" + $("#themeHeaderImage").val() + "');background-repeat:" + $("#themeHeaderImageRepeat").val() + ";background-position:" + $("#themeHeaderImagePosition").val() + ";";
css += "background-size:" + $("#themeHeaderImageContainer").val() + ";";
// Pas d'image sélectionnée
css = "header{text-align:" + $("#themeHeaderTextAlign").val() + ";";
// Sélection d'une image réalisée
if( $("#themeHeaderImage").val() !== ""){
css += "background-image:url('<?php echo helper::baseUrl(false); ?>site/file/source/" + $("#themeHeaderImage").val() + "');background-repeat:" + $("#themeHeaderImageRepeat").val() + ";background-position:" + $("#themeHeaderImagePosition").val() + ";";
css += "background-size:" + $("#themeHeaderImageContainer").val() + ";";
if( $("#themeHeaderHeight").val() !== 'unset'){
css += "line-height:" + $("#themeHeaderHeight").val() + ";height:" + $("#themeHeaderHeight").val() + "}";
} else {
// Désactiver l'option responsive
css += "background-image:none;";
// valeur unset remplacée par la hauteur de l'image
tmpImg.src= "<?php echo helper::baseUrl(false); ?>" + "site/file/source/" + $("#themeHeaderImage").val();
css += "line-height:" + tmpImg.height + "px" + ";height:" + tmpImg.height + "px" + "}";
}
css += "line-height:" + $("#themeHeaderHeight").val() + ";height:" + $("#themeHeaderHeight").val() + "}";
} else {
// Pas d'image sélectionnée
css += "background-image:none;";
css += "min-height: 20px;line-height:" + $("#themeHeaderHeight").val() + "; height:" + $("#themeHeaderHeight").val() + "}";
}
// Taille, couleur, épaisseur et capitalisation du titre de la bannière
css += "header span{font-family:'" + headerFont.replace(/\+/g, " ") + "',sans-serif;font-weight:" + $("#themeHeaderFontWeight").val() + ";font-size:" + $("#themeHeaderFontSize").val() + ";text-transform:" + $("#themeHeaderTextTransform").val() + ";color:" + $("#themeHeaderTextColor").val() + "}";
@ -118,8 +98,8 @@ $("input, select").on("change", function() {
switch(positionHeader) {
case 'hide':
$("header").hide();
$("nav").show().prependTo("#site");
$("header").hide();
break;
case 'site':
$("header").show().prependTo("#site");
@ -210,7 +190,7 @@ $("#themeHeaderImage").on("change", function() {
}
else {
$("#themeHeaderImageOptions").slideUp(function() {
$("#themeHeaderTextHide").prop("checked", false).trigger("change");
// $("#themeHeaderTextHide").prop("checked", false).trigger("change");
});
}
}).trigger("change");
@ -244,9 +224,11 @@ $("#themeHeaderPosition").on("change", function() {
$("#themeHeaderPosition").on("change", function() {
if($(this).val() === 'hide') {
$("#themeHeaderSmallDisplay").slideUp();
$("#themeHeaderHomePage").slideUp();
}
else {
$("#themeHeaderSmallDisplay").slideDown();
$("#themeHeaderHomePage").slideDown();
}
}).trigger("change");

View File

@ -60,17 +60,18 @@ echo template::formOpen('themeHeaderForm');
<div class="col4">
<?php echo template::select('themeHeaderHeight', $headerHeights, [
'label' => $text['core_theme_view']['header'][5],
'selected' => $this->getData(['theme', 'header', 'height']),
'selected' => $this->getData(['theme', 'header', 'heightSelect']),
'help' => $text['core_theme_view']['header'][6]
]); ?>
</div>
</div>
<div class="row">
<div class="col4">
<?php echo template::select('themeHeaderWide', $containerWides, [
'label' => $text['core_theme_view']['header'][7],
'selected' => $this->getData(['theme', 'header', 'wide'])
]); ?>
<div class="col4">
<div id="themeHeaderHomePage" class="displayNone">
<?php echo template::checkbox('themeHeaderHomePageOnly', true, $text['core_theme_view']['header'][36], [
'checked' => $this->getData(['theme', 'header', 'homePageOnly'])
]); ?>
</div>
</div>
<div class="col4">
<div id="themeHeaderSmallDisplay" class="displayNone">
@ -87,6 +88,16 @@ echo template::formOpen('themeHeaderForm');
</div>
</div>
</div>
<div class="row">
<div class="col4">
<?php echo template::select('themeHeaderWide', $containerWides, [
'label' => $text['core_theme_view']['header'][7],
'selected' => $this->getData(['theme', 'header', 'wide'])
]); ?>
</div>
</div>
</div>
</div>
</div>
@ -237,5 +248,5 @@ echo template::formOpen('themeHeaderForm');
</div>
<?php echo template::formClose(); ?>
<script>
var textOption = <?php echo $text['core_theme_view']['header'][35]; ?>;
var textOption = <?php echo '"'.$text['core_theme_view']['header'][35].'"'; ?>;
</script>

View File

@ -36,7 +36,7 @@ class agenda extends common {
'index' => self::GROUP_VISITOR
];
const VERSION = '5.3';
const VERSION = '5.4';
const REALNAME = 'Agenda';
const DELETE = true;
const UPDATE = '4.1';
@ -116,9 +116,9 @@ class agenda extends common {
copy( './module/agenda/ressource/file/source/agenda/adresses/.htaccess', './site/file/source/agenda/adresses/.htaccess');
$this->setData(['module', $this->getUrl(0), 'config', 'versionData','5.2']);
}
// Mise à jour vers la version 5.3
if (version_compare($this->getData(['module', $this->getUrl(0), 'config', 'versionData']), '5.3', '<') ) {
$this->setData(['module', $this->getUrl(0), 'config', 'versionData','5.3']);
// Mise à jour vers la version 5.4
if (version_compare($this->getData(['module', $this->getUrl(0), 'config', 'versionData']), '5.4', '<') ) {
$this->setData(['module', $this->getUrl(0), 'config', 'versionData','5.4']);
}
}
@ -628,7 +628,6 @@ class agenda extends common {
else{
self::$liste_adresses= array_combine(self::$liste_adresses,self::$liste_adresses);
}
$this->limite_groupes();
// Tableau des catégories
if( is_file(self::DATAMODULE.'categories/categories.json') && $this->getData(['module', $this->getUrl(0), 'categories', 'valCategories' ]) ){
$json = file_get_contents(self::DATAMODULE.'categories/categories.json');
@ -756,7 +755,6 @@ class agenda extends common {
self::$categorie[$key] = $tabcat[$key]['name'];
}
}
$this->limite_groupes();
if( $this->getUser('group') >= self::$evenement['groupe_mod']){
// Affichage de la page édition d'un évènement avec les valeurs actuelles
@ -1082,26 +1080,6 @@ class agenda extends common {
}
return $json;
}
/* Limitation des choix pour les groupes lecture et modification avant création ou édition
*/
private function limite_groupes() {
//Modification du tableau self::$groupe si case cochée en configuration
if ($this->getData(['module', $this->getUrl(0), 'config', 'droit_limite'])
&& $this->getUser('group') >= self::$evenement['groupe_mod']){
switch ($this->getUser('group')) {
case 0 :
array_splice(self::$groupe,1);
break;
case 1 :
array_splice(self::$groupe,2);
break;
case 2 :
array_splice(self::$groupe,3);
break;
}
}
}
/*
* Extraction des données de la chaîne url et détection de changement de vue

View File

@ -12,6 +12,25 @@ echo '<script src="' . helper::baseUrl(false) . 'core/vendor/tinymce/tinymce.min
echo '<script src="' . helper::baseUrl(false) . 'core/vendor/tinymce/init.js' . '"></script>';
echo '<link rel="stylesheet" href="' . helper::baseUrl(false) . 'core/vendor/tinymce/init.css' . '">';
// $this->getUser('group') renvoie false pour un visiteur !
$userGroup = $this->getUser('group');
if( $userGroup === false) $userGroup = 0;
//Modification du tableau $groupe si l'option "limitation du choix des groupes liés aux évènements" est cochée
if ( $this->getData(['module', $this->getUrl(0), 'config', 'droit_limite']) ){
switch ($userGroup) {
case 0 :
array_splice($groupe,1);
break;
case 1 :
array_splice($groupe,2);
break;
case 2 :
array_splice($groupe,3);
break;
}
}
echo template::formOpen('creation_events'); ?>
<div class="row">
<div class="col2">

View File

@ -12,10 +12,9 @@ var lang_flatpickr = "<?php echo $lang_flatpickr; ?>";
echo '<script src="' . helper::baseUrl(false) . 'core/vendor/tinymce/tinymce.min.js' . '"></script>';
echo '<script src="' . helper::baseUrl(false) . 'core/vendor/tinymce/init.js' . '"></script>';
echo '<link rel="stylesheet" href="' . helper::baseUrl(false) . 'core/vendor/tinymce/init.css' . '">';
?>
<!--Adaptation de Tinymce en fonction des droits des utilisateurs -->
<?php if( $this->getUser('group') >= $module::$evenement['groupe_mod'] ){
// Adaptation de Tinymce en fonction des droits des utilisateurs
if( $this->getUser('group') >= $module::$evenement['groupe_mod'] ){
if( $this->getUser('group') >= 2){
$class_tinymce = 'editorWysiwyg';
}
@ -23,9 +22,27 @@ echo '<link rel="stylesheet" href="' . helper::baseUrl(false) . 'core/vendor/tin
$class_tinymce = 'editorWysiwygComment';
}
}
?>
<?php echo template::formOpen('edition_events'); ?>
// $this->getUser('group') renvoie false pour un visiteur !
$userGroup = $this->getUser('group');
if( $userGroup === false) $userGroup = 0;
//Modification du tableau $groupe si l'option "limitation du choix des groupes liés aux évènements" est cochée
if ( $this->getData(['module', $this->getUrl(0), 'config', 'droit_limite']) ){
switch ($userGroup) {
case 0 :
array_splice($groupe,1);
break;
case 1 :
array_splice($groupe,2);
break;
case 2 :
array_splice($groupe,3);
break;
}
}
echo template::formOpen('edition_events'); ?>
<div class="row">
<div class="col2">