From 432906085d2c474b70adac7eea81a9dcf684b05a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Tempez?= Date: Mon, 17 Jan 2022 19:11:05 +0100 Subject: [PATCH 01/12] News v4.0 --- module/news/changes.md | 4 + module/news/news.php | 125 ++++++++++++++++------------- module/news/view/config/config.php | 85 ++------------------ module/news/view/layout/layout.css | 18 +++++ module/news/view/layout/layout.php | 93 +++++++++++++++++++++ 5 files changed, 189 insertions(+), 136 deletions(-) create mode 100644 module/news/changes.md create mode 100644 module/news/view/layout/layout.css create mode 100644 module/news/view/layout/layout.php diff --git a/module/news/changes.md b/module/news/changes.md new file mode 100644 index 00000000..f09261d8 --- /dev/null +++ b/module/news/changes.md @@ -0,0 +1,4 @@ +# Version 4 + - Config : le nombre d'objet est fixe, constante dans news.php + - Ecran layout réservé à la configuration et au thème + - Bug avec l'initialisation, fichier css déclaré mais absent \ No newline at end of file diff --git a/module/news/news.php b/module/news/news.php index c2dbdabd..1bb0ae6a 100644 --- a/module/news/news.php +++ b/module/news/news.php @@ -15,7 +15,7 @@ class news extends common { - const VERSION = '3.7'; + const VERSION = '4.0'; const REALNAME = 'News'; const DELETE = true; const UPDATE = '0.0'; @@ -23,7 +23,8 @@ class news extends common { public static $actions = [ 'add' => self::GROUP_MODERATOR, - 'config' => self::GROUP_MODERATOR, + 'config' => self::GROUP_MODERATOR, // Edition des news + 'layout' => self::GROUP_MODERATOR, // paramétrage des news 'delete' => self::GROUP_MODERATOR, 'edit' => self::GROUP_MODERATOR, 'index' => self::GROUP_VISITOR, @@ -88,7 +89,8 @@ class news extends common { // Signature de l'article public static $articleSignature = ''; - + // Nombre d'articles dans la page de config: + public static $itemsperPage = 8; /** * Flux RSS @@ -189,10 +191,63 @@ class news extends common { // Mise à jour des données de module $this->update(); + // Ids des news par ordre de publication + $newsIds = array_keys(helper::arrayCollumn($this->getData(['module', $this->getUrl(0), 'posts']), 'publishedOn', 'SORT_DESC')); + // Pagination fixe + $pagination = helper::pagination($newsIds, $this->getUrl(),self::$itemsperPage ); + // Liste des pages + self::$pages = $pagination['pages']; + // News en fonction de la pagination + for($i = $pagination['first']; $i < $pagination['last']; $i++) { + // Met en forme le tableau + $dateOn = mb_detect_encoding(strftime('%d %B %Y', $this->getData(['module', $this->getUrl(0),'posts', $newsIds[$i], 'publishedOn'])), 'UTF-8', true) + ? strftime('%d %B %Y', $this->getData(['module', $this->getUrl(0),'posts', $newsIds[$i], 'publishedOn'])) + : utf8_encode(strftime('%d %B %Y', $this->getData(['module', $this->getUrl(0),'posts', $newsIds[$i], 'publishedOn']))); + $dateOn .= ' à '; + $dateOn .= mb_detect_encoding(strftime('%H:%M', $this->getData(['module', $this->getUrl(0),'posts', $newsIds[$i], 'publishedOn'])), 'UTF-8', true) + ? strftime('%H:%M', $this->getData(['module', $this->getUrl(0),'posts', $newsIds[$i], 'publishedOn'])) + : utf8_encode(strftime('%H:%M', $this->getData(['module', $this->getUrl(0),'posts', $newsIds[$i], 'publishedOn']))); + if ($this->getData(['module', $this->getUrl(0),'posts', $newsIds[$i], 'publishedOff'])) { + $dateOff = mb_detect_encoding(strftime('%d %B %Y', $this->getData(['module', $this->getUrl(0),'posts', $newsIds[$i], 'publishedOff'])), 'UTF-8', true) + ? strftime('%d %B %Y', $this->getData(['module', $this->getUrl(0),'posts', $newsIds[$i], 'publishedOff'])) + : utf8_encode(strftime('%d %B %Y', $this->getData(['module', $this->getUrl(0),'posts', $newsIds[$i], 'publishedOff']))); + $dateOff .= ' à '; + $dateOff .= mb_detect_encoding(strftime('%H:%M', $this->getData(['module', $this->getUrl(0),'posts', $newsIds[$i], 'publishedOff'])), 'UTF-8', true) + ? strftime('%H:%M', $this->getData(['module', $this->getUrl(0),'posts', $newsIds[$i], 'publishedOff'])) + : utf8_encode(strftime('%H:%M', $this->getData(['module', $this->getUrl(0),'posts', $newsIds[$i], 'publishedOff']))); + } else { + $dateOff = 'Permanent'; + } + self::$news[] = [ + $this->getData(['module', $this->getUrl(0),'posts', $newsIds[$i], 'title']), + $dateOn, + $dateOff, + self::$states[$this->getData(['module', $this->getUrl(0),'posts', $newsIds[$i], 'state'])], + template::button('newsConfigEdit' . $newsIds[$i], [ + 'href' => helper::baseUrl() . $this->getUrl(0) . '/edit/' . $newsIds[$i]. '/' . $_SESSION['csrf'], + 'value' => template::ico('pencil') + ]), + template::button('newsConfigDelete' . $newsIds[$i], [ + 'class' => 'newsConfigDelete buttonRed', + 'href' => helper::baseUrl() . $this->getUrl(0) . '/delete/' . $newsIds[$i] . '/' . $_SESSION['csrf'], + 'value' => template::ico('cancel') + ]) + ]; + } + // Valeurs en sortie + $this->addOutput([ + 'title' => 'Configuration du module', + 'view' => 'config', + 'vendor' => [ + 'tinycolorpicker' + ] + ]); + } + + public function layout() { // Soumission du formulaire if($this->isPost()) { - // Générer la feuille de CSS $style = '.newsFrame {'; $style .= 'border:' . $this->getInput('newsThemeBorderStyle',helper::FILTER_STRING_SHORT) . ' ' . $this->getInput('newsThemeBorderColor') . ' ' . $this->getInput('newsThemeBorderWidth',helper::FILTER_STRING_SHORT) . ';'; @@ -217,69 +272,26 @@ class news extends common { ]]); $this->setData(['module', $this->getUrl(0), 'config',[ - 'feeds' => $this->getInput('newsConfigShowFeeds',helper::FILTER_BOOLEAN), - 'feedsLabel' => $this->getInput('newsConfigFeedslabel',helper::FILTER_STRING_SHORT), - 'itemsperPage' => $this->getInput('newsConfigItemsperPage', helper::FILTER_INT,true), - 'itemsperCol' => $this->getInput('newsConfigItemsperCol', helper::FILTER_INT,true), - 'height' => $this->getInput('newsConfigHeight', helper::FILTER_INT,true), + 'feeds' => $this->getInput('newsLayoutShowFeeds',helper::FILTER_BOOLEAN), + 'feedsLabel' => $this->getInput('newsLayoutFeedslabel',helper::FILTER_STRING_SHORT), + 'itemsperPage' => $this->getInput('newsLayoutItemsperPage', helper::FILTER_INT,true), + 'itemsperCol' => $this->getInput('newsLayoutItemsperCol', helper::FILTER_INT,true), + 'height' => $this->getInput('newsLayoutHeight', helper::FILTER_INT,true), 'versionData' => $this->getData(['module', $this->getUrl(0), 'config', 'versionData']) ]]); // Valeurs en sortie $this->addOutput([ - 'redirect' => helper::baseUrl() . $this->getUrl(0) . '/config', + 'redirect' => helper::baseUrl() . $this->getUrl(0) . '/layout', 'notification' => 'Modifications enregistrées', 'state' => true ]); } else { - // Ids des news par ordre de publication - $newsIds = array_keys(helper::arrayCollumn($this->getData(['module', $this->getUrl(0), 'posts']), 'publishedOn', 'SORT_DESC')); - // Pagination - $pagination = helper::pagination($newsIds, $this->getUrl(),$this->getData(['module', $this->getUrl(0), 'config', 'itemsperPage']) ); - // Liste des pages - self::$pages = $pagination['pages']; - // News en fonction de la pagination - for($i = $pagination['first']; $i < $pagination['last']; $i++) { - // Met en forme le tableau - $dateOn = mb_detect_encoding(strftime('%d %B %Y', $this->getData(['module', $this->getUrl(0),'posts', $newsIds[$i], 'publishedOn'])), 'UTF-8', true) - ? strftime('%d %B %Y', $this->getData(['module', $this->getUrl(0),'posts', $newsIds[$i], 'publishedOn'])) - : utf8_encode(strftime('%d %B %Y', $this->getData(['module', $this->getUrl(0),'posts', $newsIds[$i], 'publishedOn']))); - $dateOn .= ' à '; - $dateOn .= mb_detect_encoding(strftime('%H:%M', $this->getData(['module', $this->getUrl(0),'posts', $newsIds[$i], 'publishedOn'])), 'UTF-8', true) - ? strftime('%H:%M', $this->getData(['module', $this->getUrl(0),'posts', $newsIds[$i], 'publishedOn'])) - : utf8_encode(strftime('%H:%M', $this->getData(['module', $this->getUrl(0),'posts', $newsIds[$i], 'publishedOn']))); - if ($this->getData(['module', $this->getUrl(0),'posts', $newsIds[$i], 'publishedOff'])) { - $dateOff = mb_detect_encoding(strftime('%d %B %Y', $this->getData(['module', $this->getUrl(0),'posts', $newsIds[$i], 'publishedOff'])), 'UTF-8', true) - ? strftime('%d %B %Y', $this->getData(['module', $this->getUrl(0),'posts', $newsIds[$i], 'publishedOff'])) - : utf8_encode(strftime('%d %B %Y', $this->getData(['module', $this->getUrl(0),'posts', $newsIds[$i], 'publishedOff']))); - $dateOff .= ' à '; - $dateOff .= mb_detect_encoding(strftime('%H:%M', $this->getData(['module', $this->getUrl(0),'posts', $newsIds[$i], 'publishedOff'])), 'UTF-8', true) - ? strftime('%H:%M', $this->getData(['module', $this->getUrl(0),'posts', $newsIds[$i], 'publishedOff'])) - : utf8_encode(strftime('%H:%M', $this->getData(['module', $this->getUrl(0),'posts', $newsIds[$i], 'publishedOff']))); - } else { - $dateOff = 'Permanent'; - } - self::$news[] = [ - $this->getData(['module', $this->getUrl(0),'posts', $newsIds[$i], 'title']), - $dateOn, - $dateOff, - self::$states[$this->getData(['module', $this->getUrl(0),'posts', $newsIds[$i], 'state'])], - template::button('newsConfigEdit' . $newsIds[$i], [ - 'href' => helper::baseUrl() . $this->getUrl(0) . '/edit/' . $newsIds[$i]. '/' . $_SESSION['csrf'], - 'value' => template::ico('pencil') - ]), - template::button('newsConfigDelete' . $newsIds[$i], [ - 'class' => 'newsConfigDelete buttonRed', - 'href' => helper::baseUrl() . $this->getUrl(0) . '/delete/' . $newsIds[$i] . '/' . $_SESSION['csrf'], - 'value' => template::ico('cancel') - ]) - ]; - } // Valeurs en sortie $this->addOutput([ - 'title' => 'Configuration du module', - 'view' => 'config', + 'title' => 'Mise en page', + 'view' => 'layout', 'vendor' => [ 'tinycolorpicker' ] @@ -435,8 +447,7 @@ class news extends common { $newsIds[] = $newsId; } } - // Pagination - //$pagination = helper::pagination($newsIds, $this->getUrl(),$this->getData(['config','itemsperPage'])); + // Pagination selon le layout $pagination = helper::pagination($newsIds, $this->getUrl(),$this->getData(['module', $this->getUrl(0),'config', 'itemsperPage'])); // Nombre de colonnes self::$nbrCol = $this->getData(['module', $this->getUrl(0),'config', 'itemsperCol']); diff --git a/module/news/view/config/config.php b/module/news/view/config/config.php index 873c9a66..70b14434 100644 --- a/module/news/view/config/config.php +++ b/module/news/view/config/config.php @@ -16,87 +16,14 @@ ]); ?>
- -
- -
-
-
-

Paramètres du module

-
-
- $this->getData(['module', $this->getUrl(0), 'config', 'feeds']), - 'help' => 'Flux limité aux articles de la première page.' - ]); ?> -
-
- 'Etiquette RSS', - 'value' => $this->getData(['module', $this->getUrl(0), 'config', 'feedsLabel']) - ]); ?> -
-
-
-
- 'Nombre de colonnes', - 'selected' => $this->getData(['module', $this->getUrl(0),'config', 'itemsperCol']) - ]); ?> -
-
- 'Articles par page', - 'selected' => $this->getData(['module', $this->getUrl(0),'config', 'itemsperPage']) - ]); ?> -
-
- 'Abrégé de l\'article', - 'selected' => $this->getData(['module', $this->getUrl(0),'config', 'height']) - ]); ?> -
-
-
-
-
-
-
-
-

Thème du module

-
-
- 'Bordure', - 'selected' => $this->getData(['module', $this->getUrl(0),'theme', 'borderStyle']) - ]); ?> -
-
- 'Epaisseur', - 'selected' => $this->getData(['module', $this->getUrl(0),'theme', 'borderWidth']) - ]); ?> -
-
- 'colorPicker', - 'help' => 'Couleur visible en l\'absence d\'une image.
Le curseur horizontal règle le niveau de transparence.', - 'label' => 'Couleur de la bordure', - 'value' => $this->getData(['module', $this->getUrl(0),'theme', 'borderColor']) - ]); ?> -
-
- 'colorPicker', - 'help' => 'Couleur visible en l\'absence d\'une image.
Le curseur horizontal règle le niveau de transparence.', - 'label' => 'Couleur du fond', - 'value' => $this->getData(['module', $this->getUrl(0),'theme', 'backgroundColor']) - ]); ?> -
-
-
+ helper::baseUrl() . $this->getUrl(0) . '/layout', + 'ico' => 'puzzle', + 'value' => 'Mise en page' + ]); ?>
+ diff --git a/module/news/view/layout/layout.css b/module/news/view/layout/layout.css new file mode 100644 index 00000000..52709ea6 --- /dev/null +++ b/module/news/view/layout/layout.css @@ -0,0 +1,18 @@ +/** + * This file is part of Zwii. + * + * For full copyright and license information, please see the LICENSE + * file that was distributed with this source code. + * + * @author Rémi Jean + * @copyright Copyright (C) 2008-2018, Rémi Jean + * @author Frédéric Tempez + * @copyright Copyright (C) 2018-2022, Frédéric Tempez + * @license GNU General Public License, version 3 + * @link http://zwiicms.fr/ + */ + + +/** NE PAS EFFACER +* admin.css +*/ \ No newline at end of file diff --git a/module/news/view/layout/layout.php b/module/news/view/layout/layout.php new file mode 100644 index 00000000..06499a15 --- /dev/null +++ b/module/news/view/layout/layout.php @@ -0,0 +1,93 @@ + +
+
+ 'buttonGrey', + 'href' => helper::baseUrl() . $this->getUrl(0) . '/config', + 'ico' => 'left', + 'value' => 'Retour' + ]); ?> +
+
+ +
+
+
+
+
+

Paramètres du module

+
+
+ $this->getData(['module', $this->getUrl(0), 'config', 'feeds']), + 'help' => 'Flux limité aux articles de la première page.' + ]); ?> +
+
+ 'Etiquette RSS', + 'value' => $this->getData(['module', $this->getUrl(0), 'config', 'feedsLabel']) + ]); ?> +
+
+
+
+ 'Nombre de colonnes', + 'selected' => $this->getData(['module', $this->getUrl(0),'config', 'itemsperCol']) + ]); ?> +
+
+ 'Articles par page', + 'selected' => $this->getData(['module', $this->getUrl(0),'config', 'itemsperPage']) + ]); ?> +
+
+ 'Abrégé de l\'article', + 'selected' => $this->getData(['module', $this->getUrl(0),'config', 'height']) + ]); ?> +
+
+
+
+
+
+
+
+

Thème du module

+
+
+ 'Bordure', + 'selected' => $this->getData(['module', $this->getUrl(0),'theme', 'borderStyle']) + ]); ?> +
+
+ 'Epaisseur', + 'selected' => $this->getData(['module', $this->getUrl(0),'theme', 'borderWidth']) + ]); ?> +
+
+ 'colorPicker', + 'help' => 'Couleur visible en l\'absence d\'une image.
Le curseur horizontal règle le niveau de transparence.', + 'label' => 'Couleur de la bordure', + 'value' => $this->getData(['module', $this->getUrl(0),'theme', 'borderColor']) + ]); ?> +
+
+ 'colorPicker', + 'help' => 'Couleur visible en l\'absence d\'une image.
Le curseur horizontal règle le niveau de transparence.', + 'label' => 'Couleur du fond', + 'value' => $this->getData(['module', $this->getUrl(0),'theme', 'backgroundColor']) + ]); ?> +
+
+
+
+
+ \ No newline at end of file From c35b89c8b8bfc75ed729bc6f841fac09e97c6944 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Tempez?= Date: Mon, 17 Jan 2022 19:13:35 +0100 Subject: [PATCH 02/12] Revert "News v4.0" This reverts commit 78c3d4e174f8364444f9487530358e71390b8d1d. --- module/news/changes.md | 4 - module/news/news.php | 125 +++++++++++++---------------- module/news/view/config/config.php | 85 ++++++++++++++++++-- module/news/view/layout/layout.css | 18 ----- module/news/view/layout/layout.php | 93 --------------------- 5 files changed, 136 insertions(+), 189 deletions(-) delete mode 100644 module/news/changes.md delete mode 100644 module/news/view/layout/layout.css delete mode 100644 module/news/view/layout/layout.php diff --git a/module/news/changes.md b/module/news/changes.md deleted file mode 100644 index f09261d8..00000000 --- a/module/news/changes.md +++ /dev/null @@ -1,4 +0,0 @@ -# Version 4 - - Config : le nombre d'objet est fixe, constante dans news.php - - Ecran layout réservé à la configuration et au thème - - Bug avec l'initialisation, fichier css déclaré mais absent \ No newline at end of file diff --git a/module/news/news.php b/module/news/news.php index 1bb0ae6a..c2dbdabd 100644 --- a/module/news/news.php +++ b/module/news/news.php @@ -15,7 +15,7 @@ class news extends common { - const VERSION = '4.0'; + const VERSION = '3.7'; const REALNAME = 'News'; const DELETE = true; const UPDATE = '0.0'; @@ -23,8 +23,7 @@ class news extends common { public static $actions = [ 'add' => self::GROUP_MODERATOR, - 'config' => self::GROUP_MODERATOR, // Edition des news - 'layout' => self::GROUP_MODERATOR, // paramétrage des news + 'config' => self::GROUP_MODERATOR, 'delete' => self::GROUP_MODERATOR, 'edit' => self::GROUP_MODERATOR, 'index' => self::GROUP_VISITOR, @@ -89,8 +88,7 @@ class news extends common { // Signature de l'article public static $articleSignature = ''; - // Nombre d'articles dans la page de config: - public static $itemsperPage = 8; + /** * Flux RSS @@ -191,63 +189,10 @@ class news extends common { // Mise à jour des données de module $this->update(); - // Ids des news par ordre de publication - $newsIds = array_keys(helper::arrayCollumn($this->getData(['module', $this->getUrl(0), 'posts']), 'publishedOn', 'SORT_DESC')); - // Pagination fixe - $pagination = helper::pagination($newsIds, $this->getUrl(),self::$itemsperPage ); - // Liste des pages - self::$pages = $pagination['pages']; - // News en fonction de la pagination - for($i = $pagination['first']; $i < $pagination['last']; $i++) { - // Met en forme le tableau - $dateOn = mb_detect_encoding(strftime('%d %B %Y', $this->getData(['module', $this->getUrl(0),'posts', $newsIds[$i], 'publishedOn'])), 'UTF-8', true) - ? strftime('%d %B %Y', $this->getData(['module', $this->getUrl(0),'posts', $newsIds[$i], 'publishedOn'])) - : utf8_encode(strftime('%d %B %Y', $this->getData(['module', $this->getUrl(0),'posts', $newsIds[$i], 'publishedOn']))); - $dateOn .= ' à '; - $dateOn .= mb_detect_encoding(strftime('%H:%M', $this->getData(['module', $this->getUrl(0),'posts', $newsIds[$i], 'publishedOn'])), 'UTF-8', true) - ? strftime('%H:%M', $this->getData(['module', $this->getUrl(0),'posts', $newsIds[$i], 'publishedOn'])) - : utf8_encode(strftime('%H:%M', $this->getData(['module', $this->getUrl(0),'posts', $newsIds[$i], 'publishedOn']))); - if ($this->getData(['module', $this->getUrl(0),'posts', $newsIds[$i], 'publishedOff'])) { - $dateOff = mb_detect_encoding(strftime('%d %B %Y', $this->getData(['module', $this->getUrl(0),'posts', $newsIds[$i], 'publishedOff'])), 'UTF-8', true) - ? strftime('%d %B %Y', $this->getData(['module', $this->getUrl(0),'posts', $newsIds[$i], 'publishedOff'])) - : utf8_encode(strftime('%d %B %Y', $this->getData(['module', $this->getUrl(0),'posts', $newsIds[$i], 'publishedOff']))); - $dateOff .= ' à '; - $dateOff .= mb_detect_encoding(strftime('%H:%M', $this->getData(['module', $this->getUrl(0),'posts', $newsIds[$i], 'publishedOff'])), 'UTF-8', true) - ? strftime('%H:%M', $this->getData(['module', $this->getUrl(0),'posts', $newsIds[$i], 'publishedOff'])) - : utf8_encode(strftime('%H:%M', $this->getData(['module', $this->getUrl(0),'posts', $newsIds[$i], 'publishedOff']))); - } else { - $dateOff = 'Permanent'; - } - self::$news[] = [ - $this->getData(['module', $this->getUrl(0),'posts', $newsIds[$i], 'title']), - $dateOn, - $dateOff, - self::$states[$this->getData(['module', $this->getUrl(0),'posts', $newsIds[$i], 'state'])], - template::button('newsConfigEdit' . $newsIds[$i], [ - 'href' => helper::baseUrl() . $this->getUrl(0) . '/edit/' . $newsIds[$i]. '/' . $_SESSION['csrf'], - 'value' => template::ico('pencil') - ]), - template::button('newsConfigDelete' . $newsIds[$i], [ - 'class' => 'newsConfigDelete buttonRed', - 'href' => helper::baseUrl() . $this->getUrl(0) . '/delete/' . $newsIds[$i] . '/' . $_SESSION['csrf'], - 'value' => template::ico('cancel') - ]) - ]; - } - // Valeurs en sortie - $this->addOutput([ - 'title' => 'Configuration du module', - 'view' => 'config', - 'vendor' => [ - 'tinycolorpicker' - ] - ]); - } - - public function layout() { // Soumission du formulaire if($this->isPost()) { + // Générer la feuille de CSS $style = '.newsFrame {'; $style .= 'border:' . $this->getInput('newsThemeBorderStyle',helper::FILTER_STRING_SHORT) . ' ' . $this->getInput('newsThemeBorderColor') . ' ' . $this->getInput('newsThemeBorderWidth',helper::FILTER_STRING_SHORT) . ';'; @@ -272,26 +217,69 @@ class news extends common { ]]); $this->setData(['module', $this->getUrl(0), 'config',[ - 'feeds' => $this->getInput('newsLayoutShowFeeds',helper::FILTER_BOOLEAN), - 'feedsLabel' => $this->getInput('newsLayoutFeedslabel',helper::FILTER_STRING_SHORT), - 'itemsperPage' => $this->getInput('newsLayoutItemsperPage', helper::FILTER_INT,true), - 'itemsperCol' => $this->getInput('newsLayoutItemsperCol', helper::FILTER_INT,true), - 'height' => $this->getInput('newsLayoutHeight', helper::FILTER_INT,true), + 'feeds' => $this->getInput('newsConfigShowFeeds',helper::FILTER_BOOLEAN), + 'feedsLabel' => $this->getInput('newsConfigFeedslabel',helper::FILTER_STRING_SHORT), + 'itemsperPage' => $this->getInput('newsConfigItemsperPage', helper::FILTER_INT,true), + 'itemsperCol' => $this->getInput('newsConfigItemsperCol', helper::FILTER_INT,true), + 'height' => $this->getInput('newsConfigHeight', helper::FILTER_INT,true), 'versionData' => $this->getData(['module', $this->getUrl(0), 'config', 'versionData']) ]]); // Valeurs en sortie $this->addOutput([ - 'redirect' => helper::baseUrl() . $this->getUrl(0) . '/layout', + 'redirect' => helper::baseUrl() . $this->getUrl(0) . '/config', 'notification' => 'Modifications enregistrées', 'state' => true ]); } else { + // Ids des news par ordre de publication + $newsIds = array_keys(helper::arrayCollumn($this->getData(['module', $this->getUrl(0), 'posts']), 'publishedOn', 'SORT_DESC')); + // Pagination + $pagination = helper::pagination($newsIds, $this->getUrl(),$this->getData(['module', $this->getUrl(0), 'config', 'itemsperPage']) ); + // Liste des pages + self::$pages = $pagination['pages']; + // News en fonction de la pagination + for($i = $pagination['first']; $i < $pagination['last']; $i++) { + // Met en forme le tableau + $dateOn = mb_detect_encoding(strftime('%d %B %Y', $this->getData(['module', $this->getUrl(0),'posts', $newsIds[$i], 'publishedOn'])), 'UTF-8', true) + ? strftime('%d %B %Y', $this->getData(['module', $this->getUrl(0),'posts', $newsIds[$i], 'publishedOn'])) + : utf8_encode(strftime('%d %B %Y', $this->getData(['module', $this->getUrl(0),'posts', $newsIds[$i], 'publishedOn']))); + $dateOn .= ' à '; + $dateOn .= mb_detect_encoding(strftime('%H:%M', $this->getData(['module', $this->getUrl(0),'posts', $newsIds[$i], 'publishedOn'])), 'UTF-8', true) + ? strftime('%H:%M', $this->getData(['module', $this->getUrl(0),'posts', $newsIds[$i], 'publishedOn'])) + : utf8_encode(strftime('%H:%M', $this->getData(['module', $this->getUrl(0),'posts', $newsIds[$i], 'publishedOn']))); + if ($this->getData(['module', $this->getUrl(0),'posts', $newsIds[$i], 'publishedOff'])) { + $dateOff = mb_detect_encoding(strftime('%d %B %Y', $this->getData(['module', $this->getUrl(0),'posts', $newsIds[$i], 'publishedOff'])), 'UTF-8', true) + ? strftime('%d %B %Y', $this->getData(['module', $this->getUrl(0),'posts', $newsIds[$i], 'publishedOff'])) + : utf8_encode(strftime('%d %B %Y', $this->getData(['module', $this->getUrl(0),'posts', $newsIds[$i], 'publishedOff']))); + $dateOff .= ' à '; + $dateOff .= mb_detect_encoding(strftime('%H:%M', $this->getData(['module', $this->getUrl(0),'posts', $newsIds[$i], 'publishedOff'])), 'UTF-8', true) + ? strftime('%H:%M', $this->getData(['module', $this->getUrl(0),'posts', $newsIds[$i], 'publishedOff'])) + : utf8_encode(strftime('%H:%M', $this->getData(['module', $this->getUrl(0),'posts', $newsIds[$i], 'publishedOff']))); + } else { + $dateOff = 'Permanent'; + } + self::$news[] = [ + $this->getData(['module', $this->getUrl(0),'posts', $newsIds[$i], 'title']), + $dateOn, + $dateOff, + self::$states[$this->getData(['module', $this->getUrl(0),'posts', $newsIds[$i], 'state'])], + template::button('newsConfigEdit' . $newsIds[$i], [ + 'href' => helper::baseUrl() . $this->getUrl(0) . '/edit/' . $newsIds[$i]. '/' . $_SESSION['csrf'], + 'value' => template::ico('pencil') + ]), + template::button('newsConfigDelete' . $newsIds[$i], [ + 'class' => 'newsConfigDelete buttonRed', + 'href' => helper::baseUrl() . $this->getUrl(0) . '/delete/' . $newsIds[$i] . '/' . $_SESSION['csrf'], + 'value' => template::ico('cancel') + ]) + ]; + } // Valeurs en sortie $this->addOutput([ - 'title' => 'Mise en page', - 'view' => 'layout', + 'title' => 'Configuration du module', + 'view' => 'config', 'vendor' => [ 'tinycolorpicker' ] @@ -447,7 +435,8 @@ class news extends common { $newsIds[] = $newsId; } } - // Pagination selon le layout + // Pagination + //$pagination = helper::pagination($newsIds, $this->getUrl(),$this->getData(['config','itemsperPage'])); $pagination = helper::pagination($newsIds, $this->getUrl(),$this->getData(['module', $this->getUrl(0),'config', 'itemsperPage'])); // Nombre de colonnes self::$nbrCol = $this->getData(['module', $this->getUrl(0),'config', 'itemsperCol']); diff --git a/module/news/view/config/config.php b/module/news/view/config/config.php index 70b14434..873c9a66 100644 --- a/module/news/view/config/config.php +++ b/module/news/view/config/config.php @@ -16,14 +16,87 @@ ]); ?>
- helper::baseUrl() . $this->getUrl(0) . '/layout', - 'ico' => 'puzzle', - 'value' => 'Mise en page' - ]); ?> + +
+ +
+
+
+

Paramètres du module

+
+
+ $this->getData(['module', $this->getUrl(0), 'config', 'feeds']), + 'help' => 'Flux limité aux articles de la première page.' + ]); ?> +
+
+ 'Etiquette RSS', + 'value' => $this->getData(['module', $this->getUrl(0), 'config', 'feedsLabel']) + ]); ?> +
+
+
+
+ 'Nombre de colonnes', + 'selected' => $this->getData(['module', $this->getUrl(0),'config', 'itemsperCol']) + ]); ?> +
+
+ 'Articles par page', + 'selected' => $this->getData(['module', $this->getUrl(0),'config', 'itemsperPage']) + ]); ?> +
+
+ 'Abrégé de l\'article', + 'selected' => $this->getData(['module', $this->getUrl(0),'config', 'height']) + ]); ?> +
+
+
+
+
+
+
+
+

Thème du module

+
+
+ 'Bordure', + 'selected' => $this->getData(['module', $this->getUrl(0),'theme', 'borderStyle']) + ]); ?> +
+
+ 'Epaisseur', + 'selected' => $this->getData(['module', $this->getUrl(0),'theme', 'borderWidth']) + ]); ?> +
+
+ 'colorPicker', + 'help' => 'Couleur visible en l\'absence d\'une image.
Le curseur horizontal règle le niveau de transparence.', + 'label' => 'Couleur de la bordure', + 'value' => $this->getData(['module', $this->getUrl(0),'theme', 'borderColor']) + ]); ?> +
+
+ 'colorPicker', + 'help' => 'Couleur visible en l\'absence d\'une image.
Le curseur horizontal règle le niveau de transparence.', + 'label' => 'Couleur du fond', + 'value' => $this->getData(['module', $this->getUrl(0),'theme', 'backgroundColor']) + ]); ?> +
+
+
- diff --git a/module/news/view/layout/layout.css b/module/news/view/layout/layout.css deleted file mode 100644 index 52709ea6..00000000 --- a/module/news/view/layout/layout.css +++ /dev/null @@ -1,18 +0,0 @@ -/** - * This file is part of Zwii. - * - * For full copyright and license information, please see the LICENSE - * file that was distributed with this source code. - * - * @author Rémi Jean - * @copyright Copyright (C) 2008-2018, Rémi Jean - * @author Frédéric Tempez - * @copyright Copyright (C) 2018-2022, Frédéric Tempez - * @license GNU General Public License, version 3 - * @link http://zwiicms.fr/ - */ - - -/** NE PAS EFFACER -* admin.css -*/ \ No newline at end of file diff --git a/module/news/view/layout/layout.php b/module/news/view/layout/layout.php deleted file mode 100644 index 06499a15..00000000 --- a/module/news/view/layout/layout.php +++ /dev/null @@ -1,93 +0,0 @@ - -
-
- 'buttonGrey', - 'href' => helper::baseUrl() . $this->getUrl(0) . '/config', - 'ico' => 'left', - 'value' => 'Retour' - ]); ?> -
-
- -
-
-
-
-
-

Paramètres du module

-
-
- $this->getData(['module', $this->getUrl(0), 'config', 'feeds']), - 'help' => 'Flux limité aux articles de la première page.' - ]); ?> -
-
- 'Etiquette RSS', - 'value' => $this->getData(['module', $this->getUrl(0), 'config', 'feedsLabel']) - ]); ?> -
-
-
-
- 'Nombre de colonnes', - 'selected' => $this->getData(['module', $this->getUrl(0),'config', 'itemsperCol']) - ]); ?> -
-
- 'Articles par page', - 'selected' => $this->getData(['module', $this->getUrl(0),'config', 'itemsperPage']) - ]); ?> -
-
- 'Abrégé de l\'article', - 'selected' => $this->getData(['module', $this->getUrl(0),'config', 'height']) - ]); ?> -
-
-
-
-
-
-
-
-

Thème du module

-
-
- 'Bordure', - 'selected' => $this->getData(['module', $this->getUrl(0),'theme', 'borderStyle']) - ]); ?> -
-
- 'Epaisseur', - 'selected' => $this->getData(['module', $this->getUrl(0),'theme', 'borderWidth']) - ]); ?> -
-
- 'colorPicker', - 'help' => 'Couleur visible en l\'absence d\'une image.
Le curseur horizontal règle le niveau de transparence.', - 'label' => 'Couleur de la bordure', - 'value' => $this->getData(['module', $this->getUrl(0),'theme', 'borderColor']) - ]); ?> -
-
- 'colorPicker', - 'help' => 'Couleur visible en l\'absence d\'une image.
Le curseur horizontal règle le niveau de transparence.', - 'label' => 'Couleur du fond', - 'value' => $this->getData(['module', $this->getUrl(0),'theme', 'backgroundColor']) - ]); ?> -
-
-
-
-
- \ No newline at end of file From 2a90e078df63a1ca7c0b1ac9cda48d9a6d93739c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Tempez?= Date: Wed, 19 Jan 2022 19:08:51 +0100 Subject: [PATCH 03/12] point version le dossier update v11 --- core/core.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/core.php b/core/core.php index d13e85d6..6a15f78d 100644 --- a/core/core.php +++ b/core/core.php @@ -46,7 +46,7 @@ class common { // Numéro de version const ZWII_UPDATE_URL = 'https://forge.chapril.org/ZwiiCMS-Team/update/raw/branch/master/'; const ZWII_VERSION = '11.2.03'; - const ZWII_UPDATE_CHANNEL = "test"; + const ZWII_UPDATE_CHANNEL = "v11"; public static $actions = []; public static $coreModuleIds = [ From 86116c6563e8c3d4a179fea75c4fecf60e90a4d6 Mon Sep 17 00:00:00 2001 From: fredtempez Date: Fri, 21 Jan 2022 08:45:52 +0100 Subject: [PATCH 04/12] 11.2.04 Check Version --- core/class/helper.class.php | 2 +- core/core.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/core/class/helper.class.php b/core/class/helper.class.php index 6940bd1c..99f33ee2 100644 --- a/core/class/helper.class.php +++ b/core/class/helper.class.php @@ -281,7 +281,7 @@ class helper { if($version = helper::getOnlineVersion()) { //return (trim($version) !== common::ZWII_VERSION); - return ((version_compare(common::ZWII_VERSION,$version)) === -1); + return ((version_compare(common::ZWII_VERSION,$version,'<')) === -1); } else { return false; diff --git a/core/core.php b/core/core.php index 6a15f78d..6c85422f 100644 --- a/core/core.php +++ b/core/core.php @@ -45,7 +45,7 @@ class common { // Numéro de version const ZWII_UPDATE_URL = 'https://forge.chapril.org/ZwiiCMS-Team/update/raw/branch/master/'; - const ZWII_VERSION = '11.2.03'; + const ZWII_VERSION = '11.2.04'; const ZWII_UPDATE_CHANNEL = "v11"; public static $actions = []; From 99f57dfd315b71962623a789588efb5e0f56a5d0 Mon Sep 17 00:00:00 2001 From: fredtempez Date: Fri, 21 Jan 2022 08:48:34 +0100 Subject: [PATCH 05/12] 11204 changes.md + commentaire dans htaccess --- .htaccess | 3 --- CHANGES.md | 4 ++++ LICENSE | 1 + README.md | 2 +- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.htaccess b/.htaccess index 7c933e06..5b415e20 100644 --- a/.htaccess +++ b/.htaccess @@ -24,9 +24,6 @@ AddOutputFilterByType DEFLATE application/x-javascript -# Cache le PHPSESSID de l'url // Désormais géré par index.php -# SetEnv SESSION_USE_TRANS_SID 0 - # Bloque l'accès à la liste des fichiers Options -Indexes diff --git a/CHANGES.md b/CHANGES.md index 06733512..d7cecc2c 100755 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,5 +1,9 @@ # Changelog +## Version 11.2.04 +- Correction : + - Affiche une notification de mise à jour si la numérotation de la version en ligne est supérieur à celle installée. + ## Version 11.2.03 - Corrections : - Addon, bug lors de l'effacement d'un module non initialisé. diff --git a/LICENSE b/LICENSE index 30ace6a8..af43b008 100755 --- a/LICENSE +++ b/LICENSE @@ -1,3 +1,4 @@ + GNU GENERAL PUBLIC LICENSE Version 3, 29 June 2007 diff --git a/README.md b/README.md index 5b6615e0..f280a692 100755 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ -# ZwiiCMS 11.2.03 +# ZwiiCMS 11.2.04 Zwii 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. From bbfe41e0fecd5cdf5f0d997d7d069927d5c3357a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Tempez?= Date: Sat, 22 Jan 2022 16:36:56 +0100 Subject: [PATCH 06/12] typo --- CHANGES.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index d7cecc2c..b59e04d4 100755 --- a/CHANGES.md +++ b/CHANGES.md @@ -2,7 +2,7 @@ ## Version 11.2.04 - Correction : - - Affiche une notification de mise à jour si la numérotation de la version en ligne est supérieur à celle installée. + - Affiche une notification de mise à jour si la numérotation de la version en ligne est supérieure à celle installée. ## Version 11.2.03 - Corrections : From 4b2183cc34659551e5dd5ad8d845698bc575076a Mon Sep 17 00:00:00 2001 From: fredtempez Date: Mon, 24 Jan 2022 16:45:37 +0100 Subject: [PATCH 07/12] =?UTF-8?q?Champs=20de=20cookie=20obligatoires=20si?= =?UTF-8?q?=20case=20non=20coch=C3=A9e?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- core/module/config/config.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/core/module/config/config.php b/core/module/config/config.php index d39997c0..1a3e66c2 100644 --- a/core/module/config/config.php +++ b/core/module/config/config.php @@ -451,13 +451,13 @@ class config extends common { 'title' => $this->getInput('localeTitle', helper::FILTER_STRING_SHORT, true), 'cookies' => [ // Les champs sont obligatoires si l'option consentement des cookies est active - 'mainLabel' => $this->getInput('localeCookiesZwiiText', helper::FILTER_STRING_LONG, $this->getData(['config', 'cookieConsent'])), - 'gaLabel' => $this->getInput('localeCookiesGaText', helper::FILTER_STRING_LONG, $this->getData(['config', 'cookieConsent'])), - 'titleLabel' => $this->getInput('localeCookiesTitleText', helper::FILTER_STRING_SHORT, $this->getData(['config', 'cookieConsent'])), - 'linkLegalLabel' => $this->getInput('localeCookiesLinkMlText', helper::FILTER_STRING_SHORT, $this->getData(['config', 'cookieConsent'])), - 'checkboxGaLabel' => $this->getInput('localeCookiesCheckboxGaText', helper::FILTER_STRING_SHORT, $this->getData(['config', 'cookieConsent'])), - 'cookiesFooterText' => $this->getInput('localeCookiesFooterText', helper::FILTER_STRING_SHORT, $this->getData(['config', 'cookieConsent'])), - 'buttonValidLabel' =>$this->getInput('localeCookiesButtonText', helper::FILTER_STRING_SHORT, $this->getData(['config', 'cookieConsent'])) + 'mainLabel' => $this->getInput('localeCookiesZwiiText', helper::FILTER_STRING_LONG, $this->getData(['config', 'cookieConsent', helper::FILTER_BOOLEAN])), + 'gaLabel' => $this->getInput('localeCookiesGaText', helper::FILTER_STRING_LONG, $this->getData(['config', 'cookieConsent', helper::FILTER_BOOLEAN])), + 'titleLabel' => $this->getInput('localeCookiesTitleText', helper::FILTER_STRING_SHORT, $this->getData(['config', 'cookieConsent', helper::FILTER_BOOLEAN])), + 'linkLegalLabel' => $this->getInput('localeCookiesLinkMlText', helper::FILTER_STRING_SHORT, $this->getData(['config', 'cookieConsent', helper::FILTER_BOOLEAN])), + 'checkboxGaLabel' => $this->getInput('localeCookiesCheckboxGaText', helper::FILTER_STRING_SHORT, $this->getData(['config', 'cookieConsent', helper::FILTER_BOOLEAN])), + 'cookiesFooterText' => $this->getInput('localeCookiesFooterText', helper::FILTER_STRING_SHORT, $this->getData(['config', 'cookieConsent', helper::FILTER_BOOLEAN])), + 'buttonValidLabel' =>$this->getInput('localeCookiesButtonText', helper::FILTER_STRING_SHORT, $this->getData(['config', 'cookieConsent', helper::FILTER_BOOLEAN])) ] ] ]); From 3c0c2905339e53888985568f8f26294e695e7f6e Mon Sep 17 00:00:00 2001 From: fredtempez Date: Mon, 24 Jan 2022 16:49:25 +0100 Subject: [PATCH 08/12] =?UTF-8?q?Revert=20"Champs=20de=20cookie=20obligato?= =?UTF-8?q?ires=20si=20case=20non=20coch=C3=A9e"?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This reverts commit 4b2183cc34659551e5dd5ad8d845698bc575076a. --- core/module/config/config.php | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/core/module/config/config.php b/core/module/config/config.php index 1a3e66c2..d39997c0 100644 --- a/core/module/config/config.php +++ b/core/module/config/config.php @@ -451,13 +451,13 @@ class config extends common { 'title' => $this->getInput('localeTitle', helper::FILTER_STRING_SHORT, true), 'cookies' => [ // Les champs sont obligatoires si l'option consentement des cookies est active - 'mainLabel' => $this->getInput('localeCookiesZwiiText', helper::FILTER_STRING_LONG, $this->getData(['config', 'cookieConsent', helper::FILTER_BOOLEAN])), - 'gaLabel' => $this->getInput('localeCookiesGaText', helper::FILTER_STRING_LONG, $this->getData(['config', 'cookieConsent', helper::FILTER_BOOLEAN])), - 'titleLabel' => $this->getInput('localeCookiesTitleText', helper::FILTER_STRING_SHORT, $this->getData(['config', 'cookieConsent', helper::FILTER_BOOLEAN])), - 'linkLegalLabel' => $this->getInput('localeCookiesLinkMlText', helper::FILTER_STRING_SHORT, $this->getData(['config', 'cookieConsent', helper::FILTER_BOOLEAN])), - 'checkboxGaLabel' => $this->getInput('localeCookiesCheckboxGaText', helper::FILTER_STRING_SHORT, $this->getData(['config', 'cookieConsent', helper::FILTER_BOOLEAN])), - 'cookiesFooterText' => $this->getInput('localeCookiesFooterText', helper::FILTER_STRING_SHORT, $this->getData(['config', 'cookieConsent', helper::FILTER_BOOLEAN])), - 'buttonValidLabel' =>$this->getInput('localeCookiesButtonText', helper::FILTER_STRING_SHORT, $this->getData(['config', 'cookieConsent', helper::FILTER_BOOLEAN])) + 'mainLabel' => $this->getInput('localeCookiesZwiiText', helper::FILTER_STRING_LONG, $this->getData(['config', 'cookieConsent'])), + 'gaLabel' => $this->getInput('localeCookiesGaText', helper::FILTER_STRING_LONG, $this->getData(['config', 'cookieConsent'])), + 'titleLabel' => $this->getInput('localeCookiesTitleText', helper::FILTER_STRING_SHORT, $this->getData(['config', 'cookieConsent'])), + 'linkLegalLabel' => $this->getInput('localeCookiesLinkMlText', helper::FILTER_STRING_SHORT, $this->getData(['config', 'cookieConsent'])), + 'checkboxGaLabel' => $this->getInput('localeCookiesCheckboxGaText', helper::FILTER_STRING_SHORT, $this->getData(['config', 'cookieConsent'])), + 'cookiesFooterText' => $this->getInput('localeCookiesFooterText', helper::FILTER_STRING_SHORT, $this->getData(['config', 'cookieConsent'])), + 'buttonValidLabel' =>$this->getInput('localeCookiesButtonText', helper::FILTER_STRING_SHORT, $this->getData(['config', 'cookieConsent'])) ] ] ]); From ee91af4bdcbf5439b7c2808b82dc2c5a8b494d82 Mon Sep 17 00:00:00 2001 From: fredtempez Date: Mon, 24 Jan 2022 16:53:04 +0100 Subject: [PATCH 09/12] 11205 Pb de config des cookies --- CHANGES.md | 4 ++++ README.md | 2 +- core/core.php | 2 +- core/module/config/config.php | 14 +++++++------- 4 files changed, 13 insertions(+), 9 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index b59e04d4..350cbc4c 100755 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,5 +1,9 @@ # Changelog +## Version 11.2.05 +- Correction : + - Configuration / localisation : Les champs de cookies ne devraient pas être obligatoires lorsque la case à cocher de consentement des cookies n'est pas sélectionnée. + ## Version 11.2.04 - Correction : - Affiche une notification de mise à jour si la numérotation de la version en ligne est supérieure à celle installée. diff --git a/README.md b/README.md index f280a692..d2f9d52d 100755 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ -# ZwiiCMS 11.2.04 +# ZwiiCMS 11.2.05 Zwii 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. diff --git a/core/core.php b/core/core.php index 6c85422f..f50ee3c1 100644 --- a/core/core.php +++ b/core/core.php @@ -45,7 +45,7 @@ class common { // Numéro de version const ZWII_UPDATE_URL = 'https://forge.chapril.org/ZwiiCMS-Team/update/raw/branch/master/'; - const ZWII_VERSION = '11.2.04'; + const ZWII_VERSION = '11.2.05'; const ZWII_UPDATE_CHANNEL = "v11"; public static $actions = []; diff --git a/core/module/config/config.php b/core/module/config/config.php index d39997c0..1a3e66c2 100644 --- a/core/module/config/config.php +++ b/core/module/config/config.php @@ -451,13 +451,13 @@ class config extends common { 'title' => $this->getInput('localeTitle', helper::FILTER_STRING_SHORT, true), 'cookies' => [ // Les champs sont obligatoires si l'option consentement des cookies est active - 'mainLabel' => $this->getInput('localeCookiesZwiiText', helper::FILTER_STRING_LONG, $this->getData(['config', 'cookieConsent'])), - 'gaLabel' => $this->getInput('localeCookiesGaText', helper::FILTER_STRING_LONG, $this->getData(['config', 'cookieConsent'])), - 'titleLabel' => $this->getInput('localeCookiesTitleText', helper::FILTER_STRING_SHORT, $this->getData(['config', 'cookieConsent'])), - 'linkLegalLabel' => $this->getInput('localeCookiesLinkMlText', helper::FILTER_STRING_SHORT, $this->getData(['config', 'cookieConsent'])), - 'checkboxGaLabel' => $this->getInput('localeCookiesCheckboxGaText', helper::FILTER_STRING_SHORT, $this->getData(['config', 'cookieConsent'])), - 'cookiesFooterText' => $this->getInput('localeCookiesFooterText', helper::FILTER_STRING_SHORT, $this->getData(['config', 'cookieConsent'])), - 'buttonValidLabel' =>$this->getInput('localeCookiesButtonText', helper::FILTER_STRING_SHORT, $this->getData(['config', 'cookieConsent'])) + 'mainLabel' => $this->getInput('localeCookiesZwiiText', helper::FILTER_STRING_LONG, $this->getData(['config', 'cookieConsent', helper::FILTER_BOOLEAN])), + 'gaLabel' => $this->getInput('localeCookiesGaText', helper::FILTER_STRING_LONG, $this->getData(['config', 'cookieConsent', helper::FILTER_BOOLEAN])), + 'titleLabel' => $this->getInput('localeCookiesTitleText', helper::FILTER_STRING_SHORT, $this->getData(['config', 'cookieConsent', helper::FILTER_BOOLEAN])), + 'linkLegalLabel' => $this->getInput('localeCookiesLinkMlText', helper::FILTER_STRING_SHORT, $this->getData(['config', 'cookieConsent', helper::FILTER_BOOLEAN])), + 'checkboxGaLabel' => $this->getInput('localeCookiesCheckboxGaText', helper::FILTER_STRING_SHORT, $this->getData(['config', 'cookieConsent', helper::FILTER_BOOLEAN])), + 'cookiesFooterText' => $this->getInput('localeCookiesFooterText', helper::FILTER_STRING_SHORT, $this->getData(['config', 'cookieConsent', helper::FILTER_BOOLEAN])), + 'buttonValidLabel' =>$this->getInput('localeCookiesButtonText', helper::FILTER_STRING_SHORT, $this->getData(['config', 'cookieConsent', helper::FILTER_BOOLEAN])) ] ] ]); From 199022a244c45fd4857e1303e82796fdf5f30f2e Mon Sep 17 00:00:00 2001 From: fredtempez Date: Tue, 25 Jan 2022 11:36:11 +0100 Subject: [PATCH 10/12] Gestion des cookies --- core/core.js.php | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/core/core.js.php b/core/core.js.php index 0f3343f2..afceb326 100644 --- a/core/core.js.php +++ b/core/core.js.php @@ -212,12 +212,11 @@ core.start = function() { */ $("#cookieForm").submit(function(event){ - // Varables des cookies - var samesite = "samesite=lax"; + // Variables des cookies var getUrl = window.location; - var domain = "domain=" + getUrl.host; - var path = "path=" + getUrl.pathname.split('/')[1]; - var samesite = "samesite=lax"; + var domain = "domain=" + getUrl.host + ";"; + var path = "path=" + getUrl.pathname.split('/')[1] + ";"; + var e = new Date(); e.setFullYear(e.getFullYear() + 1); var expires = "expires=" + e.toUTCString(); @@ -226,18 +225,18 @@ core.start = function() { var analytics = "getData(['config', 'seo', 'analyticsId']);?>"; // l'Id GA est défini dans la configuration, afficher la checkbox d'acceptation if( analytics.length > 0){ - // Traitement du retour de la checkbox + // Traitement du retour de la checkbox if ($("#googleAnalytics").is(":checked")) { // L'URL du serveur faut TRUE - document.cookie = "ZWII_COOKIE_GA_CONSENT=true;" + domain + ";" + path + ";" + samesite + ";" + expires; + + document.cookie = "ZWII_COOKIE_GA_CONSENT=true;samesite=strict;" + domain + path + expires; } else { - document.cookie = "ZWII_COOKIE_GA_CONSENT=false;" + domain + ";" + path + ";" + samesite + ";" + expires; + document.cookie = "ZWII_COOKIE_GA_CONSENT=false;samesite=strict;" + domain + path + expires; } } - // Stocke le cookie d'acceptation - document.cookie = "ZWII_COOKIE_CONSENT=true;" + domain + ";" + path + ";" + samesite + ";" + expires; + document.cookie = "ZWII_COOKIE_CONSENT=true;samesite=strict;" + domain + path + expires; }); From c575e9c69684ca39971c2534b9d8431aa31dedb2 Mon Sep 17 00:00:00 2001 From: fredtempez Date: Wed, 26 Jan 2022 09:51:51 +0100 Subject: [PATCH 11/12] =?UTF-8?q?11205=20bug=20icone=20comptes=20=C3=A9dit?= =?UTF-8?q?eurs?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- CHANGES.md | 3 ++- core/core.php | 5 ++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGES.md b/CHANGES.md index 350cbc4c..a6545922 100755 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,8 +1,9 @@ # Changelog ## Version 11.2.05 -- Correction : +- Corrections : - Configuration / localisation : Les champs de cookies ne devraient pas être obligatoires lorsque la case à cocher de consentement des cookies n'est pas sélectionnée. + - Disparition de l'icône de gestion du compte pour le profil éditeur. ## Version 11.2.04 - Correction : diff --git a/core/core.php b/core/core.php index f50ee3c1..c87c8a14 100644 --- a/core/core.php +++ b/core/core.php @@ -2021,7 +2021,7 @@ class common { } $rightItems .= '
  • ' . template::ico('cog-alt') . '
  • '; $rightItems .= '
  • ' . template::ico('users') . '
  • '; - $rightItems .= '
  • ' . template::ico('user', 'right') . '' . $this->getUser('firstname') . ' ' . $this->getUser('lastname') . '
  • '; + // Mise à jour automatique $today = mktime(0, 0, 0); // Une mise à jour est disponible + recherche auto activée + 1 jour de délais @@ -2038,6 +2038,9 @@ class common { $rightItems .= '
  • ' . template::ico('update colorRed') . '
  • '; } } + if($this->getUser('group') >= self::GROUP_MODERATOR) { + $rightItems .= '
  • ' . template::ico('user', 'right') . '' . $this->getUser('firstname') . ' ' . $this->getUser('lastname') . '
  • '; + } $rightItems .= '
  • ' . template::ico('logout') . '
  • '; // Barre de membre echo '
      ' . $leftItems . '
      ' . $rightItems . '
    '; From 21d8c58b96f0bb61875934df18d1cdea89ed4c49 Mon Sep 17 00:00:00 2001 From: fredtempez Date: Wed, 26 Jan 2022 10:22:41 +0100 Subject: [PATCH 12/12] bug autoupdate --- core/class/helper.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/class/helper.class.php b/core/class/helper.class.php index 99f33ee2..6940bd1c 100644 --- a/core/class/helper.class.php +++ b/core/class/helper.class.php @@ -281,7 +281,7 @@ class helper { if($version = helper::getOnlineVersion()) { //return (trim($version) !== common::ZWII_VERSION); - return ((version_compare(common::ZWII_VERSION,$version,'<')) === -1); + return ((version_compare(common::ZWII_VERSION,$version)) === -1); } else { return false;