diff --git a/CHANGES.md b/CHANGES.md index 82bc706..b91fe92 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,5 +1,14 @@ # Changelog +## Version 5.0.03 de Deltacms +- Modifications : + - module Blog : nouvelle structure pour l'enregistrement des données de pages utilisant ce module, pour alléger le fichier module.json commun à l'ensembles des modules, + - +- Correction : + - Filemanager : correction d'instructions dépréciées. +- Sur le site : + - + ## Version 5.0.02 de Deltacms - Modifications : - animation et réduction du panneau cookies, diff --git a/README.md b/README.md index e8f0238..011b3e6 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ -# DeltaCMS 5.0.02 +# DeltaCMS 5.0.03 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 trilingue espagnol (castillan), anglais ou français, le site peut être rédigé dans une langue quelconque. @@ -87,7 +87,7 @@ En cas de difficulté avec la nouvelle version, il suffira de téléverser la sa [R] content Dossier des contenus de page [F] accueil.html Exemple contenu de la page d'accueil [R] data_module Données volumineuses des pages avec module - [F] ma_page.json Exemple de page avec données volumineuses, un fichier par page + [F] blog.json Exemple de page avec données volumineuses, un fichier par page [R] *modules* Un dossier par module, exemple [R]search [R]agenda, pour les données du module [F] admin.css Thème des pages d'administration [F] admin.json Données de thème des pages d'administration diff --git a/core/core.php b/core/core.php index 90add99..2648b9c 100644 --- a/core/core.php +++ b/core/core.php @@ -52,7 +52,7 @@ class common { // Numéro de version const DELTA_UPDATE_URL = 'https://update.deltacms.fr/master/'; - const DELTA_VERSION = '5.0.02'; + const DELTA_VERSION = '5.0.03'; const DELTA_UPDATE_CHANNEL = "v5"; public static $actions = []; diff --git a/core/include/comment.inc.php b/core/include/comment.inc.php index 22fcd96..9a2cddb 100644 --- a/core/include/comment.inc.php +++ b/core/include/comment.inc.php @@ -231,8 +231,8 @@ switch ($lang) { break; } // Si la langue n'est pas supportée par Tinymce la langue d'administration est utilisée -if( ! file_exists( 'core/vendor/tinymce/langs/'.$lang_page.'.js' )){ - $lang_page = $lang_admin; +if( ! file_exists( 'core/vendor/tinymce/langs/'.$lang_page.'.js' )){ + $lang_page = $text['core']['showComment'][7]; } echo ''; // Vendor tinymce ?> diff --git a/core/include/update.inc.php b/core/include/update.inc.php index 7aa9f39..e77fff2 100644 --- a/core/include/update.inc.php +++ b/core/include/update.inc.php @@ -212,4 +212,7 @@ if ($this->getData(['core', 'dataVersion']) < 5002) { } $this->setData(['core', 'dataVersion', 5002]); } +if ($this->getData(['core', 'dataVersion']) < 5003) { + $this->setData(['core', 'dataVersion', 5003]); +} ?> diff --git a/core/lang/en/lex_core.php b/core/lang/en/lex_core.php index 1c001d2..bcef8f6 100644 --- a/core/lang/en/lex_core.php +++ b/core/lang/en/lex_core.php @@ -37,6 +37,7 @@ $text['core']['showComment'][3] = 'Comment on the page '; $text['core']['showComment'][4] = 'Form submitted'; $text['core']['showComment'][5] = 'Failed to submit form'; $text['core']['showComment'][6] = 'No comments yet'; +$text['core']['showComment'][7] ='en_GB'; // core.js.php $text['core_js'][0] = "Updating ?"; // Select File diff --git a/core/lang/es/lex_core.php b/core/lang/es/lex_core.php index 820e9d0..7497cd6 100644 --- a/core/lang/es/lex_core.php +++ b/core/lang/es/lex_core.php @@ -37,6 +37,7 @@ $text['core']['showComment'][3] = 'Comentar en la página '; $text['core']['showComment'][4] = 'Formulario enviado'; $text['core']['showComment'][5] = 'Error al enviar el formulario'; $text['core']['showComment'][6] = 'Aún no hay comentarios'; +$text['core']['showComment'][7] ='es'; // core.js.php $text['core_js'][0] = "¿Realizar actualización?"; // Seleccione Archivo diff --git a/core/lang/fr/lex_core.php b/core/lang/fr/lex_core.php index bec920d..429b771 100644 --- a/core/lang/fr/lex_core.php +++ b/core/lang/fr/lex_core.php @@ -37,6 +37,7 @@ $text['core']['showComment'][3] = 'Commentaire sur la page '; $text['core']['showComment'][4] = 'Formulaire soumis'; $text['core']['showComment'][5] = 'Echec d\'envoi du formulaire'; $text['core']['showComment'][6] = 'Pas encore de commentaire'; +$text['core']['showComment'][7] ='fr_FR'; // core.js.php $text['core_js'][0] = "Effectuer la mise à jour ?"; // Select File diff --git a/core/module/install/ressource/br/accueil.html b/core/module/install/ressource/br/accueil.html index 2a50682..b06a62f 100644 --- a/core/module/install/ressource/br/accueil.html +++ b/core/module/install/ressource/br/accueil.html @@ -4,7 +4,7 @@
-

Bienvenue sur votre
nouveau site
DeltaCMS !

+

Degemer mat war
ho lec'hienn nevez
DeltaCMS !

@@ -13,7 +13,7 @@
-

Un email contenant le récapitulatif de votre installation vient de vous être envoyé.

+

Ur postel o konteniñ ar gemenadenn diavaez evit ho staliañ zo bet kaset deoc'h..

diff --git a/core/module/install/ressource/defaultdata.php b/core/module/install/ressource/defaultdata.php index d101e04..292bf54 100644 --- a/core/module/install/ressource/defaultdata.php +++ b/core/module/install/ressource/defaultdata.php @@ -76,7 +76,7 @@ class init extends common { ] ], 'core' => [ - 'dataVersion' => 5002, + 'dataVersion' => 5003, 'lastBackup' => 0, 'lastClearTmp' => 0, 'lastAutoUpdate' => 0, diff --git a/core/vendor/filemanager/include/php_image_magician.php b/core/vendor/filemanager/include/php_image_magician.php index 9ec8e00..a1f0c9f 100644 --- a/core/vendor/filemanager/include/php_image_magician.php +++ b/core/vendor/filemanager/include/php_image_magician.php @@ -483,8 +483,8 @@ class imageLib { // *** Get cropping co-ordinates $cropArray = $this->getCropPlacing($optimalWidth, $optimalHeight, $newWidth, $newHeight, $cropPos); - $cropStartX = $cropArray['x']; - $cropStartY = $cropArray['y']; + $cropStartX = (int) $cropArray['x']; + $cropStartY = (int) $cropArray['y']; // *** Crop this bad boy $crop = imagecreatetruecolor($newWidth, $newHeight); diff --git a/module/blog/blog.php b/module/blog/blog.php index dd1d950..eb62b91 100644 --- a/module/blog/blog.php +++ b/module/blog/blog.php @@ -4,25 +4,28 @@ * This file is part of DeltaCMS. * For full copyright and license information, please see the LICENSE * file that was distributed with this source code. - * @author Sylvain Lelièvre - * @copyright Copyright (C) 2021, Sylvain Lelièvre + * @author Sylvain Lelièvre + * @copyright 2021 © Sylvain Lelièvre + * @author Lionel Croquefer + * @copyright 2022 © Lionel Croquefer * @license GNU General Public License, version 3 * @link https://deltacms.fr/ + * @contact https://deltacms.fr/contact * * Delta was created from version 11.2.00.24 of ZwiiCMS * @author Rémi Jean - * @copyright Copyright (C) 2008-2018, Rémi Jean + * @copyright 2008-2018 © Rémi Jean * @author Frédéric Tempez - * @copyright Copyright (C) 2018-2021, Frédéric Tempez + * @copyright 2018-2021 © Frédéric Tempez */ class blog extends common { - const VERSION = '6.8'; + const VERSION = '7.0'; const REALNAME = 'Blog'; const DELETE = true; const UPDATE = '0.0'; - const DATADIRECTORY = ''; // Contenu localisé inclus par défaut (page.json et module.json) + const DATADIRECTORY = ''; const EDIT_OWNER = 'owner'; const EDIT_GROUP = 'group'; @@ -123,9 +126,11 @@ class blog extends common { $this->setData(['module', $this->getUrl(0), 'texts', 'ReadMore', 'Lire la suite']); $this->setData(['module', $this->getUrl(0), 'config', 'versionData','6.3']); } - // Version 6.8 - if (version_compare($this->getData(['module', $this->getUrl(0), 'config', 'versionData']), '6.8', '<') ) { - $this->setData(['module', $this->getUrl(0), 'config', 'versionData','6.8']); + // Version 7.0 + if (version_compare($this->getData(['module', $this->getUrl(0), 'config', 'versionData']), '7.0', '<') ) { + $this->setData(['data_module', $this->getUrl(0), 'posts', $this->getData(['module', $this->getUrl(0), 'posts']) ]); + $this->deleteData(['module', $this->getUrl(0), 'posts']); + $this->setData(['module', $this->getUrl(0), 'config', 'versionData','7.0']); } } @@ -152,30 +157,30 @@ class blog extends common { $feeds->setDate(date('r',time())); $feeds->addGenerator(); // Corps des articles - $articleIdsPublishedOns = helper::arrayCollumn($this->getData(['module', $this->getUrl(0), 'posts']), 'publishedOn', 'SORT_DESC'); - $articleIdsStates = helper::arrayCollumn($this->getData(['module', $this->getUrl(0),'posts']), 'state', 'SORT_DESC'); + $articleIdsPublishedOns = helper::arrayCollumn($this->getData(['data_module', $this->getUrl(0), 'posts']), 'publishedOn', 'SORT_DESC'); + $articleIdsStates = helper::arrayCollumn($this->getData(['data_module', $this->getUrl(0),'posts']), 'state', 'SORT_DESC'); foreach( $articleIdsPublishedOns as $articleId => $articlePublishedOn ) { if( $articlePublishedOn <= time() AND $articleIdsStates[$articleId] ) { // Miniature - $parts = explode('/',$this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'picture'])); - $thumb = str_replace ($parts[(count($parts)-1)],'mini_' . $parts[(count($parts)-1)], $this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'picture'])); + $parts = explode('/',$this->getData(['data_module', $this->getUrl(0), 'posts', $articleId, 'picture'])); + $thumb = str_replace ($parts[(count($parts)-1)],'mini_' . $parts[(count($parts)-1)], $this->getData(['data_module', $this->getUrl(0), 'posts', $articleId, 'picture'])); // Créer les articles du flux $newsArticle = $feeds->createNewItem(); // Signature de l'article - $author = $this->signature($this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'userId'])); + $author = $this->signature($this->getData(['data_module', $this->getUrl(0), 'posts', $articleId, 'userId'])); $newsArticle->addElementArray([ - 'title' => $this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'title']), + 'title' => $this->getData(['data_module', $this->getUrl(0), 'posts', $articleId, 'title']), 'link' => helper::baseUrl() .$this->getUrl(0) . '/' . $articleId, 'description' => '' . $this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'title'])
-									 . '' . - $this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'content']), + $this->getData(['data_module', $this->getUrl(0), 'posts', $articleId, 'content']), ]); $newsArticle->setAuthor($author,'no@mail.com'); $newsArticle->setId(helper::baseUrl() .$this->getUrl(0) . '/' . $articleId); - $newsArticle->setDate(date('r', $this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'publishedOn']))); - if ( file_exists($this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'picture'])) ) { + $newsArticle->setDate(date('r', $this->getData(['data_module', $this->getUrl(0), 'posts', $articleId, 'publishedOn']))); + if ( file_exists($this->getData(['data_module', $this->getUrl(0), 'posts', $articleId, 'picture'])) ) { $imageData = getimagesize(helper::baseUrl(false) . self::FILE_DIR . 'thumb/' . $thumb); $newsArticle->addEnclosure( helper::baseUrl(false) . self::FILE_DIR . 'thumb/' . $thumb, $imageData[0] * $imageData[1], @@ -275,14 +280,14 @@ class blog extends common { } // Incrémente l'id de l'article $articleId = helper::increment($this->getInput('blogAddTitle', helper::FILTER_ID), $this->getData(['page'])); - $articleId = helper::increment($articleId, (array) $this->getData(['module', $this->getUrl(0)])); + $articleId = helper::increment($articleId, (array) $this->getData(['data_module', $this->getUrl(0), 'posts'])); $articleId = helper::increment($articleId, array_keys(self::$actions)); // Crée l'article - $this->setData(['module', + $this->setData(['data_module', $this->getUrl(0), 'posts', $articleId, [ - 'comment' => $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'comment']), + 'comment' => $this->getData(['data_module', $this->getUrl(0), 'posts', $this->getUrl(2), 'comment']), 'content' => $this->getInput('blogAddContent', null), 'picture' => $this->getInput('blogAddPicture', helper::FILTER_STRING_SHORT), 'hidePicture' => $this->getInput('blogAddHidePicture', helper::FILTER_BOOLEAN), @@ -343,7 +348,7 @@ class blog extends common { $param = 'blog'; include('./module/blog/lang/'. $this->getData(['config', 'i18n', 'langAdmin']) . '/lex_blog.php'); - $comments = $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2),'comment']); + $comments = $this->getData(['data_module', $this->getUrl(0), 'posts', $this->getUrl(2),'comment']); self::$commentsDelete = template::button('blogCommentDeleteAll', [ 'class' => 'blogCommentDeleteAll buttonRed', 'href' => helper::baseUrl() . $this->getUrl(0) . '/commentDeleteAll/' . $this->getUrl(2).'/' . $_SESSION['csrf'] , @@ -368,7 +373,7 @@ class blog extends common { $buttonApproval = ''; // Compatibilité avec les commentaires des versions précédentes, les valider $comment['approval'] = array_key_exists('approval', $comment) === false ? true : $comment['approval'] ; - if ( $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2),'commentApproved']) === true) { + if ( $this->getData(['data_module', $this->getUrl(0), 'posts', $this->getUrl(2),'commentApproved']) === true) { $buttonApproval = template::button('blogCommentApproved' . $commentIds[$i], [ 'class' => $comment['approval'] === true ? 'blogCommentRejected buttonGreen' : 'blogCommentApproved buttonRed' , 'href' => helper::baseUrl() . $this->getUrl(0) . '/commentApprove/' . $this->getUrl(2) . '/' . $commentIds[$i] . '/' . $_SESSION['csrf'] , @@ -393,7 +398,7 @@ class blog extends common { } // Valeurs en sortie $this->addOutput([ - 'title' => $text['blog']['comment'][1]. $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'title']), + 'title' => $text['blog']['comment'][1]. $this->getData(['data_module', $this->getUrl(0), 'posts', $this->getUrl(2), 'title']), 'view' => 'comment' ]); } @@ -417,7 +422,7 @@ class blog extends common { include('./module/blog/lang/'. $this->getData(['config', 'i18n', 'langAdmin']) . '/lex_blog.php'); // Le commentaire n'existe pas - if($this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'comment', $this->getUrl(3)]) === null) { + if($this->getData(['data_module', $this->getUrl(0), 'posts', $this->getUrl(2), 'comment', $this->getUrl(3)]) === null) { // Valeurs en sortie $this->addOutput([ 'access' => false @@ -433,7 +438,7 @@ class blog extends common { } // Suppression else { - $this->deleteData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'comment', $this->getUrl(3)]); + $this->deleteData(['data_module', $this->getUrl(0), 'posts', $this->getUrl(2), 'comment', $this->getUrl(3)]); // Valeurs en sortie $this->addOutput([ 'redirect' => helper::baseUrl() . $this->getUrl(0) . '/comment/'.$this->getUrl(2), @@ -471,7 +476,7 @@ class blog extends common { } // Suppression else { - $this->setData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'comment',[] ]); + $this->setData(['data_module', $this->getUrl(0), 'posts', $this->getUrl(2), 'comment',[] ]); // Valeurs en sortie $this->addOutput([ 'redirect' => helper::baseUrl() . $this->getUrl(0) . '/comment', @@ -500,7 +505,7 @@ class blog extends common { include('./module/blog/lang/'. $this->getData(['config', 'i18n', 'langAdmin']) . '/lex_blog.php'); // Le commentaire n'existe pas - if($this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'comment', $this->getUrl(3)]) === null) { + if($this->getData(['data_module', $this->getUrl(0), 'posts', $this->getUrl(2), 'comment', $this->getUrl(3)]) === null) { // Valeurs en sortie $this->addOutput([ 'access' => false @@ -516,12 +521,12 @@ class blog extends common { } // Inversion du statut else { - $approved = !$this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'comment', $this->getUrl(3), 'approval']) ; - $this->setData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'comment', $this->getUrl(3), [ - 'author' => $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'comment', $this->getUrl(3), 'author']), - 'content' => $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'comment', $this->getUrl(3), 'content']), - 'createdOn' => $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'comment', $this->getUrl(3), 'createdOn']), - 'userId' => $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'comment', $this->getUrl(3), 'userId']), + $approved = !$this->getData(['data_module', $this->getUrl(0), 'posts', $this->getUrl(2), 'comment', $this->getUrl(3), 'approval']) ; + $this->setData(['data_module', $this->getUrl(0), 'posts', $this->getUrl(2), 'comment', $this->getUrl(3), [ + 'author' => $this->getData(['data_module', $this->getUrl(0), 'posts', $this->getUrl(2), 'comment', $this->getUrl(3), 'author']), + 'content' => $this->getData(['data_module', $this->getUrl(0), 'posts', $this->getUrl(2), 'comment', $this->getUrl(3), 'content']), + 'createdOn' => $this->getData(['data_module', $this->getUrl(0), 'posts', $this->getUrl(2), 'comment', $this->getUrl(3), 'createdOn']), + 'userId' => $this->getData(['data_module', $this->getUrl(0), 'posts', $this->getUrl(2), 'comment', $this->getUrl(3), 'userId']), 'approval' => $approved ]]); @@ -573,25 +578,25 @@ class blog extends common { setlocale(LC_TIME, 'fr_FR'); if( $this->getData(['config', 'i18n', 'langAdmin']) === 'en') setlocale(LC_TIME, 'en_GB'); // Ids des articles par ordre de publication - $articleIds = array_keys(helper::arrayCollumn($this->getData(['module', $this->getUrl(0), 'posts']), 'publishedOn', 'SORT_DESC')); + $articleIds = array_keys(helper::arrayCollumn($this->getData(['data_module', $this->getUrl(0), 'posts']), 'publishedOn', 'SORT_DESC')); // Gestion des droits d'accès $filterData=[]; foreach ($articleIds as $key => $value) { if ( ( // Propriétaire - $this->getData(['module', $this->getUrl(0), 'posts', $value,'editConsent']) === self::EDIT_OWNER - AND ( $this->getData(['module', $this->getUrl(0), 'posts', $value,'userId']) === $this->getUser('id') + $this->getData(['data_module', $this->getUrl(0), 'posts', $value,'editConsent']) === self::EDIT_OWNER + AND ( $this->getData(['data_module', $this->getUrl(0), 'posts', $value,'userId']) === $this->getUser('id') OR $this->getUser('group') === self::GROUP_ADMIN ) ) OR ( // Groupe - $this->getData(['module', $this->getUrl(0), 'posts', $value,'editConsent']) !== self::EDIT_OWNER - AND $this->getUser('group') >= $this->getData(['module',$this->getUrl(0), 'posts', $value,'editConsent']) + $this->getData(['data_module', $this->getUrl(0), 'posts', $value,'editConsent']) !== self::EDIT_OWNER + AND $this->getUser('group') >= $this->getData(['data_module',$this->getUrl(0), 'posts', $value,'editConsent']) ) OR ( // Tout le monde - $this->getData(['module', $this->getUrl(0), 'posts', $value,'editConsent']) === self::EDIT_ALL + $this->getData(['data_module', $this->getUrl(0), 'posts', $value,'editConsent']) === self::EDIT_ALL ) ) { $filterData[] = $value; @@ -605,28 +610,28 @@ class blog extends common { // Articles en fonction de la pagination for($i = $pagination['first']; $i < $pagination['last']; $i++) { // Nombre de commentaires à approuver et approuvés - $approvals = helper::arrayCollumn($this->getData(['module', $this->getUrl(0), 'posts', $articleIds[$i], 'comment' ]),'approval', 'SORT_DESC'); + $approvals = helper::arrayCollumn($this->getData(['data_module', $this->getUrl(0), 'posts', $articleIds[$i], 'comment' ]),'approval', 'SORT_DESC'); if ( is_array($approvals) ) { $a = array_values($approvals); $toApprove = count(array_keys($a,false)); $approved = count(array_keys($a,true)); } else { $toApprove = 0; - $approved = count($this->getData(['module', $this->getUrl(0), 'posts', $articleIds[$i],'comment'])); + $approved = count($this->getData(['data_module', $this->getUrl(0), 'posts', $articleIds[$i],'comment'])); } // Met en forme le tableau - $date = mb_detect_encoding(date('d\/m\/Y', $this->getData(['module', $this->getUrl(0), 'posts', $articleIds[$i], 'publishedOn'])), 'UTF-8', true) - ? date('d\/m\/Y', $this->getData(['module', $this->getUrl(0), 'posts', $articleIds[$i], 'publishedOn'])) - : utf8_encode(date('d\/m\/Y', $this->getData(['module', $this->getUrl(0), 'posts', $articleIds[$i], 'publishedOn']))); - $heure = mb_detect_encoding(date('H\:i', $this->getData(['module', $this->getUrl(0), 'posts', $articleIds[$i], 'publishedOn'])), 'UTF-8', true) - ? date('H\:i', $this->getData(['module', $this->getUrl(0), 'posts', $articleIds[$i], 'publishedOn'])) - : utf8_encode(date('H\:i', $this->getData(['module', $this->getUrl(0), 'posts', $articleIds[$i], 'publishedOn']))); + $date = mb_detect_encoding(date('d\/m\/Y', $this->getData(['data_module', $this->getUrl(0), 'posts', $articleIds[$i], 'publishedOn'])), 'UTF-8', true) + ? date('d\/m\/Y', $this->getData(['data_module', $this->getUrl(0), 'posts', $articleIds[$i], 'publishedOn'])) + : utf8_encode(date('d\/m\/Y', $this->getData(['data_module', $this->getUrl(0), 'posts', $articleIds[$i], 'publishedOn']))); + $heure = mb_detect_encoding(date('H\:i', $this->getData(['data_module', $this->getUrl(0), 'posts', $articleIds[$i], 'publishedOn'])), 'UTF-8', true) + ? date('H\:i', $this->getData(['data_module', $this->getUrl(0), 'posts', $articleIds[$i], 'publishedOn'])) + : utf8_encode(date('H\:i', $this->getData(['data_module', $this->getUrl(0), 'posts', $articleIds[$i], 'publishedOn']))); self::$articles[] = [ '' . - $this->getData(['module', $this->getUrl(0), 'posts', $articleIds[$i], 'title']) . + $this->getData(['data_module', $this->getUrl(0), 'posts', $articleIds[$i], 'title']) . '', $date .$text['blog']['config'][2]. $heure, - $states[$this->getData(['module', $this->getUrl(0), 'posts', $articleIds[$i], 'state'])], + $states[$this->getData(['data_module', $this->getUrl(0), 'posts', $articleIds[$i], 'state'])], // Bouton pour afficher les commentaires de l'article template::button('blogConfigComment' . $articleIds[$i], [ 'class' => ($toApprove || $approved ) > 0 ? '' : 'buttonGrey' , @@ -671,7 +676,7 @@ class blog extends common { $param = 'blog'; include('./module/blog/lang/'. $this->getData(['config', 'i18n', 'langAdmin']) . '/lex_blog.php'); - if($this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2)]) === null) { + if($this->getData(['data_module', $this->getUrl(0), 'posts', $this->getUrl(2)]) === null) { // Valeurs en sortie $this->addOutput([ 'access' => false @@ -687,7 +692,7 @@ class blog extends common { } // Suppression else { - $this->deleteData(['module', $this->getUrl(0), 'posts', $this->getUrl(2)]); + $this->deleteData(['data_module', $this->getUrl(0), 'posts', $this->getUrl(2)]); // Valeurs en sortie $this->addOutput([ 'redirect' => helper::baseUrl() . $this->getUrl(0) . '/config', @@ -724,7 +729,7 @@ class blog extends common { ]); } // L'article n'existe pas - if($this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2)]) === null) { + if($this->getData(['data_module', $this->getUrl(0), 'posts', $this->getUrl(2)]) === null) { // Valeurs en sortie $this->addOutput([ 'access' => false @@ -744,14 +749,14 @@ class blog extends common { // Incrémente le nouvel id de l'article if($articleId !== $this->getUrl(2)) { $articleId = helper::increment($articleId, $this->getData(['page'])); - $articleId = helper::increment($articleId, $this->getData(['module', $this->getUrl(0),'posts'])); + $articleId = helper::increment($articleId, $this->getData(['data_module', $this->getUrl(0),'posts'])); $articleId = helper::increment($articleId, array_keys(self::$actions)); } - $this->setData(['module', + $this->setData(['data_module', $this->getUrl(0), 'posts', $articleId, [ - 'comment' => $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'comment']), + 'comment' => $this->getData(['data_module', $this->getUrl(0), 'posts', $this->getUrl(2), 'comment']), 'content' => $this->getInput('blogEditContent', null), 'picture' => $this->getInput('blogEditPicture', helper::FILTER_STRING_SHORT), 'hidePicture' => $this->getInput('blogEditHidePicture', helper::FILTER_BOOLEAN), @@ -771,7 +776,7 @@ class blog extends common { ]); // Supprime l'ancien article if($articleId !== $this->getUrl(2)) { - $this->deleteData(['module', $this->getUrl(0), 'posts', $this->getUrl(2)]); + $this->deleteData(['data_module', $this->getUrl(0), 'posts', $this->getUrl(2)]); } // Valeurs en sortie $this->addOutput([ @@ -793,7 +798,7 @@ class blog extends common { unset($userFirstname); // Valeurs en sortie $this->addOutput([ - 'title' => $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'title']), + 'title' => $this->getData(['data_module', $this->getUrl(0), 'posts', $this->getUrl(2), 'title']), 'vendor' => [ 'flatpickr', 'tinymce' @@ -848,7 +853,7 @@ class blog extends common { AND intval($this->getUrl(1)) === 0 ) { // L'article n'existe pas - if($this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1)]) === null) { + if($this->getData(['data_module', $this->getUrl(0), 'posts', $this->getUrl(1)]) === null) { // Valeurs en sortie $this->addOutput([ 'access' => false @@ -860,7 +865,7 @@ class blog extends common { 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) ]); + // $this->setData(['data_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 =''; @@ -893,38 +898,38 @@ class blog extends common { } if( $detectBot !== 'bot' ){ // Crée le commentaire - $key = $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'comment']); + $key = $this->getData(['data_module', $this->getUrl(0), 'posts', $this->getUrl(1), 'comment']); if( $key === null ) $key=array(); $commentId = helper::increment(uniqid(), $key); $content = $this->getInput('blogArticleContent', false); - $this->setData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'comment', $commentId, [ + $this->setData(['data_module', $this->getUrl(0), 'posts', $this->getUrl(1), 'comment', $commentId, [ 'author' => $this->getInput('blogArticleAuthor', helper::FILTER_STRING_SHORT, empty($this->getInput('blogArticleUserId')) ? TRUE : FALSE), 'content' => $content, 'createdOn' => time(), 'userId' => $this->getInput('blogArticleUserId'), - 'approval' => !$this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'commentApproved']) // true commentaire publié false en attente de publication + 'approval' => !$this->getData(['data_module', $this->getUrl(0), 'posts', $this->getUrl(1), 'commentApproved']) // true commentaire publié false en attente de publication ]]); // Envoi d'une notification aux administrateurs // Init tableau $to = []; // Liste des destinataires foreach($this->getData(['user']) as $userId => $user) { - if ($user['group'] >= $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'commentGroupNotification']) ) { + if ($user['group'] >= $this->getData(['data_module', $this->getUrl(0), 'posts', $this->getUrl(1), 'commentGroupNotification']) ) { $to[] = $user['mail']; $firstname[] = $user['firstname']; $lastname[] = $user['lastname']; } } // Envoi du mail $sent code d'erreur ou de réussite - $notification = $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'commentApproved']) === true ? $this->getData(['module', $this->getUrl(0), 'texts', 'Waiting']): $this->getData(['module', $this->getUrl(0), 'texts', 'CommentOK']); - if ($this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'commentNotification']) === true) { + $notification = $this->getData(['data_module', $this->getUrl(0), 'posts', $this->getUrl(1), 'commentApproved']) === true ? $this->getData(['module', $this->getUrl(0), 'texts', 'Waiting']): $this->getData(['module', $this->getUrl(0), 'texts', 'CommentOK']); + if ($this->getData(['data_module', $this->getUrl(0), 'posts', $this->getUrl(1), 'commentNotification']) === true) { $error = 0; foreach($to as $key => $adress){ $sent = $this->sendMail( $adress, $text['blog']['index'][4], $text['blog']['index'][5] . ' ' . $firstname[$key] . ' ' . $lastname[$key] . ',

' . - $text['blog']['index'][6].'' . $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'title']) . ''.$text['blog']['index'][7].'

', + $text['blog']['index'][6].'' . $this->getData(['data_module', $this->getUrl(0), 'posts', $this->getUrl(1), 'title']) . ''.$text['blog']['index'][7].'

', '' ); if( $sent === false) $error++; @@ -955,7 +960,7 @@ class blog extends common { } } // Ids des commentaires approuvés par ordre de publication - $commentsApproved = $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'comment']); + $commentsApproved = $this->getData(['data_module', $this->getUrl(0), 'posts', $this->getUrl(1), 'comment']); if ($commentsApproved) { foreach( $commentsApproved as $key => $value){ if($value['approval']===false) unset($commentsApproved[$key]); @@ -969,7 +974,7 @@ class blog extends common { // Liste des pages self::$pages = $pagination['pages']; // Signature de l'article - self::$articleSignature = $this->signature($this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'userId'])); + self::$articleSignature = $this->signature($this->getData(['data_module', $this->getUrl(0), 'posts', $this->getUrl(1), 'userId'])); // Signature du commentaire édité if($this->getUser('password') === $this->getInput('DELTA_USER_PASSWORD')) { self::$editCommentSignature = $this->signature($this->getUser('id')); @@ -977,21 +982,21 @@ class blog extends common { // Commentaires en fonction de la pagination for($i = $pagination['first']; $i < $pagination['last']; $i++) { // Signatures des commentaires - $e = $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'comment', $commentIds[$i],'userId']); + $e = $this->getData(['data_module', $this->getUrl(0), 'posts', $this->getUrl(1), 'comment', $commentIds[$i],'userId']); if ($e) { self::$commentsSignature[$commentIds[$i]] = $this->signature($e); } else { - self::$commentsSignature[$commentIds[$i]] = $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'comment', $commentIds[$i],'author']); + self::$commentsSignature[$commentIds[$i]] = $this->getData(['data_module', $this->getUrl(0), 'posts', $this->getUrl(1), 'comment', $commentIds[$i],'author']); } // Données du commentaire si approuvé - if ($this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'comment', $commentIds[$i],'approval']) === true ) { - self::$comments[$commentIds[$i]] = $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'comment', $commentIds[$i]]); + if ($this->getData(['data_module', $this->getUrl(0), 'posts', $this->getUrl(1), 'comment', $commentIds[$i],'approval']) === true ) { + self::$comments[$commentIds[$i]] = $this->getData(['data_module', $this->getUrl(0), 'posts', $this->getUrl(1), 'comment', $commentIds[$i]]); } } // Valeurs en sortie (activation de tinymce déporté dans article.php) $this->addOutput([ 'showBarEditButton' => true, - 'title' => $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'title']), + 'title' => $this->getData(['data_module', $this->getUrl(0), 'posts', $this->getUrl(1), 'title']), 'vendor' => ['tinymce'], 'view' => 'article' ]); @@ -1001,8 +1006,8 @@ class blog extends common { // Liste des articles else { // Ids des articles par ordre de publication - $articleIdsPublishedOns = helper::arrayCollumn($this->getData(['module', $this->getUrl(0),'posts']), 'publishedOn', 'SORT_DESC'); - $articleIdsStates = helper::arrayCollumn($this->getData(['module', $this->getUrl(0), 'posts']), 'state', 'SORT_DESC'); + $articleIdsPublishedOns = helper::arrayCollumn($this->getData(['data_module', $this->getUrl(0),'posts']), 'publishedOn', 'SORT_DESC'); + $articleIdsStates = helper::arrayCollumn($this->getData(['data_module', $this->getUrl(0), 'posts']), 'state', 'SORT_DESC'); $articleIds = []; foreach($articleIdsPublishedOns as $articleId => $articlePublishedOn) { if($articlePublishedOn <= time() AND $articleIdsStates[$articleId]) { @@ -1015,7 +1020,7 @@ class blog extends common { self::$pages = $pagination['pages']; // Articles en fonction de la pagination for($i = $pagination['first']; $i < $pagination['last']; $i++) { - self::$articles[$articleIds[$i]] = $this->getData(['module', $this->getUrl(0), 'posts', $articleIds[$i]]); + self::$articles[$articleIds[$i]] = $this->getData(['data_module', $this->getUrl(0), 'posts', $articleIds[$i]]); } // Valeurs en sortie $this->addOutput([ diff --git a/module/blog/lang/es/lex_blog.php b/module/blog/lang/es/lex_blog.php index c8ef36e..8eb7859 100644 --- a/module/blog/lang/es/lex_blog.php +++ b/module/blog/lang/es/lex_blog.php @@ -109,7 +109,7 @@ $text['blog']['index'][1] = '
Error de notificación: '; $text['blog']['index'][4] = 'Nuevo comentario publicado'; $text['blog']['índex'][5] = 'Hola'; $text['blog']['index'][6] = 'El artículo'; -$text['blog']['index'][7] = 'recibió un nuevo comentario'; +$text['blog']['index'][7] = ' recibió un nuevo comentario'; $text['blog']['index'][8] = 'Aún no hay comentarios'; $text['blog']['index'][9] = 'Escribe un comentario'; $text['blog']['índex'][10] = 'Nombre'; diff --git a/module/blog/lang/fr/lex_blog.php b/module/blog/lang/fr/lex_blog.php index 718376d..b3fc4b9 100644 --- a/module/blog/lang/fr/lex_blog.php +++ b/module/blog/lang/fr/lex_blog.php @@ -109,7 +109,7 @@ $text['blog']['index'][1] = '
Erreur de notification : '; $text['blog']['index'][4] = 'Nouveau commentaire déposé'; $text['blog']['index'][5] = 'Bonjour'; $text['blog']['index'][6] = 'L\'article '; -$text['blog']['index'][7] = 'a reçu un nouveau commentaire'; +$text['blog']['index'][7] = ' a reçu un nouveau commentaire'; $text['blog']['index'][8] = 'Pas encore de commentaire'; $text['blog']['index'][9] = 'Ecrire un commentaire'; $text['blog']['index'][10] = 'Nom'; diff --git a/module/blog/view/add/add.php b/module/blog/view/add/add.php index 2bb31bd..c8814c7 100644 --- a/module/blog/view/add/add.php +++ b/module/blog/view/add/add.php @@ -71,7 +71,7 @@ $lang_flatpickr = $text['blog_view']['add'][25];
$this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'hidePicture']) + 'checked' => $this->getData(['data_module', $this->getUrl(0), 'posts', $this->getUrl(2), 'hidePicture']) ]); ?>
diff --git a/module/blog/view/article/article.php b/module/blog/view/article/article.php index 26b0935..fbf5068 100644 --- a/module/blog/view/article/article.php +++ b/module/blog/view/article/article.php @@ -49,14 +49,14 @@ if( function_exists('datefmt_create') && function_exists('datefmt_format') && ex
- getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'pictureSize']) === null ? '100' : $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'pictureSize']); ?> - getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'hidePicture']) === false - && $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'picture']) !=='' ) { - echo '' . $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'picture']) . ''; + getData(['data_module', $this->getUrl(0), 'posts', $this->getUrl(1), 'pictureSize']) === null ? '100' : $this->getData(['data_module', $this->getUrl(0), 'posts', $this->getUrl(1), 'pictureSize']); ?> + getData(['data_module', $this->getUrl(0), 'posts', $this->getUrl(1), 'hidePicture']) === false + && $this->getData(['data_module', $this->getUrl(0), 'posts', $this->getUrl(1), 'picture']) !=='' ) { + echo '' . $this->getData(['data_module', $this->getUrl(0), 'posts', $this->getUrl(1), 'picture']) . ''; } ?> - getData(['module', $this->getUrl(0),'posts', $this->getUrl(1), 'content']); ?> + getData(['data_module', $this->getUrl(0),'posts', $this->getUrl(1), 'content']); ?>
@@ -64,14 +64,14 @@ if( function_exists('datefmt_create') && function_exists('datefmt_format') && ex getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'publishedOn'])))); + echo datefmt_format($fmt, strtotime( date('Y/m/d H:i:s',$this->getData(['data_module', $this->getUrl(0), 'posts', $this->getUrl(1), 'publishedOn'])))); } else{ - $date = mb_detect_encoding( date('d/m/Y', $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'publishedOn'])), 'UTF-8', true) - ? date('d/m/Y', $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'publishedOn'])) - : utf8_encode(date('d/m/Y', $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'publishedOn']))); - $heure = mb_detect_encoding(date('H:i', $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'publishedOn'])), 'UTF-8', true) - ? date('H:i', $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'publishedOn'])) - : utf8_encode(date('H:i', $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'publishedOn']))); + $date = mb_detect_encoding( date('d/m/Y', $this->getData(['data_module', $this->getUrl(0), 'posts', $this->getUrl(1), 'publishedOn'])), 'UTF-8', true) + ? date('d/m/Y', $this->getData(['data_module', $this->getUrl(0), 'posts', $this->getUrl(1), 'publishedOn'])) + : utf8_encode(date('d/m/Y', $this->getData(['data_module', $this->getUrl(0), 'posts', $this->getUrl(1), 'publishedOn']))); + $heure = mb_detect_encoding(date('H:i', $this->getData(['data_module', $this->getUrl(0), 'posts', $this->getUrl(1), 'publishedOn'])), 'UTF-8', true) + ? date('H:i', $this->getData(['data_module', $this->getUrl(0), 'posts', $this->getUrl(1), 'publishedOn'])) + : utf8_encode(date('H:i', $this->getData(['data_module', $this->getUrl(0), 'posts', $this->getUrl(1), 'publishedOn']))); echo $date . ' - ' . $heure; } ?> @@ -82,19 +82,19 @@ if( function_exists('datefmt_create') && function_exists('datefmt_format') && ex AND ( // Propriétaire ( - $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1),'editConsent']) === $module::EDIT_OWNER - AND ( $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1),'userId']) === $this->getUser('id') + $this->getData(['data_module', $this->getUrl(0), 'posts', $this->getUrl(1),'editConsent']) === $module::EDIT_OWNER + AND ( $this->getData(['data_module', $this->getUrl(0), 'posts', $this->getUrl(1),'userId']) === $this->getUser('id') OR $this->getUser('group') === self::GROUP_ADMIN ) ) OR ( // Groupe - ( $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1),'editConsent']) === self::GROUP_ADMIN - OR $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1),'editConsent']) === self::GROUP_MODERATOR) - AND $this->getUser('group') >= $this->getData(['module',$this->getUrl(0), 'posts', $this->getUrl(1),'editConsent']) + ( $this->getData(['data_module', $this->getUrl(0), 'posts', $this->getUrl(1),'editConsent']) === self::GROUP_ADMIN + OR $this->getData(['data_module', $this->getUrl(0), 'posts', $this->getUrl(1),'editConsent']) === self::GROUP_MODERATOR) + AND $this->getUser('group') >= $this->getData(['data_module',$this->getUrl(0), 'posts', $this->getUrl(1),'editConsent']) ) OR ( // Tout le monde - $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1),'editConsent']) === $module::EDIT_ALL + $this->getData(['data_module', $this->getUrl(0), 'posts', $this->getUrl(1),'editConsent']) === $module::EDIT_ALL AND $this->getUser('group') >= $module::$actions['config'] ) ) @@ -128,7 +128,7 @@ if( function_exists('datefmt_create') && function_exists('datefmt_format') && ex
-getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'commentClose'])): ?> +getData(['data_module', $this->getUrl(0), 'posts', $this->getUrl(1), 'commentClose'])): ?>

getData(['module', $this->getUrl(0), 'texts', 'ArticleNoComment']); ?>

@@ -173,10 +173,10 @@ if( function_exists('datefmt_create') && function_exists('datefmt_format') && ex
$this->getData(['module', $this->getUrl(0), 'texts', 'Maxi']).' '.$this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'commentMaxlength']).' '.$this->getData(['module', $this->getUrl(0), 'texts', 'Cara']), + 'label' => $this->getData(['module', $this->getUrl(0), 'texts', 'Maxi']).' '.$this->getData(['data_module', $this->getUrl(0), 'posts', $this->getUrl(1), 'commentMaxlength']).' '.$this->getData(['module', $this->getUrl(0), 'texts', 'Cara']), 'class' => 'editorWysiwygComment', 'noDirty' => true, - 'maxlength' => $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'commentMaxlength']), + 'maxlength' => $this->getData(['data_module', $this->getUrl(0), 'posts', $this->getUrl(1), 'commentMaxlength']), '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']), diff --git a/module/blog/view/edit/edit.php b/module/blog/view/edit/edit.php index ab969d5..a7e5d13 100644 --- a/module/blog/view/edit/edit.php +++ b/module/blog/view/edit/edit.php @@ -43,7 +43,7 @@ $lang_flatpickr = $text['blog_view']['edit'][25];
$text['blog_view']['edit'][4], - 'value' => $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'title']) + 'value' => $this->getData(['data_module', $this->getUrl(0), 'posts', $this->getUrl(2), 'title']) ]); ?>
@@ -55,19 +55,19 @@ $lang_flatpickr = $text['blog_view']['edit'][25]; 'help' => $help, 'label' => $text['blog_view']['edit'][6], 'type' => 1, - 'value' => $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'picture']) + 'value' => $this->getData(['data_module', $this->getUrl(0), 'posts', $this->getUrl(2), 'picture']) ]); ?>
$text['blog_view']['edit'][7], - 'selected' => $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'pictureSize']) + 'selected' => $this->getData(['data_module', $this->getUrl(0), 'posts', $this->getUrl(2), 'pictureSize']) ]); ?>
$text['blog_view']['edit'][8], - 'selected' => $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'picturePosition']), + 'selected' => $this->getData(['data_module', $this->getUrl(0), 'posts', $this->getUrl(2), 'picturePosition']), 'help' => $text['blog_view']['edit'][9] ]); ?>
@@ -75,7 +75,7 @@ $lang_flatpickr = $text['blog_view']['edit'][25];
$this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'hidePicture']) + 'checked' => $this->getData(['data_module', $this->getUrl(0), 'posts', $this->getUrl(2), 'hidePicture']) ]); ?>
@@ -84,7 +84,7 @@ $lang_flatpickr = $text['blog_view']['edit'][25]; 'editorWysiwyg', - 'value' => $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'content']) + 'value' => $this->getData(['data_module', $this->getUrl(0), 'posts', $this->getUrl(2), 'content']) ]); ?>
@@ -101,13 +101,13 @@ $lang_flatpickr = $text['blog_view']['edit'][25]; $text['blog_view']['edit'][13], 'label' => $text['blog_view']['edit'][14], - 'value' => $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'publishedOn']) + 'value' => $this->getData(['data_module', $this->getUrl(0), 'posts', $this->getUrl(2), 'publishedOn']) ]); ?>
$text['blog_view']['edit'][15], - 'selected' => is_numeric($this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'editConsent'])) ? $module::EDIT_GROUP : $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'editConsent']), + 'selected' => is_numeric($this->getData(['data_module', $this->getUrl(0), 'posts', $this->getUrl(2), 'editConsent'])) ? $module::EDIT_GROUP : $this->getData(['data_module', $this->getUrl(0), 'posts', $this->getUrl(2), 'editConsent']), 'help' => $text['blog_view']['edit'][16] ]); ?>
@@ -122,12 +122,12 @@ $lang_flatpickr = $text['blog_view']['edit'][25];
$this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'commentClose']) + 'checked' => $this->getData(['data_module', $this->getUrl(0), 'posts', $this->getUrl(2), 'commentClose']) ]); ?>
$this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'commentApproved']), + 'checked' => $this->getData(['data_module', $this->getUrl(0), 'posts', $this->getUrl(2), 'commentApproved']), '' ]); ?>
@@ -135,7 +135,7 @@ $lang_flatpickr = $text['blog_view']['edit'][25]; $text['blog_view']['edit'][20], 'label' => $text['blog_view']['edit'][21], - 'selected' => $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'commentMaxlength']) + 'selected' => $this->getData(['data_module', $this->getUrl(0), 'posts', $this->getUrl(2), 'commentMaxlength']) ]); ?>
@@ -143,12 +143,12 @@ $lang_flatpickr = $text['blog_view']['edit'][25];
$this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'commentNotification']), + 'checked' => $this->getData(['data_module', $this->getUrl(0), 'posts', $this->getUrl(2), 'commentNotification']), ]); ?>
$this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(2), 'commentGroupNotification']), + 'selected' => $this->getData(['data_module', $this->getUrl(0), 'posts', $this->getUrl(2), 'commentGroupNotification']), 'help' => $text['blog_view']['edit'][23] ]); ?>
diff --git a/module/blog/view/index/index.php b/module/blog/view/index/index.php index cdb6d55..d1b5ad9 100644 --- a/module/blog/view/index/index.php +++ b/module/blog/view/index/index.php @@ -27,7 +27,7 @@ if($module::$articles): ?> $article): ?>
- getData(['module', $this->getUrl(0), 'posts', $articleId, 'picture']) !=='' ){ ?> + getData(['data_module', $this->getUrl(0), 'posts', $articleId, 'picture']) !=='' ){ ?>
self::GROUP_EDITOR, @@ -84,8 +84,11 @@ class form extends common { $this->setData(['module', $this->getUrl(0), 'config', 'uploadTxt',false]); $this->setData(['module', $this->getUrl(0), 'config', 'versionData','4.1']); } - if( version_compare($this->getData(['module', $this->getUrl(0), 'config', 'versionData']), '5.1', '<') ){ - $this->setData(['module', $this->getUrl(0), 'config', 'versionData', '5.1']); + if( version_compare($this->getData(['module', $this->getUrl(0), 'config', 'versionData']), '6.0', '<') ){ + // Déplaement des données de page de module.json 'data' vers data_module/nom_page.json 'data' + $this->setData(['data_module', $this->getUrl(0), 'data', $this->getData(['module', $this->getUrl(0), 'data']) ]); + $this->deleteData(['module', $this->getUrl(0), 'data']); + $this->setData(['module', $this->getUrl(0), 'config', 'versionData', '6.0']); } } @@ -142,8 +145,8 @@ class form extends common { ] ]); // Génération des données vides - if ($this->getData(['module', $this->getUrl(0), 'data']) === null) { - $this->setData(['module', $this->getUrl(0), 'data', []]); + if ($this->getData(['data_module', $this->getUrl(0), 'data']) === null) { + $this->setData(['data_module', $this->getUrl(0), 'data', []]); } // Génération des champs $inputs = []; @@ -199,7 +202,7 @@ class form extends common { // Lexique $param = ''; include('./module/form/lang/'. $this->getData(['config', 'i18n', 'langAdmin']) . '/lex_form.php'); - $data = $this->getData(['module', $this->getUrl(0), 'data']); + $data = $this->getData(['data_module', $this->getUrl(0), 'data']); if($data) { // Pagination $pagination = helper::pagination($data, $this->getUrl(),self::ITEMSPAGE); @@ -256,7 +259,7 @@ class form extends common { 'notification' => $text['form']['export2csv'][0] ]); } else { - $data = $this->getData(['module', $this->getUrl(0), 'data']); + $data = $this->getData(['data_module', $this->getUrl(0), 'data']); if ($data !== []) { $csvfilename = 'data-'.date('dmY').'-'.date('hm').'-'.rand(10,99).'.csv'; if (!file_exists(self::FILE_DIR.'source/data')) { @@ -309,11 +312,11 @@ class form extends common { 'notification' => $text['form']['deleteall'][0] ]); } else { - $data = ($this->getData(['module', $this->getUrl(0), 'data'])); + $data = ($this->getData(['data_module', $this->getUrl(0), 'data'])); if (count($data) > 0 ) { // Suppression multiple for ($i = 1; $i <= count($data) ; $i++) { - echo $this->deleteData(['module', $this->getUrl(0), 'data', $i]); + echo $this->deleteData(['data_module', $this->getUrl(0), 'data', $i]); } // Valeurs en sortie $this->addOutput([ @@ -358,7 +361,7 @@ class form extends common { ]); } else { // La donnée n'existe pas - if($this->getData(['module', $this->getUrl(0), 'data', $this->getUrl(2)]) === null) { + if($this->getData(['data_module', $this->getUrl(0), 'data', $this->getUrl(2)]) === null) { // Valeurs en sortie $this->addOutput([ 'access' => false @@ -366,7 +369,7 @@ class form extends common { } // Suppression else { - $this->deleteData(['module', $this->getUrl(0), 'data', $this->getUrl(2)]); + $this->deleteData(['data_module', $this->getUrl(0), 'data', $this->getUrl(2)]); // Valeurs en sortie $this->addOutput([ 'redirect' => helper::baseUrl() . $this->getUrl(0) . '/data', @@ -572,7 +575,11 @@ class form extends common { $sent = true; if( $notice === ''){ // Crée les données - $this->setData(['module', $this->getUrl(0), 'data', helper::increment(1, $this->getData(['module', $this->getUrl(0), 'data'])), $data]); + if( null !== $this->getData(['data_module', $this->getUrl(0), 'data']) ) { + $this->setData(['data_module', $this->getUrl(0), 'data', helper::increment(1, $this->getData(['data_module', $this->getUrl(0), 'data'])), $data]); + } else { + $this->setData(['data_module', $this->getUrl(0), 'data', 1, $data]); + } // Emission du mail // Rechercher l'adresse en fonction du mail $singleuser = $this->getData(['user',