diff --git a/core/class/helper.class.php b/core/class/helper.class.php index 9f9b16e..431d4f0 100644 --- a/core/class/helper.class.php +++ b/core/class/helper.class.php @@ -43,10 +43,10 @@ class helper * Date au format time() * $format strftime */ - public static function dateUTF8($format, $date) + public static function dateUTF8($format, $date, $locale = 'fr_FR') { require_once 'core/class/strftime/php-8.1-strftime.class.php'; - return mb_convert_encoding(\PHP81_BC\strftime($format, $date), 'UTF-8', mb_list_encodings()); + return mb_convert_encoding(\PHP81_BC\strftime($format, $date, $locale), 'UTF-8', mb_list_encodings()); } /** diff --git a/core/module/config/config.php b/core/module/config/config.php index bb9879e..3c189e2 100644 --- a/core/module/config/config.php +++ b/core/module/config/config.php @@ -824,7 +824,7 @@ class config extends common $d = $this->getData(['blacklist']); $data = ''; foreach ($d as $key => $item) { - $data .= helper::dateUTF8('%Y %m %d', $item['lastFail']) . ' - ' . helper::dateUTF8('%H:%M', time()); + $data .= helper::dateUTF8('%Y %m %d', $item['lastFail'], self::$i18nUI) . ' - ' . helper::dateUTF8('%H:%M', time(), self::$i18nUI); $data .= $key . ';' . $item['ip'] . ';' . $item['connectFail'] . PHP_EOL; } file_put_contents($fileName, $data, FILE_APPEND); diff --git a/core/module/course/course.php b/core/module/course/course.php index d7f5472..bc6eb36 100644 --- a/core/module/course/course.php +++ b/core/module/course/course.php @@ -333,7 +333,7 @@ class course extends common $redirect .= $this->getData(['course', $courseId, 'homePageId']); } if ($this->getData(['course', $courseId, 'access']) === self::COURSE_ACCESS_DATE) { - $to = helper::dateUTF8('%d %B %Y', $this->getData(['course', $courseId, 'closingDate'])) . helper::translate(' à ') . helper::dateUTF8('%H:%M', $this->getData(['course', $courseId, 'closingDate'])); + $to = helper::dateUTF8('%d %B %Y', $this->getData(['course', $courseId, 'closingDate']), self::$i18nUI) . helper::translate(' à ') . helper::dateUTF8('%H:%M', $this->getData(['course', $courseId, 'closingDate']), self::$i18nUI); $message = sprintf(helper::translate('Ce cours ferme le %s'), $to); } else { $message = sprintf(helper::translate('Bienvenue dans le cours %s'), $this->getData(['course', $courseId, 'shortTitle'])); @@ -346,8 +346,8 @@ class course extends common $message = helper::translate('Ce cours est fermé'); $state = false; if ($this->getData(['course', $courseId, 'access']) === self::COURSE_ACCESS_DATE) { - $from = helper::dateUTF8('%d %B %Y', $this->getData(['course', $courseId, 'openingDate'])) . helper::translate(' à ') . helper::dateUTF8('%H:%M', $this->getData(['course', $courseId, 'openingDate'])); - $to = helper::dateUTF8('%d %B %Y', $this->getData(['course', $courseId, 'closingDate'])) . helper::translate(' à ') . helper::dateUTF8('%H:%M', $this->getData(['course', $courseId, 'closingDate'])); + $from = helper::dateUTF8('%d %B %Y', $this->getData(['course', $courseId, 'openingDate']), self::$i18nUI) . helper::translate(' à ') . helper::dateUTF8('%H:%M', $this->getData(['course', $courseId, 'openingDate']), self::$i18nUI); + $to = helper::dateUTF8('%d %B %Y', $this->getData(['course', $courseId, 'closingDate']), self::$i18nUI) . helper::translate(' à ') . helper::dateUTF8('%H:%M', $this->getData(['course', $courseId, 'closingDate']), self::$i18nUI); $message = sprintf(helper::translate('Ce cours ouvre le
%s
et ferme le %s'), $from, $to); } } diff --git a/core/module/language/language.php b/core/module/language/language.php index 8041611..9610e3a 100644 --- a/core/module/language/language.php +++ b/core/module/language/language.php @@ -206,7 +206,7 @@ class language extends common self::$languagesUiInstalled[$file] = [ template::flag($file, '20 %') . ' ' . self::$languages[$file], $value['version'], - helper::dateUTF8('%d/%m/%Y', $value['date']), + helper::dateUTF8('%d/%m/%Y', $value['date'], self::$i18nUI), //self::$i18nUI === $file ? helper::translate('Interface') : '', '', /* @@ -241,7 +241,7 @@ class language extends common self::$languagesStore[$file] = [ template::flag($file, '20 %') . ' ' . self::$languages[$file], $value['version'], - helper::dateUTF8('%d/%m/%Y', $value['date']), + helper::dateUTF8('%d/%m/%Y', $value['date'], self::$i18nUI), '', template::button('translateContentLanguageUIDownload' . $file, [ 'class' => 'buttonGreen', diff --git a/core/module/plugin/plugin.php b/core/module/plugin/plugin.php index 712b642..03bb5cb 100644 --- a/core/module/plugin/plugin.php +++ b/core/module/plugin/plugin.php @@ -377,7 +377,7 @@ class plugin extends common $store[$key]['category'], '' . $store[$key]['title'] . '', $store[$key]['version'], - helper::dateUTF8('%d %B %Y', $store[$key]['versionDate']), + helper::dateUTF8('%d %B %Y', $store[$key]['versionDate'], self::$i18nUI), implode(' - ', $pageInfos), template::button('moduleExport' . $key, [ 'class' => $class, @@ -403,7 +403,7 @@ class plugin extends common { $store = json_decode(helper::getUrlContents(self::BASEURL_STORE . self::MODULE_STORE . 'list'), true); self::$storeItem = $store[$this->getUrl(2)]; - self::$storeItem['fileDate'] = helper::dateUTF8('%d %B %Y', self::$storeItem['fileDate']); + self::$storeItem['fileDate'] = helper::dateUTF8('%d %B %Y', self::$storeItem['fileDate'], self::$i18nUI); // Valeurs en sortie $this->addOutput([ 'title' => helper::translate('Module ' . self::$storeItem['title']), diff --git a/module/blog/blog.php b/module/blog/blog.php index 1bf734a..0e161d4 100644 --- a/module/blog/blog.php +++ b/module/blog/blog.php @@ -359,7 +359,7 @@ class blog extends common self::$dateFormat = $this->getData(['module', $this->getUrl(0), 'config', 'dateFormat']); self::$timeFormat = $this->getData(['module', $this->getUrl(0), 'config', 'timeFormat']); self::$comments[] = [ - helper::dateUTF8(self::$dateFormat, $comment['createdOn']) . ' - ' . helper::dateUTF8(self::$timeFormat, $comment['createdOn']), + helper::dateUTF8(self::$dateFormat, $comment['createdOn'], self::$i18nUI) . ' - ' . helper::dateUTF8(self::$timeFormat, $comment['createdOn'], self::$i18nUI), $comment['content'], $comment['userId'] ? $this->getData(['user', $comment['userId'], 'firstname']) . ' ' . $this->getData(['user', $comment['userId'], 'lastname']) : $comment['author'], $buttonApproval, @@ -528,7 +528,7 @@ class blog extends common '' . $this->getData(['module', $this->getUrl(0), 'posts', $articleIds[$i], 'title']) . '', - helper::dateUTF8(self::$dateFormat, $this->getData(['module', $this->getUrl(0), 'posts', $articleIds[$i], 'publishedOn'])) . ' - ' . helper::dateUTF8(self::$timeFormat, $this->getData(['module', $this->getUrl(0), 'posts', $articleIds[$i], 'publishedOn'])), + helper::dateUTF8(self::$dateFormat, $this->getData(['module', $this->getUrl(0), 'posts', $articleIds[$i], 'publishedOn']), self::$i18nUI) . ' - ' . helper::dateUTF8(self::$timeFormat, $this->getData(['module', $this->getUrl(0), 'posts', $articleIds[$i], 'publishedOn']), self::$i18nUI), self::$states[$this->getData(['module', $this->getUrl(0), 'posts', $articleIds[$i], 'state'])], // Bouton pour afficher les commentaires de l'article template::button('blogConfigComment' . $articleIds[$i], [ diff --git a/module/blog/view/article/article.php b/module/blog/view/article/article.php index 48dd1df..af1cadd 100644 --- a/module/blog/view/article/article.php +++ b/module/blog/view/article/article.php @@ -15,7 +15,7 @@ - getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'publishedOn'])) . ' - ' . helper::dateUTF8($module::$timeFormat, $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'publishedOn'])); ?> + 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); ?> - + diff --git a/module/blog/view/index/index.php b/module/blog/view/index/index.php index 0f608e1..aa59a79 100644 --- a/module/blog/view/index/index.php +++ b/module/blog/view/index/index.php @@ -28,7 +28,7 @@ signature($this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'userId'])); ?> - 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), 'posts', $articleId, 'publishedOn']), self::$i18nUI) . ' - ' . helper::dateUTF8($module::$timeFormat, $this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'publishedOn']), self::$i18nUI); ?>
@@ -143,7 +143,7 @@ signature($this->getData(['module', $this->getUrl(0), 'posts', $articleId, 'userId'])); ?> - 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), '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 ? $this->getData(['module', $this->getUrl(0), 'config', 'articlesLenght']) : 500 ?> diff --git a/module/news/news.php b/module/news/news.php index ed2b503..aec7186 100644 --- a/module/news/news.php +++ b/module/news/news.php @@ -230,9 +230,9 @@ class news extends common // News en fonction de la pagination for ($i = $pagination['first']; $i < $pagination['last']; $i++) { // Met en forme le tableau - $dateOn = helper::dateUTF8(self::$dateFormat, $this->getData(['module', $this->getUrl(0), 'posts', $newsIds[$i], 'publishedOn'])) . ' - ' . helper::dateUTF8(self::$timeFormat, $this->getData(['module', $this->getUrl(0), 'posts', $newsIds[$i], 'publishedOn'])); + $dateOn = helper::dateUTF8(self::$dateFormat, $this->getData(['module', $this->getUrl(0), 'posts', $newsIds[$i], 'publishedOn']), self::$i18nUI) . ' - ' . helper::dateUTF8(self::$timeFormat, $this->getData(['module', $this->getUrl(0), 'posts', $newsIds[$i], 'publishedOn']), self::$i18nUI); if ($this->getData(['module', $this->getUrl(0), 'posts', $newsIds[$i], 'publishedOff'])) { - $dateOff = helper::dateUTF8(self::$dateFormat, $this->getData(['module', $this->getUrl(0), 'posts', $newsIds[$i], 'publishedOff'])) . ' - ' . helper::dateUTF8(self::$timeFormat, $this->getData(['module', $this->getUrl(0), 'posts', $newsIds[$i], 'publishedOff'])); + $dateOff = helper::dateUTF8(self::$dateFormat, $this->getData(['module', $this->getUrl(0), 'posts', $newsIds[$i], 'publishedOff']), self::$i18nUI) . ' - ' . helper::dateUTF8(self::$timeFormat, $this->getData(['module', $this->getUrl(0), 'posts', $newsIds[$i], 'publishedOff']), self::$i18nUI); } else { $dateOff = helper::translate('Permanent'); } @@ -332,9 +332,9 @@ class news extends common // News en fonction de la pagination for ($i = $pagination['first']; $i < $pagination['last']; $i++) { // Met en forme le tableau - $dateOn = $dateOn = helper::dateUTF8(self::$dateFormat, $this->getData(['module', $this->getUrl(0), 'posts', $newsIds[$i], 'publishedOn'])) . ' - ' . helper::dateUTF8(self::$timeFormat, $this->getData(['module', $this->getUrl(0), 'posts', $newsIds[$i], 'publishedOn'])); + $dateOn = $dateOn = helper::dateUTF8(self::$dateFormat, $this->getData(['module', $this->getUrl(0), 'posts', $newsIds[$i], 'publishedOn']), self::$i18nUI) . ' - ' . helper::dateUTF8(self::$timeFormat, $this->getData(['module', $this->getUrl(0), 'posts', $newsIds[$i], 'publishedOn']), self::$i18nUI); if ($this->getData(['module', $this->getUrl(0), 'posts', $newsIds[$i], 'publishedOff'])) { - $dateOff = helper::dateUTF8(self::$dateFormat, $this->getData(['module', $this->getUrl(0), 'posts', $newsIds[$i], 'publishedOff'])) . ' - ' . helper::dateUTF8(self::$timeFormat, $this->getData(['module', $this->getUrl(0), 'posts', $newsIds[$i], 'publishedOff'])); + $dateOff = helper::dateUTF8(self::$dateFormat, $this->getData(['module', $this->getUrl(0), 'posts', $newsIds[$i], 'publishedOff']), self::$i18nUI) . ' - ' . helper::dateUTF8(self::$timeFormat, $this->getData(['module', $this->getUrl(0), 'posts', $newsIds[$i], 'publishedOff']), self::$i18nUI); } else { $dateOff = helper::translate('Permanent'); } diff --git a/module/news/view/article/article.php b/module/news/view/article/article.php index 67c4ee2..b01dc1a 100644 --- a/module/news/view/article/article.php +++ b/module/news/view/article/article.php @@ -9,7 +9,7 @@ - getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'publishedOn'])) . ' - ' . helper::dateUTF8('%H:%M', $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'publishedOn'])); ?> + getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'publishedOn']), self::$i18nUI) . ' - ' . helper::dateUTF8('%H:%M', $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'publishedOn']), self::$i18nUI); ?> getUser('password') === $this->getInput('ZWII_USER_PASSWORD') diff --git a/module/news/view/index/index.php b/module/news/view/index/index.php index ee5cf9e..45a58d9 100644 --- a/module/news/view/index/index.php +++ b/module/news/view/index/index.php @@ -23,7 +23,7 @@ - +