From 0abb33685095898d491863139770ee9d7782f73a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Tempez?= Date: Fri, 11 Oct 2024 11:34:13 +0200 Subject: [PATCH] Blog 8.00 ajoute les options d'affichage de la date et de l'heure --- module/blog/blog.php | 15 +++--- module/blog/changes.md | 5 +- module/blog/view/article/article.php | 23 +++++++-- module/blog/view/index/index.php | 76 ++++++++++++++++++++-------- module/blog/view/option/option.php | 56 ++++++++++++-------- 5 files changed, 122 insertions(+), 53 deletions(-) diff --git a/module/blog/blog.php b/module/blog/blog.php index eaa590b1..0f8bbb68 100755 --- a/module/blog/blog.php +++ b/module/blog/blog.php @@ -16,7 +16,7 @@ class blog extends common { - const VERSION = '7.12'; + const VERSION = '8.0'; const REALNAME = 'Blog'; const DELETE = true; const UPDATE = '0.0'; @@ -174,10 +174,12 @@ class blog extends common $this->setData(['module', $this->getUrl(0), 'config', 'timeFormat', '%H:%M']); $this->setData(['module', $this->getUrl(0), 'config', 'versionData', '6.5']); } - // Version 7.4 - if (version_compare($this->getData(['module', $this->getUrl(0), 'config', 'versionData']), '7.4', '<')) { + // Version 8.0 + if (version_compare($this->getData(['module', $this->getUrl(0), 'config', 'versionData']), '8.0', '<')) { $this->setData(['module', $this->getUrl(0), 'config', 'buttonBack', true]); - $this->setData(['module', $this->getUrl(0), 'config', 'versionData', '7.4']); + $this->setData(['module', $this->getUrl(0), 'config', 'showTime', true]); + $this->setData(['module', $this->getUrl(0), 'config', 'showDate', true]); + $this->setData(['module', $this->getUrl(0), 'config', 'versionData', '8.0']); } } @@ -578,7 +580,9 @@ class blog extends common 'itemsperPage' => $this->getInput('blogOptionItemsperPage', helper::FILTER_INT, true), 'dateFormat' => $this->getInput('blogOptionDateFormat'), 'timeFormat' => $this->getInput('blogOptionTimeFormat'), - 'buttonBack' => $this->getInput('newsOptionButtonBack'), + 'buttonBack' => $this->getInput('blogOptionButtonBack', helper::FILTER_BOOLEAN), + 'showDate' => $this->getInput('blogOptionShowDate', helper::FILTER_BOOLEAN), + 'showTime' => $this->getInput('blogOptionShowTime', helper::FILTER_BOOLEAN), 'versionData' => $this->getData(['module', $this->getUrl(0), 'config', 'versionData']), ] ]); @@ -596,7 +600,6 @@ class blog extends common ]); } - /** * Suppression */ diff --git a/module/blog/changes.md b/module/blog/changes.md index 20335b41..2e5e1f2d 100755 --- a/module/blog/changes.md +++ b/module/blog/changes.md @@ -1,5 +1,8 @@ -# Version 7.12 +# Version 8.00 +- Ajoute deux nouvelles options pour afficher ou masquer la date et l'heure de l'article. - Corrige un bug d'affichage des articles lorsque le thème Moderne est sélectionné. +- Corrige un bug dans la méthode de tronquage de l'article, nécessite Zwii 13.5 +- Corrige un mauvais format de la propriété buttonBack non stockée au type booléen. # Version 7.11 - Le sélecteur de fichier affiche par défaut le chemin vers le fichier présent dans le champ. # Version 7.10 diff --git a/module/blog/view/article/article.php b/module/blog/view/article/article.php index 6f4eb217..770d3561 100755 --- a/module/blog/view/article/article.php +++ b/module/blog/view/article/article.php @@ -18,11 +18,28 @@
- + - - getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'publishedOn']), self::$i18nUI) . ' ' . helper::dateUTF8($module::$timeFormat, $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'publishedOn']), self::$i18nUI); ?> + + getData(['module', $this->getUrl(0), 'config', 'showDate']) === true + || $this->getData(['module', $this->getUrl(0), 'config', 'showTime']) === true + ): ?> + 'left']); ?> + + getData(['module', $this->getUrl(0), 'config', 'showDate']) === true): ?> + getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'publishedOn']), self::$i18nUI); ?> + + getData(['module', $this->getUrl(0), 'config', 'showDate']) === true + && $this->getData(['module', $this->getUrl(0), 'config', 'showTime']) === true + ): ?> + + + getData(['module', $this->getUrl(0), 'config', 'showTime']) === true): ?> + getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'publishedOn']), self::$i18nUI); ?> + isConnected() === true diff --git a/module/blog/view/index/index.php b/module/blog/view/index/index.php index 94d9c555..16bea967 100755 --- a/module/blog/view/index/index.php +++ b/module/blog/view/index/index.php @@ -24,11 +24,28 @@
- + signature($this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'userId'])); ?> - - getData(['module', $this->getUrl(0), 'posts', $articleId, 'publishedOn']), self::$i18nUI) . ' ' . helper::dateUTF8($module::$timeFormat, $this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'publishedOn']), self::$i18nUI); ?> + + getData(['module', $this->getUrl(0), 'config', 'showDate']) === true + || $this->getData(['module', $this->getUrl(0), 'config', 'showTime']) === true + ): ?> + 'left']); ?> + + getData(['module', $this->getUrl(0), 'config', 'showDate']) === true): ?> + getData(['module', $this->getUrl(0), 'posts', $articleId, 'publishedOn']), self::$i18nUI); ?> + + getData(['module', $this->getUrl(0), 'config', 'showDate']) === true + && $this->getData(['module', $this->getUrl(0), 'config', 'showTime']) === true + ): ?> + + + getData(['module', $this->getUrl(0), 'config', 'showTime']) === true): ?> + getData(['module', $this->getUrl(0), 'posts', $articleId, 'publishedOn']), self::$i18nUI); ?> +
@@ -139,27 +156,44 @@
- + signature($this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'userId'])); ?> - - getData(['module', $this->getUrl(0), 'posts', $articleId, 'publishedOn']), self::$i18nUI) . ' ' . helper::dateUTF8($module::$timeFormat, $this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'publishedOn']), self::$i18nUI); ?> -
-
- getData(['module', $this->getUrl(0), 'config', 'articlesLenght']); ?> - 0): ?> - - ... - - - + + getData(['module', $this->getUrl(0), 'config', 'showDate']) === true + || $this->getData(['module', $this->getUrl(0), 'config', 'showTime']) === true + ): ?> + 'left']); ?> + getData(['module', $this->getUrl(0), 'config', 'showDate']) === true): ?> + getData(['module', $this->getUrl(0), 'posts', $articleId, 'publishedOn']), self::$i18nUI); ?> + + getData(['module', $this->getUrl(0), 'config', 'showDate']) === true + && $this->getData(['module', $this->getUrl(0), 'config', 'showTime']) === true + ): ?> + + + getData(['module', $this->getUrl(0), 'config', 'showTime']) === true): ?> + getData(['module', $this->getUrl(0), 'posts', $articleId, 'publishedOn']), self::$i18nUI); ?> + +
+ getData(['module', $this->getUrl(0), 'config', 'articlesLenght']); ?> + 0): ?> + + ... + + + + +
diff --git a/module/blog/view/option/option.php b/module/blog/view/option/option.php index 7cd4b8a5..bc1c4bf6 100755 --- a/module/blog/view/option/option.php +++ b/module/blog/view/option/option.php @@ -19,30 +19,22 @@
- 'Disposition', - 'selected' => $this->getData(['module', $this->getUrl(0), 'config', 'layout']) + $this->getData(['module', $this->getUrl(0), 'config', 'showDate']), ]); ?>
- 'Aperçus', - 'selected' => $this->getData(['module', $this->getUrl(0), 'config', 'articlesLenght']) - ]); ?> -
-
- 'Articles par page', - 'selected' => $this->getData(['module', $this->getUrl(0), 'config', 'itemsperPage']) - ]); ?> -
-
'Format des dates', 'selected' => $this->getData(['module', $this->getUrl(0), 'config', 'dateFormat']) ]); ?>
-
+
+ $this->getData(['module', $this->getUrl(0), 'config', 'showTime']), + ]); ?> +
+
'Format des heures', 'selected' => $this->getData(['module', $this->getUrl(0), 'config', 'timeFormat']) @@ -50,19 +42,39 @@
+
+ 'Disposition', + 'selected' => $this->getData(['module', $this->getUrl(0), 'config', 'layout']) + ]); ?> +
+
+ 'Aperçus', + 'selected' => $this->getData(['module', $this->getUrl(0), 'config', 'articlesLenght']) + ]); ?> +
+
+ 'Articles par page', + 'selected' => $this->getData(['module', $this->getUrl(0), 'config', 'itemsperPage']) + ]); ?> +
+
+
+
+ $this->getData(['module', $this->getUrl(0), 'config', 'buttonBack']) + ]); ?> +
$this->getData(['module', $this->getUrl(0), 'config', 'feeds']), ]); ?>
-
- $this->getData(['module', $this->getUrl(0), 'config', 'buttonBack']) - ]); ?> -
'Texte de l\'étiquette', + 'label' => 'Texte de l\'étiquette RSS', 'value' => $this->getData(['module', $this->getUrl(0), 'config', 'feedsLabel']) ]); ?>