Modif éditeur + bug affichage sous menu

This commit is contained in:
Deltacms 2022-11-15 18:20:17 +01:00
parent e3e3b51be2
commit 541fdce521
15 changed files with 396 additions and 340 deletions

View File

@ -4,7 +4,10 @@
- Modifications :
- Ajout du groupe éditeur, autorisations limitées à l'édition des pages, l'ajout de fichiers, l'accès aux pages privées membre et éditeur,
- Adaptation des modules de page à ce nouveau groupe avec des actions autorisées très limitées,
-
- Nouvelle option dans l'édition d'une page, permissions : sélection du groupe requis pour modifier la page,
- Module Gallery, sélection du dossier incluant les images : exclusion de certains dossiers,
- Corrections :
- Affichage du sous-menu avec un alignement du contenu à droite : il y avait un décalage du site quand les pages situées à la droite du menu possédaient des pages enfants.
## Version 4.3.08 de Deltacms
- Modifications :

View File

@ -437,6 +437,15 @@ $(document).ready(function(){
$("#navfixedlogout .navSub").css({ 'pointer-events' : 'none' });
$("#navfixedconnected .navSub").css({ 'pointer-events' : 'none' });
});
/* Position du sous-menu */
$("a.B, a.A").mouseenter(function(event){
if( event.pageX > ( $(window).width()-250 ) ){
$("nav li ul").css("right","0px");
} else {
$("nav li ul").css("right","");
}
});
/**
* Chargement paresseux des images et des iframes

View File

@ -2013,13 +2013,19 @@ class common {
// Sur une page d'accueil
OR $this->getUrl(0) === ''
) {
$leftItems .= '<li><a href="' . helper::baseUrl() . 'page/edit/' . $this->getUrl(0) . '" data-tippy-content="'.$text['core']['showBar'][5].'">' . template::ico('pencil') . '</a></li>';
if ($this->getData(['page', $this->getUrl(0),'moduleId'])) {
$leftItems .= '<li><a href="' . helper::baseUrl() . $this->getUrl(0) . '/config' . '" data-tippy-content="'.$text['core']['showBar'][6].'">' . template::ico('gear') . '</a></li>';
// Droits d'édition et de configuration du module ?
if( null == $this->getData(['page', $this->getUrl(0), 'groupEdit']) || $this->getUser('group') >= $this->getData(['page', $this->getUrl(0), 'groupEdit'])){
$leftItems .= '<li><a href="' . helper::baseUrl() . 'page/edit/' . $this->getUrl(0) . '" data-tippy-content="'.$text['core']['showBar'][5].'">' . template::ico('pencil') . '</a></li>';
if ($this->getData(['page', $this->getUrl(0),'moduleId'])) {
$leftItems .= '<li><a href="' . helper::baseUrl() . $this->getUrl(0) . '/config' . '" data-tippy-content="'.$text['core']['showBar'][6].'">' . template::ico('gear') . '</a></li>';
}
}
if($this->getUser('group') >= self::GROUP_MODERATOR) {
$leftItems .= '<li><a id="pageDuplicate" href="' . helper::baseUrl() . 'page/duplicate/' . $this->getUrl(0) . '&csrf=' . $_SESSION['csrf'] . '" data-tippy-content="'.$text['core']['showBar'][7].'">' . template::ico('clone') . '</a></li>';
$leftItems .= '<li><a id="pageDelete" href="' . helper::baseUrl() . 'page/delete/' . $this->getUrl(0) . '&csrf=' . $_SESSION['csrf'] . '" data-tippy-content="'.$text['core']['showBar'][8].'">' . template::ico('trash') . '</a></li>';
// Droits pour dupliquer ou effacer ?
if( null == $this->getData(['page', $this->getUrl(0), 'groupEdit']) || $this->getUser('group') >= $this->getData(['page', $this->getUrl(0), 'groupEdit'])){
if($this->getUser('group') >= self::GROUP_MODERATOR) {
$leftItems .= '<li><a id="pageDuplicate" href="' . helper::baseUrl() . 'page/duplicate/' . $this->getUrl(0) . '&csrf=' . $_SESSION['csrf'] . '" data-tippy-content="'.$text['core']['showBar'][7].'">' . template::ico('clone') . '</a></li>';
$leftItems .= '<li><a id="pageDelete" href="' . helper::baseUrl() . 'page/delete/' . $this->getUrl(0) . '&csrf=' . $_SESSION['csrf'] . '" data-tippy-content="'.$text['core']['showBar'][8].'">' . template::ico('trash') . '</a></li>';
}
}
}
}

View File

@ -5,7 +5,7 @@
"feeds": true,
"feedsLabel": "Syndication RSS",
"itemsperPage": 6,
"versionData": "6.4"
"versionData": "6.5"
},
"texts": {
"NoComment": "No comment yet",
@ -120,7 +120,7 @@
"style": "site\/data\/gallery\/galeries\/theme.css"
},
"config": {
"versionData": "4.1"
"versionData": "4.2"
}
},
"deltacms": {
@ -141,7 +141,7 @@
"logoUrl": "",
"logoWidth": "40",
"maxSizeUpload": "500000",
"versionData": "4.4",
"versionData": "4.5",
"uploadJpg": true,
"uploadPng": true,
"uploadPdf": false,
@ -187,7 +187,7 @@
"placeHolder": "One or more keywords separated by a space or +.",
"resultHideContent": false,
"previewLength": 100,
"versionData": "3.2",
"versionData": "3.3",
"nearWordText": "Related words",
"successTitle": "Result of your search",
"failureTitle": "No results",
@ -204,7 +204,7 @@
"resultHideContent": false,
"placeHolder": "Un ou plusieurs mots-clés séparés par un espace ou par +",
"submitText": "Rechercher",
"versionData": "3.2",
"versionData": "3.3",
"nearWordText": "Mots approchants",
"successTitle": "Résultat de votre recherche",
"failureTitle": "Aucun résultat",

View File

@ -14,6 +14,7 @@
"parentPageId": "",
"position": 1,
"group": 0,
"groupEdit": 2,
"targetBlank": false,
"title": "Home",
"shortTitle": "Home",
@ -39,6 +40,7 @@
"modulePosition": "bottom",
"position": 3,
"group": 1,
"groupEdit": 2,
"targetBlank": false,
"title": "Private page",
"shortTitle": "Private",
@ -63,6 +65,7 @@
"parentPageId": "editing",
"position": 1,
"group": 0,
"groupEdit": 2,
"targetBlank": false,
"title": "Layout",
"shortTitle": "Layout",
@ -88,6 +91,7 @@
"parentPageId": "editing",
"position": 2,
"group": 0,
"groupEdit": 2,
"targetBlank": false,
"title": "Sidebar with menu",
"shortTitle": "Side menu",
@ -113,6 +117,7 @@
"parentPageId": "",
"position": 4,
"group": 0,
"groupEdit": 2,
"targetBlank": false,
"title": "Blog",
"shortTitle": "Blog",
@ -137,6 +142,7 @@
"parentPageId": "",
"position": 5,
"group": 0,
"groupEdit": 2,
"targetBlank": false,
"title": "Image galleries",
"shortTitle": "Galleries",
@ -161,6 +167,7 @@
"parentPageId": "",
"position": 6,
"group": 0,
"groupEdit": 2,
"targetBlank": true,
"title": "Deltacms",
"shortTitle": "Deltacms",
@ -185,6 +192,7 @@
"parentPageId": "",
"position": 7,
"group": 0,
"groupEdit": 2,
"targetBlank": false,
"title": "Contact",
"shortTitle": "Contact",
@ -209,6 +217,7 @@
"parentPageId": "",
"position": 0,
"group": 0,
"groupEdit": 2,
"targetBlank": false,
"title": "Sidebar",
"shortTitle": "Sidebar",
@ -233,6 +242,7 @@
"parentPageId": "",
"position": 0,
"group": 0,
"groupEdit": 2,
"targetBlank": false,
"title": "Sidebar with menu",
"shortTitle": "Sidebar with menu",
@ -257,6 +267,7 @@
"parentPageId": "",
"position": 0,
"group": 0,
"groupEdit": 2,
"targetBlank": false,
"title": "Legal notices",
"shortTitle": "Legal notices",
@ -282,6 +293,7 @@
"parentPageId": "",
"position": 0,
"group": 0,
"groupEdit": 2,
"targetBlank": false,
"title": "Maintenance in progress",
"shortTitle": "Maintenance in progress",
@ -307,6 +319,7 @@
"parentPageId": "",
"position": 0,
"group": 0,
"groupEdit": 2,
"targetBlank": false,
"title": "Error 403",
"shortTitle": "Error 403",
@ -332,6 +345,7 @@
"parentPageId": "",
"position": 0,
"group": 0,
"groupEdit": 2,
"targetBlank": false,
"title": "Error 404",
"shortTitle": "Error 404",
@ -356,6 +370,7 @@
"parentPageId": "",
"position": 8,
"group": 0,
"groupEdit": 2,
"targetBlank": false,
"title": "Search in the site",
"shortTitle": "Search",
@ -383,6 +398,7 @@
"parentPageId": "",
"position": 2,
"group": 0,
"groupEdit": 2,
"targetBlank": false,
"title": "Editing",
"shortTitle": "Editing",

View File

@ -5,7 +5,7 @@
"feeds": true,
"feedsLabel": "Syndication RSS",
"itemsperPage": 4,
"versionData": "6.4"
"versionData": "6.5"
},
"texts": {
"NoComment": "Pas encore de commentaire",
@ -120,7 +120,7 @@
"style": "site\/data\/gallery\/galeries\/theme.css"
},
"config": {
"versionData": "4.1"
"versionData": "4.2"
}
},
"deltacms": {
@ -141,7 +141,7 @@
"logoUrl": "",
"logoWidth": "40",
"maxSizeUpload": "1000000",
"versionData": "4.4",
"versionData": "4.5",
"uploadJpg": true,
"uploadPng": true,
"uploadPdf": false,
@ -187,7 +187,7 @@
"resultHideContent": false,
"placeHolder": "Un ou plusieurs mots-clés séparés par un espace ou par +",
"submitText": "Rechercher",
"versionData": "3.2",
"versionData": "3.3",
"nearWordText": "Mots approchants",
"successTitle": "Résultat de votre recherche",
"failureTitle": "Aucun résultat",

View File

@ -14,6 +14,7 @@
"parentPageId": "",
"position": 1,
"group": 0,
"groupEdit": 2,
"targetBlank": false,
"title": "Accueil",
"shortTitle": "Accueil",
@ -39,6 +40,7 @@
"modulePosition": "bottom",
"position": 3,
"group": 1,
"groupEdit": 2,
"targetBlank": false,
"title": "Page privée",
"shortTitle": "Privée",
@ -63,6 +65,7 @@
"parentPageId": "edition",
"position": 2,
"group": 0,
"groupEdit": 2,
"targetBlank": false,
"title": "Barre latérale avec menu",
"shortTitle": "Menu latéral",
@ -88,6 +91,7 @@
"parentPageId": "",
"position": 4,
"group": 0,
"groupEdit": 2,
"targetBlank": false,
"title": "Blog",
"shortTitle": "Blog",
@ -112,6 +116,7 @@
"parentPageId": "",
"position": 6,
"group": 0,
"groupEdit": 2,
"targetBlank": false,
"title": "Galeries d'images",
"shortTitle": "Galeries",
@ -136,6 +141,7 @@
"parentPageId": "",
"position": 5,
"group": 0,
"groupEdit": 2,
"targetBlank": true,
"title": "Deltacms",
"shortTitle": "Deltacms",
@ -160,6 +166,7 @@
"parentPageId": "",
"position": 7,
"group": 0,
"groupEdit": 2,
"targetBlank": false,
"title": "Contact",
"shortTitle": "Contact",
@ -185,6 +192,7 @@
"parentPageId": "",
"position": 0,
"group": 0,
"groupEdit": 2,
"targetBlank": false,
"title": "Barre latérale",
"shortTitle": "Barre latérale",
@ -209,6 +217,7 @@
"parentPageId": "",
"position": 0,
"group": 0,
"groupEdit": 2,
"targetBlank": false,
"title": "Barre latérale avec menu",
"shortTitle": "Barre latérale avec menu",
@ -233,6 +242,7 @@
"parentPageId": "",
"position": 0,
"group": 0,
"groupEdit": 2,
"targetBlank": false,
"title": "Mentions légales",
"shortTitle": "Mentions légales",
@ -258,6 +268,7 @@
"parentPageId": "",
"position": 0,
"group": 0,
"groupEdit": 2,
"targetBlank": false,
"title": "Maintenance en cours",
"shortTitle": "Maintenance en cours",
@ -283,6 +294,7 @@
"parentPageId": "",
"position": 0,
"group": 0,
"groupEdit": 2,
"targetBlank": false,
"title": "Erreur 403",
"shortTitle": "Erreur 403",
@ -307,6 +319,7 @@
"parentPageId": "",
"position": 0,
"group": 0,
"groupEdit": 2,
"targetBlank": false,
"title": "Erreur 404",
"shortTitle": "Erreur 404",
@ -331,6 +344,7 @@
"parentPageId": "",
"position": 8,
"group": 0,
"groupEdit": 2,
"targetBlank": false,
"title": "Recherche dans le site",
"shortTitle": "Rechercher",
@ -355,6 +369,7 @@
"parentPageId": "edition",
"position": 1,
"group": 0,
"groupEdit": 2,
"targetBlank": false,
"title": "Barre latérale",
"shortTitle": "Barre latérale",
@ -380,6 +395,7 @@
"parentPageId": "",
"position": 2,
"group": 0,
"groupEdit": 2,
"targetBlank": false,
"title": "Edition",
"shortTitle": "Edition",

View File

@ -15,6 +15,7 @@
"parentPageId": "",
"position": 1,
"group": 0,
"groupEdit": 2,
"targetBlank": false,
"title": "Home",
"shortTitle": "Home",

View File

@ -115,6 +115,7 @@ class init extends common {
'parentPageId' => '',
'position' => 1,
'group' => self::GROUP_VISITOR,
'groupEdit' => self::GROUP_EDITOR,
'targetBlank' => false,
'title' => 'Accueil',
'shortTitle' => 'Accueil',

View File

@ -44,7 +44,7 @@ $text['core_page_view']['edit'][40] = 'Breadcrumb';
$text['core_page_view']['edit'][41] = "Are you sure you want to delete this page ?";
$text['core_page_view']['edit'][42] = "The data in the module ";
$text['core_page_view']['edit'][43] = " will be deleted. Do you confirm?";
$text['core_page_view']['edit'][44] = "Minimum group to edit page";
$text['core_page_view']['edit'][44] = "Group required to edit the page :";
$text['core_page_view']['edit'][45] = "You do not have editing rights, contact an administrator.";
// Tinymce et Flatpickr
@ -95,4 +95,8 @@ $groupEdit = [
self::GROUP_MODERATOR => 'Moderator',
self::GROUP_ADMIN => 'Administrator'
];
$groupEditModerator = [
self::GROUP_EDITOR => 'Editor',
self::GROUP_MODERATOR => 'Moderator'
];
?>

View File

@ -44,7 +44,7 @@ $text['core_page_view']['edit'][40] = 'Fil d\'Ariane';
$text['core_page_view']['edit'][41] = "Êtes-vous sûr de vouloir supprimer cette page ?";
$text['core_page_view']['edit'][42] = "Les données du module ";
$text['core_page_view']['edit'][43] = " seront effacées. Confirmez-vous ?";
$text['core_page_view']['edit'][44] = "Groupe minimum pour éditer la page";
$text['core_page_view']['edit'][44] = "Groupe requis pour modifier la page :";
$text['core_page_view']['edit'][45] = "Vous n'avez pas les droits d'édition, contactez un administrateur.";
@ -97,4 +97,8 @@ $groupEdit = [
self::GROUP_MODERATOR => 'Modérateur',
self::GROUP_ADMIN => 'Administrateur'
];
$groupEditModerator = [
self::GROUP_EDITOR => 'Editeur',
self::GROUP_MODERATOR => 'Modérateur'
];
?>

View File

@ -16,343 +16,331 @@ if ($this->getData(['page', $this->getUrl(2), 'moduleId']) === 'snipcart' ){
}
echo '<link rel="stylesheet" href="' . helper::baseUrl(false) . 'core/vendor/tinymce/init.css' . '">';
// Droit d'édition ?
if( null != $this->getData(['page', $this->getUrl(2), 'groupEdit']) && $this->getUser('group') < $this->getData(['page', $this->getUrl(2), 'groupEdit'])){ ?>
echo template::formOpen('pageEditForm'); ?>
<div class="row">
<div class="col2">
<?php $href = helper::baseUrl() . $this->getUrl(2); ?>
<?php if ($this->getData(['page', $this->getUrl(2), 'moduleId']) === 'redirection' || 'code')$href = helper::baseUrl(); ?>
<?php echo template::button('pageEditBack', [
'class' => 'buttonGrey',
'href' => $href,
'ico' => 'left',
'value' => $text['core_page_view']['edit'][0]
]); ?>
</div>
<div class="col2">
<?php echo template::button('pageEditHelp', [
'href' => 'https://doc.deltacms.fr/edition',
'target' => '_blank',
'ico' => 'help',
'value' => $text['core_page_view']['edit'][1],
'class' => 'buttonHelp'
]); ?>
</div>
<div class="col2 offset2">
<?php if($this->getUser('group') >= self::GROUP_MODERATOR) { echo template::button('pageEditDuplicate', [
'href' => helper::baseUrl() . 'page/duplicate/' . $this->getUrl(2) . '&csrf=' . $_SESSION['csrf'],
'value' => $text['core_page_view']['edit'][2],
'ico' => 'clone'
]); } ?>
</div>
<div class="col2">
<?php if($this->getUser('group') >= self::GROUP_MODERATOR) { echo template::button('pageEditDelete', [
'class' => 'buttonRed',
'href' => helper::baseUrl() . 'page/delete/' . $this->getUrl(2) . '&csrf=' . $_SESSION['csrf'],
'value' => $text['core_page_view']['edit'][3],
'ico' => 'cancel'
]); } ?>
</div>
<div class="col2">
<?php echo template::submit('pageEditSubmit', [
'uniqueSubmission' => true,
'value' => $text['core_page_view']['edit'][4]
]); ?>
</div>
</div>
<div class="row">
<div class="col12">
<?php echo template::text('pageEditDroitsEdit', [
'label' => '',
'value' => $text['core_page_view']['edit'][45]
<div class="block" id="info">
<h4><?php echo $text['core_page_view']['edit'][5]; ?>
<span id="specialeHelpButton" class="helpDisplayButton">
<a href="https://doc.deltacms.fr/informations-generales" target="_blank">
<?php echo template::ico('help', 'left');?>
</a>
</span>
</h4>
<div class="row">
<div class="col6">
<?php echo template::text('pageEditTitle', [
'label' => $text['core_page_view']['edit'][6],
'value' => $this->getData(['page', $this->getUrl(2), 'title'])
]); ?>
</div>
<div class="col2">
<?php echo template::text('pageEditShortTitle', [
'label' => $text['core_page_view']['edit'][7],
'value' => $this->getData(['page', $this->getUrl(2), 'shortTitle']),
'help' => $text['core_page_view']['edit'][8]
]); ?>
</div>
<div class="col4">
<div class="row" <?php if($this->getUser('group') < self::GROUP_MODERATOR) { echo 'style="display: none;"'; } ?>>
<div class="col9">
<?php echo template::hidden('pageEditModuleRedirect'); ?>
<?php echo template::select('pageEditModuleId', $module::$moduleIds, [
'help' => $text['core_page_view']['edit'][9],
'label' => $text['core_page_view']['edit'][10],
'selected' => $this->getData(['page', $this->getUrl(2), 'moduleId'])
]); ?>
<?php echo template::hidden('pageEditModuleIdOld',['value' => $this->getData(['page', $this->getUrl(2), 'moduleId'])]); ?>
<?php echo template::hidden('pageEditModuleIdOldText',[
'value' => array_key_exists($this->getData(['page', $this->getUrl(2), 'moduleId']),$module::$moduleIds)? $module::$moduleIds[$this->getData(['page', $this->getUrl(2), 'moduleId'])] : ucfirst($this->getData(['page', $this->getUrl(2), 'moduleId']))
]); ?>
</div>
<div class="col3 verticalAlignBottom">
<?php $state = true;
if( null !== $this->getData(['page', $this->getUrl(2), 'moduleId']) && $this->getData(['page', $this->getUrl(2), 'moduleId']) !== '' ) $state= false?>
<?php echo template::button('pageEditModuleConfig', [
//'disabled' => (bool) $this->getData(['page', $this->getUrl(2), 'moduleId']) === false,
'disabled' => $state,
'uniqueSubmission' => true,
'value' => template::ico('gear')
]); ?>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col4">
<?php echo template::select('pageTypeMenu', $typeMenu,[
'label' => $text['core_page_view']['edit'][11],
'selected' => $this->getData(['page', $this->getUrl(2), 'typeMenu'])
]); ?>
</div>
<div class="col4">
<?php echo template::file('pageIconUrl', [
'help' => $text['core_page_view']['edit'][12],
'label' => $text['core_page_view']['edit'][13],
'value' => $this->getData(['page', $this->getUrl(2), 'iconUrl'])
]); ?>
</div>
<div class="col4">
<?php echo template::select('configModulePosition', $modulePosition,[
'help' => $text['core_page_view']['edit'][14],
'label' => $text['core_page_view']['edit'][15],
'selected' => $this->getData(['page', $this->getUrl(2), 'modulePosition'])
]); ?>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col12">
<?php echo template::textarea('pageEditContent', [
'class' => 'editorWysiwyg',
//'value' => file_get_contents(self::DATA_DIR . self::$i18n . '/content/' . $this->getData(['page', $this->getUrl(2), 'content']))
'value' => $this->getPage($this->getUrl(2), self::$i18n)
]); ?>
</div>
</div>
<?php
} else {
echo template::formOpen('pageEditForm'); ?>
<div class="row">
<div class="col2">
<?php $href = helper::baseUrl() . $this->getUrl(2); ?>
<?php if ($this->getData(['page', $this->getUrl(2), 'moduleId']) === 'redirection' || 'code')$href = helper::baseUrl(); ?>
<?php echo template::button('pageEditBack', [
'class' => 'buttonGrey',
'href' => $href,
'ico' => 'left',
'value' => $text['core_page_view']['edit'][0]
]); ?>
</div>
<div class="col2">
<?php echo template::button('pageEditHelp', [
'href' => 'https://doc.deltacms.fr/edition',
'target' => '_blank',
'ico' => 'help',
'value' => $text['core_page_view']['edit'][1],
'class' => 'buttonHelp'
]); ?>
</div>
<div class="col2 offset2">
<?php if($this->getUser('group') >= self::GROUP_MODERATOR) { echo template::button('pageEditDuplicate', [
'href' => helper::baseUrl() . 'page/duplicate/' . $this->getUrl(2) . '&csrf=' . $_SESSION['csrf'],
'value' => $text['core_page_view']['edit'][2],
'ico' => 'clone'
]); } ?>
</div>
<div class="col2">
<?php if($this->getUser('group') >= self::GROUP_MODERATOR) { echo template::button('pageEditDelete', [
'class' => 'buttonRed',
'href' => helper::baseUrl() . 'page/delete/' . $this->getUrl(2) . '&csrf=' . $_SESSION['csrf'],
'value' => $text['core_page_view']['edit'][3],
'ico' => 'cancel'
]); } ?>
</div>
<div class="col2">
<?php echo template::submit('pageEditSubmit', [
'uniqueSubmission' => true,
'value' => $text['core_page_view']['edit'][4]
]); ?>
</div>
</div>
<div class="row">
<div class="col12">
<div class="block" id="info">
<h4><?php echo $text['core_page_view']['edit'][5]; ?>
<span id="specialeHelpButton" class="helpDisplayButton">
<a href="https://doc.deltacms.fr/informations-generales" target="_blank">
<?php echo template::ico('help', 'left');?>
</a>
</span>
</h4>
<div class="row">
<div class="col6">
<?php echo template::text('pageEditTitle', [
'label' => $text['core_page_view']['edit'][6],
'value' => $this->getData(['page', $this->getUrl(2), 'title'])
]); ?>
</div>
<div class="col2">
<?php echo template::text('pageEditShortTitle', [
'label' => $text['core_page_view']['edit'][7],
'value' => $this->getData(['page', $this->getUrl(2), 'shortTitle']),
'help' => $text['core_page_view']['edit'][8]
]); ?>
</div>
<div class="col4">
<div class="row" <?php if($this->getUser('group') < self::GROUP_MODERATOR) { echo 'style="display: none;"'; } ?>>
<div class="col9">
<?php echo template::hidden('pageEditModuleRedirect'); ?>
<?php echo template::select('pageEditModuleId', $module::$moduleIds, [
'help' => $text['core_page_view']['edit'][9],
'label' => $text['core_page_view']['edit'][10],
'selected' => $this->getData(['page', $this->getUrl(2), 'moduleId'])
]); ?>
<?php echo template::hidden('pageEditModuleIdOld',['value' => $this->getData(['page', $this->getUrl(2), 'moduleId'])]); ?>
<?php echo template::hidden('pageEditModuleIdOldText',[
'value' => array_key_exists($this->getData(['page', $this->getUrl(2), 'moduleId']),$module::$moduleIds)? $module::$moduleIds[$this->getData(['page', $this->getUrl(2), 'moduleId'])] : ucfirst($this->getData(['page', $this->getUrl(2), 'moduleId']))
]); ?>
</div>
<div class="col3 verticalAlignBottom">
<?php $state = true;
if( null !== $this->getData(['page', $this->getUrl(2), 'moduleId']) && $this->getData(['page', $this->getUrl(2), 'moduleId']) !== '' ) $state= false?>
<?php echo template::button('pageEditModuleConfig', [
//'disabled' => (bool) $this->getData(['page', $this->getUrl(2), 'moduleId']) === false,
'disabled' => $state,
'uniqueSubmission' => true,
'value' => template::ico('gear')
]); ?>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col4">
<?php echo template::select('pageTypeMenu', $typeMenu,[
'label' => $text['core_page_view']['edit'][11],
'selected' => $this->getData(['page', $this->getUrl(2), 'typeMenu'])
]); ?>
</div>
<div class="col4">
<?php echo template::file('pageIconUrl', [
'help' => $text['core_page_view']['edit'][12],
'label' => $text['core_page_view']['edit'][13],
'value' => $this->getData(['page', $this->getUrl(2), 'iconUrl'])
]); ?>
</div>
<div class="col4">
<?php echo template::select('configModulePosition', $modulePosition,[
'help' => $text['core_page_view']['edit'][14],
'label' => $text['core_page_view']['edit'][15],
'selected' => $this->getData(['page', $this->getUrl(2), 'modulePosition'])
]); ?>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col12">
<?php echo template::textarea('pageEditContent', [
'class' => 'editorWysiwyg',
//'value' => file_get_contents(self::DATA_DIR . self::$i18n . '/content/' . $this->getData(['page', $this->getUrl(2), 'content']))
'value' => $this->getPage($this->getUrl(2), self::$i18n)
]); ?>
</div>
</div>
<?php
if($this->getUser('group') < self::GROUP_MODERATOR) {
echo '<div style="display: none;">';
}
else {
echo '<div style="display: block;">';
}
?>
<div class="row">
<div class="col12" id="pageEditBlockLayout">
<div class="block">
<h4><?php echo $text['core_page_view']['edit'][16]; ?>
<span id="specialeHelpButton" class="helpDisplayButton">
<a href="https://doc.deltacms.fr/mise-en-page" target="_blank">
<?php echo template::ico('help', 'left');?>
</a>
</span>
</h4>
<div class="blockContainer">
<div class="row">
<div class="col6">
<div class="row">
<div class="col12">
<?php echo template::select('pageEditBlock', $pageBlocks, [
'label' => $text['core_page_view']['edit'][17],
'help' => $text['core_page_view']['edit'][18],
'selected' => $this->getData(['page', $this->getUrl(2) , 'block'])
]); ?>
</div>
</div>
</div>
<div class="col6">
<!-- Sélection des barres latérales -->
<?php if($this->getHierarchy($this->getUrl(2),false,true)): ?>
<?php echo template::hidden('pageEditBarLeft', [
'value' => $this->getData(['page', $this->getUrl(2), 'barLeft'])
]); ?>
<?php else: ?>
<?php echo template::select('pageEditBarLeft', $module::$pagesBarId, [
'label' => $text['core_page_view']['edit'][19],
'selected' => $this->getData(['page', $this->getUrl(2), 'barLeft'])
]); ?>
<?php endif; ?>
<?php if($this->getHierarchy($this->getUrl(2),false,true)): ?>
<?php echo template::hidden('pageEditBarRight', [
'value' => $this->getData(['page', $this->getUrl(2), 'barRight'])
]); ?>
<?php else: ?>
<?php echo template::select('pageEditBarRight', $module::$pagesBarId, [
'label' => $text['core_page_view']['edit'][20],
'selected' => $this->getData(['page', $this->getUrl(2), 'barRight'])
]); ?>
<?php endif; ?>
<?php echo template::select('pageEditDisplayMenu', $displayMenu, [
'label' => $text['core_page_view']['edit'][21],
'selected' => $this->getData(['page', $this->getUrl(2), 'displayMenu']),
'help' => $text['core_page_view']['edit'][22]
]); ?>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="row">
<div class="col12" id="pageEditMenu">
<div class="block">
<h4><?php echo $text['core_page_view']['edit'][23]; ?>
<span id="specialeHelpButton" class="helpDisplayButton">
<a href="https://doc.deltacms.fr/emplacement-dans-le-menu" target="_blank">
<?php echo template::ico('help', 'left');?>
</a>
</span>
</h4>
<div class="blockContainer">
<div class="row">
<div class="col6">
<?php echo template::select('pageEditPosition', [], [
'label' => $text['core_page_view']['edit'][24],
'help' => $text['core_page_view']['edit'][25]
]); ?>
</div>
<div class="col6">
<?php if($this->getHierarchy($this->getUrl(2), false)): ?>
<?php echo template::hidden('pageEditParentPageId', [
'value' => $this->getData(['page', $this->getUrl(2), 'parentPageId'])
]); ?>
<?php else: ?>
<?php echo template::select('pageEditParentPageId', $module::$pagesNoParentId, [
'label' => $text['core_page_view']['edit'][26],
'selected' => $this->getData(['page', $this->getUrl(2), 'parentPageId'])
]); ?>
<?php endif; ?>
</div>
</div>
<div class="row">
<div class="col6">
<?php echo template::checkbox('pageEditDisable', true, $text['core_page_view']['edit'][37], [
'checked' => $this->getData(['page', $this->getUrl(2), 'disable']),
'help' => $text['core_page_view']['edit'][27]
]); ?>
</div>
<div class="col6">
<?php echo template::checkbox('pageEditTargetBlank', true, $text['core_page_view']['edit'][38], [
'checked' => $this->getData(['page', $this->getUrl(2), 'targetBlank'])
]); ?>
</div>
</div>
<div class="row">
<div class="col6">
<?php echo template::checkbox('pageEditHideTitle', true, $text['core_page_view']['edit'][39], [
'checked' => $this->getData(['page', $this->getUrl(2), 'hideTitle'])
]); ?>
</div>
<div class="col6">
<?php echo template::checkbox('pageEditbreadCrumb', true, $text['core_page_view']['edit'][40], [
'checked' => $this->getData(['page', $this->getUrl(2), 'breadCrumb']),
'help' => $text['core_page_view']['edit'][28]
]); ?>
</div>
</div>
</div>
</div>
</div>
</div>
<div class='row' id="pageEditAdvancedWrapper">
<div class="col12">
<div class="block">
<h4><?php echo $text['core_page_view']['edit'][29]; ?>
<span id="specialeHelpButton" class="helpDisplayButton">
<a href="https://doc.deltacms.fr/options-d-emplacement-avancees" target="_blank">
<?php echo template::ico('help', 'left');?>
</a>
</span>
</h4>
<div class="blockContainer">
<div class="row">
<div class="col6">
<?php echo template::checkbox('pageEditHideMenuChildren', true, $text['core_page_view']['edit'][30], [
'checked' => $this->getData(['page', $this->getUrl(2), 'hideMenuChildren'])
]); ?>
</div>
<div class="col6">
<?php echo template::checkbox('pageEditHideMenuSide', true, $text['core_page_view']['edit'][31] , [
'checked' => $this->getData(['page', $this->getUrl(2), 'hideMenuSide']),
'help' => $text['core_page_view']['edit'][32]
]); ?>
</div>
</div>
</div>
</div>
</div>
</div>
<div class='row' id="pageEditSeoWrapper">
<div class="col12">
<div class="block">
<h4><?php echo $text['core_page_view']['edit'][33]; ?>
if($this->getUser('group') < self::GROUP_MODERATOR) {
echo '<div style="display: none;">';
}
else {
echo '<div style="display: block;">';
}
?>
<div class="row">
<div class="col12" id="pageEditBlockLayout">
<div class="block">
<h4><?php echo $text['core_page_view']['edit'][16]; ?>
<span id="specialeHelpButton" class="helpDisplayButton">
<a href="https://doc.deltacms.fr/permission-et-referencement" target="_blank">
<a href="https://doc.deltacms.fr/mise-en-page" target="_blank">
<?php echo template::ico('help', 'left');?>
</a>
</span>
</h4>
<div class="blockContainer">
<div class="row">
<div class='col6'>
<?php echo template::select('pageEditGroup', $groupPublics, [
'label' => $text['core_page_view']['edit'][34],
'selected' => $this->getData(['page', $this->getUrl(2), 'group'])
]); ?>
</h4>
<div class="blockContainer">
<div class="row">
<div class="col6">
<div class="row">
<div class="col12">
<?php echo template::select('pageEditBlock', $pageBlocks, [
'label' => $text['core_page_view']['edit'][17],
'help' => $text['core_page_view']['edit'][18],
'selected' => $this->getData(['page', $this->getUrl(2) , 'block'])
]); ?>
</div>
</div>
<div class='col6'>
<?php echo template::select('pageEditGroupEdit', $groupEdit, [
'label' => $text['core_page_view']['edit'][44],
'selected' => $this->getData(['page', $this->getUrl(2), 'groupEdit'])
</div>
<div class="col6">
<!-- Sélection des barres latérales -->
<?php if($this->getHierarchy($this->getUrl(2),false,true)): ?>
<?php echo template::hidden('pageEditBarLeft', [
'value' => $this->getData(['page', $this->getUrl(2), 'barLeft'])
]); ?>
</div>
<div class='col12'>
<?php echo template::text('pageEditMetaTitle', [
'label' => $text['core_page_view']['edit'][35],
'value' => $this->getData(['page', $this->getUrl(2), 'metaTitle'])
<?php else: ?>
<?php echo template::select('pageEditBarLeft', $module::$pagesBarId, [
'label' => $text['core_page_view']['edit'][19],
'selected' => $this->getData(['page', $this->getUrl(2), 'barLeft'])
]); ?>
<?php echo template::textarea('pageEditMetaDescription', [
'label' => $text['core_page_view']['edit'][36],
//'maxlength' => '500',
'value' => $this->getData(['page', $this->getUrl(2), 'metaDescription'])
<?php endif; ?>
<?php if($this->getHierarchy($this->getUrl(2),false,true)): ?>
<?php echo template::hidden('pageEditBarRight', [
'value' => $this->getData(['page', $this->getUrl(2), 'barRight'])
]); ?>
</div>
<?php else: ?>
<?php echo template::select('pageEditBarRight', $module::$pagesBarId, [
'label' => $text['core_page_view']['edit'][20],
'selected' => $this->getData(['page', $this->getUrl(2), 'barRight'])
]); ?>
<?php endif; ?>
<?php echo template::select('pageEditDisplayMenu', $displayMenu, [
'label' => $text['core_page_view']['edit'][21],
'selected' => $this->getData(['page', $this->getUrl(2), 'displayMenu']),
'help' => $text['core_page_view']['edit'][22]
]); ?>
</div>
</div>
</div>
</div>
</div>
</div><!-- conditionnelle -->
<?php echo template::formClose();
} ?>
</div>
<div class="row">
<div class="col12" id="pageEditMenu">
<div class="block">
<h4><?php echo $text['core_page_view']['edit'][23]; ?>
<span id="specialeHelpButton" class="helpDisplayButton">
<a href="https://doc.deltacms.fr/emplacement-dans-le-menu" target="_blank">
<?php echo template::ico('help', 'left');?>
</a>
</span>
</h4>
<div class="blockContainer">
<div class="row">
<div class="col6">
<?php echo template::select('pageEditPosition', [], [
'label' => $text['core_page_view']['edit'][24],
'help' => $text['core_page_view']['edit'][25]
]); ?>
</div>
<div class="col6">
<?php if($this->getHierarchy($this->getUrl(2), false)): ?>
<?php echo template::hidden('pageEditParentPageId', [
'value' => $this->getData(['page', $this->getUrl(2), 'parentPageId'])
]); ?>
<?php else: ?>
<?php echo template::select('pageEditParentPageId', $module::$pagesNoParentId, [
'label' => $text['core_page_view']['edit'][26],
'selected' => $this->getData(['page', $this->getUrl(2), 'parentPageId'])
]); ?>
<?php endif; ?>
</div>
</div>
<div class="row">
<div class="col6">
<?php echo template::checkbox('pageEditDisable', true, $text['core_page_view']['edit'][37], [
'checked' => $this->getData(['page', $this->getUrl(2), 'disable']),
'help' => $text['core_page_view']['edit'][27]
]); ?>
</div>
<div class="col6">
<?php echo template::checkbox('pageEditTargetBlank', true, $text['core_page_view']['edit'][38], [
'checked' => $this->getData(['page', $this->getUrl(2), 'targetBlank'])
]); ?>
</div>
</div>
<div class="row">
<div class="col6">
<?php echo template::checkbox('pageEditHideTitle', true, $text['core_page_view']['edit'][39], [
'checked' => $this->getData(['page', $this->getUrl(2), 'hideTitle'])
]); ?>
</div>
<div class="col6">
<?php echo template::checkbox('pageEditbreadCrumb', true, $text['core_page_view']['edit'][40], [
'checked' => $this->getData(['page', $this->getUrl(2), 'breadCrumb']),
'help' => $text['core_page_view']['edit'][28]
]); ?>
</div>
</div>
</div>
</div>
</div>
</div>
<div class='row' id="pageEditAdvancedWrapper">
<div class="col12">
<div class="block">
<h4><?php echo $text['core_page_view']['edit'][29]; ?>
<span id="specialeHelpButton" class="helpDisplayButton">
<a href="https://doc.deltacms.fr/options-d-emplacement-avancees" target="_blank">
<?php echo template::ico('help', 'left');?>
</a>
</span>
</h4>
<div class="blockContainer">
<div class="row">
<div class="col6">
<?php echo template::checkbox('pageEditHideMenuChildren', true, $text['core_page_view']['edit'][30], [
'checked' => $this->getData(['page', $this->getUrl(2), 'hideMenuChildren'])
]); ?>
</div>
<div class="col6">
<?php echo template::checkbox('pageEditHideMenuSide', true, $text['core_page_view']['edit'][31] , [
'checked' => $this->getData(['page', $this->getUrl(2), 'hideMenuSide']),
'help' => $text['core_page_view']['edit'][32]
]); ?>
</div>
</div>
</div>
</div>
</div>
</div>
<div class='row' id="pageEditSeoWrapper">
<div class="col12">
<div class="block">
<h4><?php echo $text['core_page_view']['edit'][33]; ?>
<span id="specialeHelpButton" class="helpDisplayButton">
<a href="https://doc.deltacms.fr/permission-et-referencement" target="_blank">
<?php echo template::ico('help', 'left');?>
</a>
</span>
</h4>
<div class="blockContainer">
<div class="row">
<div class='col6'>
<?php echo template::select('pageEditGroup', $groupPublics, [
'label' => $text['core_page_view']['edit'][34],
'selected' => $this->getData(['page', $this->getUrl(2), 'group'])
]); ?>
</div>
<div class='col6'>
<?php if( $this->getUser('group') === self::GROUP_MODERATOR ) $groupEdit = $groupEditModerator;
echo template::select('pageEditGroupEdit', $groupEdit, [
'label' => $text['core_page_view']['edit'][44],
'selected' => $this->getData(['page', $this->getUrl(2), 'groupEdit'])
]); ?>
</div>
<div class='col12'>
<?php echo template::text('pageEditMetaTitle', [
'label' => $text['core_page_view']['edit'][35],
'value' => $this->getData(['page', $this->getUrl(2), 'metaTitle'])
]); ?>
<?php echo template::textarea('pageEditMetaDescription', [
'label' => $text['core_page_view']['edit'][36],
//'maxlength' => '500',
'value' => $this->getData(['page', $this->getUrl(2), 'metaDescription'])
]); ?>
</div>
</div>
</div>
</div>
</div>
</div>
</div><!-- conditionnelle -->
<?php echo template::formClose(); ?>
<script>
var textConfirm = <?php echo '"'.$text['core_page_view']['edit'][41].'"'; ?>;

View File

@ -765,6 +765,11 @@ class blog extends common {
else {
// Soumission du formulaire
if($this->isPost()) {
// Sauve le contenu dans un brouillon
// $this->setData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'comment', $commentId, 'draft', 'content', $this->getInput('blogArticleContent', false) ]);
$_SESSION['commentAuthor'] = $this->getInput('blogArticleAuthor', false);
$_SESSION['commentContent'] = $this->getInput('blogArticleContent', false);
$detectBot ='';
// Check la captcha
if( $this->getUser('password') !== $this->getInput('DELTA_USER_PASSWORD') ){
@ -845,6 +850,7 @@ class blog extends common {
'state' => true
]);
}
$_SESSION['commentContent'] = '';
} else {
// Valeurs en sortie
$this->addOutput([

View File

@ -143,7 +143,8 @@ if( function_exists('datefmt_create') && function_exists('datefmt_create') && ex
<div class="row">
<div class="col9 humanBot">
<?php echo template::text('blogArticleAuthor', [
'label' => $this->getData(['module', $this->getUrl(0), 'texts', 'Name'])
'label' => $this->getData(['module', $this->getUrl(0), 'texts', 'Name']),
'value' => isset( $_SESSION['commentAuthor'] ) ? $_SESSION['commentAuthor'] : ''
]); ?>
</div>
<div class="col1 textAlignCenter verticalAlignBottom">
@ -166,7 +167,8 @@ if( function_exists('datefmt_create') && function_exists('datefmt_create') && ex
'TinymceMaxi' => $this->getData(['module', $this->getUrl(0), 'texts', 'TinymceMaxi']),
'TinymceCara' => $this->getData(['module', $this->getUrl(0), 'texts', 'TinymceCara']),
'TinymceExceed' => $this->getData(['module', $this->getUrl(0), 'texts', 'TinymceExceed']),
'caracteres' => $this->getData(['module', $this->getUrl(0), 'texts', 'Cara'])
'caracteres' => $this->getData(['module', $this->getUrl(0), 'texts', 'Cara']),
'value' => isset( $_SESSION['commentContent'] ) ? $_SESSION['commentContent'] : ''
]); ?>
</div>
<div id="blogArticleContentAlarm"> </div>

View File

@ -737,12 +737,12 @@ class galleriesHelper extends helper {
* @return array
*/
public static function scanDir($dir) {
$exclu = ["agenda", "backup", "fonts", "icones", "modules", "theme", "video"];
$exclu = array ("agenda","theme", "fonts", "icones", "backup");
$dirContent = [];
$iterator = new DirectoryIterator($dir);
foreach($iterator as $fileInfos) {
if($fileInfos->isDot() === false AND $fileInfos->isDir()) {
if(in_array($fileInfos, $exclu)) { continue; }
if(in_array($fileInfos, $exclu)) continue;
$dirContent[] = $dir . '/' . $fileInfos->getBasename();
$dirContent = array_merge($dirContent, self::scanDir($dir . '/' . $fileInfos->getBasename()));
}