diff --git a/module/blog/blog.php b/module/blog/blog.php index 8e426063..4645213c 100755 --- a/module/blog/blog.php +++ b/module/blog/blog.php @@ -16,7 +16,7 @@ class blog extends common { - const VERSION = '6.4'; + const VERSION = '6.5'; const REALNAME = 'Blog'; const DELETE = true; const UPDATE = '0.0'; @@ -112,6 +112,25 @@ class blog extends common ]; + public static $dateFormats = [ + '%d %B %Y' => 'DD MMMM YYYY', + '%d/%m/%Y' => 'DD/MM/YYYY', + '%m/%d/%Y' => 'MM/DD/YYYY', + '%d/%m/%y' => 'DD/MM/YY', + '%m/%d/%y' => 'MM/DD/YY', + '%d-%m-%Y' => 'DD-MM-YYYY', + '%m-%d-%Y' => 'MM-DD-YYYY', + '%d-%m-%y' => 'DD-MM-YY', + '%m-%d-%y' => 'MM-DD-YY', + ]; + public static $timeFormats = [ + '%H:%M' => 'HH:MM', + '%I:%M:%S %p' => "HH:MM tt", + ]; + + public static $timeFormat = ''; + public static $dateFormat = ''; + // Nombre d'articles dans la page de config: public static $itemsperPage = 8; @@ -519,6 +538,8 @@ class blog extends common 'itemsperPage' => $this->getInput('blogOptionItemsperPage', helper::FILTER_INT, true), 'articlesLenght' => $this->getInput('blogOptionArticlesLenght', helper::FILTER_INT), 'versionData' => $this->getData(['module', $this->getUrl(0), 'config', 'versionData']), + 'dateFormat' => $this->getInput('blogOptionDateFormat', helper::FILTER_STRING_SHORT), + 'timeFormat' => $this->getInput('blogOptionTimeFormat', helper::FILTER_STRING_SHORT), ]]); // Valeurs en sortie $this->addOutput([ @@ -812,6 +833,9 @@ class blog extends common for ($i = $pagination['first']; $i < $pagination['last']; $i++) { self::$articles[$articleIds[$i]] = $this->getData(['module', $this->getUrl(0), 'posts', $articleIds[$i]]); } + // Format de temps + self::$dateFormat = $this->getData(['module', $this->getUrl(0), 'config', 'dateFormat']); + self::$timeFormat = $this->getData(['module', $this->getUrl(0), 'config', 'timeFormat']); // Valeurs en sortie $this->addOutput([ 'showBarEditButton' => true, diff --git a/module/blog/changes.md b/module/blog/changes.md index 0528223b..935b441b 100755 --- a/module/blog/changes.md +++ b/module/blog/changes.md @@ -1,4 +1,6 @@ # version 6.4 +- Formats de date +# version 6.4 - Multilingisme # version 6.31 - Miniature de l'image dans le flux RSS diff --git a/module/blog/i18n/en_EN.json b/module/blog/i18n/en_EN.json index 692b199f..1b24508a 100644 --- a/module/blog/i18n/en_EN.json +++ b/module/blog/i18n/en_EN.json @@ -36,7 +36,6 @@ "Grande": "Large", "Groupe du propriétaire": "Owner's group", "Image de couverture": "Coverage", - "Index des articles": "Index des articles", "Informations générales": "General informations", "L'article n'est visible qu'après la date de publication prévue.": "The article is only visible after the date of publication provided.", "Largeur de l'image": "Image width", diff --git a/module/blog/i18n/es.json b/module/blog/i18n/es.json index e9d3b496..2aedd822 100644 --- a/module/blog/i18n/es.json +++ b/module/blog/i18n/es.json @@ -36,7 +36,6 @@ "Grande": "Grande", "Groupe du propriétaire": "Grupo de propietarios", "Image de couverture": "Imagen de portada", - "Index des articles": "Índice de artículos", "Informations générales": "Información general", "L'article n'est visible qu'après la date de publication prévue.": "El artículo solo es visible después de la fecha de publicación programada.", "Largeur de l'image": "Ancho de la imagen", diff --git a/module/blog/i18n/fr_FR.json b/module/blog/i18n/fr_FR.json index 2730312a..84d5b094 100644 --- a/module/blog/i18n/fr_FR.json +++ b/module/blog/i18n/fr_FR.json @@ -36,7 +36,6 @@ "Grande": "", "Groupe du propriétaire": "", "Image de couverture": "", - "Index des articles": "", "Informations générales": "", "L'article n'est visible qu'après la date de publication prévue.": "", "Largeur de l'image": "", diff --git a/module/blog/i18n/gr_GR.json b/module/blog/i18n/gr_GR.json index 93ded12b..4e36cddd 100644 --- a/module/blog/i18n/gr_GR.json +++ b/module/blog/i18n/gr_GR.json @@ -36,7 +36,6 @@ "Grande": "Μεγάλη", "Groupe du propriétaire": "Ομάδα ιδιοκτήτη", "Image de couverture": "εικόνα εξωφύλλου", - "Index des articles": "Ευρετήριο άρθρων", "Informations générales": "Γενικές πληροφορίες", "L'article n'est visible qu'après la date de publication prévue.": "Το άρθρο είναι ορατό μόνο μετά την προγραμματισμένη ημερομηνία δημοσίευσης", "Largeur de l'image": "Πλάτος εικόνας", diff --git a/module/blog/i18n/it.json b/module/blog/i18n/it.json index 173a637c..14bb8ed2 100644 --- a/module/blog/i18n/it.json +++ b/module/blog/i18n/it.json @@ -36,7 +36,7 @@ "Grande": "Grande", "Groupe du propriétaire": "Gruppo del proprietario", "Image de couverture": "Copertura", - "Index des articles": "Articoli indicizzati", + "Informations générales": "Informazioni generali", "L'article n'est visible qu'après la date de publication prévue.": "L'articolo è visibile solo dopo la data di pubblicazione fornita.", "Largeur de l'image": "Larghezza dell'immagine", diff --git a/module/blog/i18n/pt_PT.json b/module/blog/i18n/pt_PT.json index 567766c8..abd98177 100644 --- a/module/blog/i18n/pt_PT.json +++ b/module/blog/i18n/pt_PT.json @@ -36,7 +36,6 @@ "Grande": "Grande", "Groupe du propriétaire": "Grupo do proprietário", "Image de couverture": "Cobertura", - "Index des articles": "ÍNDICE DES ARTIGOS", "Informations générales": "Informações gerais", "L'article n'est visible qu'après la date de publication prévue.": "O artigo é visível apenas após a data da publicação fornecida.", "Largeur de l'image": "Largura da imagem", diff --git a/module/blog/view/index/index.php b/module/blog/view/index/index.php index 09db597b..0ec34661 100755 --- a/module/blog/view/index/index.php +++ b/module/blog/view/index/index.php @@ -17,7 +17,7 @@ signature($this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'userId'])); ?> - getData(['module', $this->getUrl(0), 'posts', $articleId, 'publishedOn'])) . ' - ' . helper::dateUTF8('%H:%M', $this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'publishedOn'])); ?> + getData(['module', $this->getUrl(0), 'posts', $articleId, 'publishedOn'])) . ' - ' . helper::dateUTF8($module::$timeFormat, $this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'publishedOn'])); ?>
@@ -130,7 +130,7 @@ signature($this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'userId']));?> - getData(['module', $this->getUrl(0), 'posts', $articleId, 'publishedOn'])) . ' - ' . helper::dateUTF8('%H:%M', $this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'publishedOn'])); ?> + getData(['module', $this->getUrl(0), 'posts', $articleId, 'publishedOn'])) . ' - ' . helper::dateUTF8($module::$timeFormat, $this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'publishedOn'])); ?>

getData(['module', $this->getUrl(0), 'config', 'articlesLenght']) !== 0 ? $this->getData(['module', $this->getUrl(0), 'config', 'articlesLenght']) : 500 ?> diff --git a/module/blog/view/option/option.php b/module/blog/view/option/option.php index 32bd191b..8a4b00b3 100755 --- a/module/blog/view/option/option.php +++ b/module/blog/view/option/option.php @@ -14,21 +14,32 @@

-

+

-
+
'Disposition', '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']) + ]); ?> +
+
+ 'Format des heures', + 'selected' => $this->getData(['module', $this->getUrl(0), 'config', 'dateFormat']) + ]); ?> +