From 4bffa24d1dc335b94cd19c04b500d0c065848cd7 Mon Sep 17 00:00:00 2001 From: Deltacms Date: Tue, 21 Jun 2022 07:53:00 +0200 Subject: [PATCH] Maj 4301 --- CHANGES.md | 10 + README.md | 2 +- core/core.js.php | 2 +- core/core.php | 2 +- core/include/update.inc.php | 4 +- core/module/config/view/setup/setup.php | 35 ++ core/module/install/ressource/defaultdata.php | 2 +- module/agenda/view/vuesimple/vuesimple.php | 25 +- module/blog/blog.php | 81 +++- module/blog/view/article/article.php | 31 +- module/blog/view/index/index.php | 30 +- module/news/news.php | 67 +-- module/news/view/article/article.php | 33 +- module/news/view/index/index.php | 27 +- module/search/ressource/defaultdata.php | 15 +- module/search/search.php | 22 +- module/slider/lang/en/lex_slider.php | 48 ++ module/slider/lang/fr/lex_slider.php | 48 ++ module/slider/slider.php | 438 ++++++------------ module/slider/view/config/config.css | 6 +- module/slider/view/config/config.help.html | 6 +- module/slider/view/config/config.help_en.html | 6 +- module/slider/view/config/config.js.php | 56 +-- module/slider/view/config/config.php | 176 ++++--- module/slider/view/index/index.php | 43 +- module/statislite/view/index/index.php | 32 +- 26 files changed, 694 insertions(+), 553 deletions(-) create mode 100644 module/slider/lang/en/lex_slider.php create mode 100644 module/slider/lang/fr/lex_slider.php diff --git a/CHANGES.md b/CHANGES.md index b6ef814..4e54941 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,5 +1,15 @@ # Changelog +## Version 4.3.01 de Deltacms +- Modifications : + - Slider : simplification de la configuration réalisée sur une seule page, + - Slider : les lexiques pour la langue d'administration sont déportés dans un dossier 'lang', + - Search : la langue d'administration est prise en compte à l'initialisation du module, + - Agenda, Blog, News, Statislite : l'affichage des dates fonctionne avec ou sans le module PHP 'intl' installé. +- Corrections + - Blog : modification de l'initialisation qui créait une erreur sous PHP 8.1, + - Search : modification de fonctions qui créaient des 'deprecated' sous PHP 8.1. + ## Version 4.2.04 de Deltacms - Modifications : - Formulaire : paramétrage des pièces jointes autorisées parmi jpg, png, pdf, zip et txt, diff --git a/README.md b/README.md index aca2cbb..681963f 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@ -# DeltaCMS 4.2.04 +# DeltaCMS 4.3.01 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 bilingue anglais ou français, le site peut être rédigé dans une des principales langues européennes. diff --git a/core/core.js.php b/core/core.js.php index 0e0c63e..f71f59b 100644 --- a/core/core.js.php +++ b/core/core.js.php @@ -226,7 +226,7 @@ core.start = function() { // Varables des cookies var samesite = "samesite=lax"; var getUrl = window.location; - var domain = "domain=" + getUrl.host; + var domain = "domain=" + getUrl.hostname; // var path = "path=" + getUrl.pathname.split('/')[1]; var e = new Date(); e.setFullYear(e.getFullYear() + 1); diff --git a/core/core.php b/core/core.php index d82bae6..ad36fcc 100644 --- a/core/core.php +++ b/core/core.php @@ -48,7 +48,7 @@ class common { // Numéro de version const DELTA_UPDATE_URL = 'https://update.deltacms.fr/master/'; - const DELTA_VERSION = '4.2.04'; + const DELTA_VERSION = '4.3.01'; const DELTA_UPDATE_CHANNEL = "v4"; public static $actions = []; diff --git a/core/include/update.inc.php b/core/include/update.inc.php index af00ae4..ad78378 100644 --- a/core/include/update.inc.php +++ b/core/include/update.inc.php @@ -60,8 +60,8 @@ if ($this->getData(['core', 'dataVersion']) < 4202) { $this->setData(['core', 'dataVersion', 4202]); } -if ($this->getData(['core', 'dataVersion']) < 4204) { +if ($this->getData(['core', 'dataVersion']) < 4301) { // Mise à jour - $this->setData(['core', 'dataVersion', 4204]); + $this->setData(['core', 'dataVersion', 4301]); } ?> diff --git a/core/module/config/view/setup/setup.php b/core/module/config/view/setup/setup.php index 1902b7d..a8ac0ca 100644 --- a/core/module/config/view/setup/setup.php +++ b/core/module/config/view/setup/setup.php @@ -41,6 +41,8 @@ switch ($val) { $text[33] = 'Les modules nécessaires sont installés.'; $text[34] = 'Modules Deltacms installés: '; $text[35] = 'Générer un pdf'; + $text[36] = 'Directive '; + $text[37] = 'Fonction '; break; case 'en' : $text[0] = 'Parameters'; @@ -79,6 +81,8 @@ switch ($val) { $text[33] = 'The necessary modules are installed.'; $text[34] = 'Deltacms modules installed: '; $text[35] = 'Generate a pdf'; + $text[36] = 'Directive '; + $text[37] = 'Function '; break; } ?> @@ -265,6 +269,37 @@ switch ($val) { ]); ?> +
+
+ $value){ + if( ini_get($value)) { + $texte .= $text[36].$value.' ON - '; + } + else{ + $texte .= $text[36].$value.' OFF - '; + } + } + // Tests des fonctions php + $functions = array( 'fopen', 'file_get_contents', 'curl_version', 'stream_get_contents', 'datefmt_create'); + foreach( $functions as $key=>$value){ + if(function_exists($value)){ + $texte .= $text[37].$value.' ON - '; + } + else{ + $texte .= $text[37].$value.' OFF - '; + } + } + echo template::textarea('directivesFunctionsPhp',[ + 'value' => substr( $texte, 0, strlen($texte) - 3) + ]); + + ?> +
+
[ - 'dataVersion' => 4204, + 'dataVersion' => 4301, 'lastBackup' => 0, 'lastClearTmp' => 0, 'lastAutoUpdate' => 0, diff --git a/module/agenda/view/vuesimple/vuesimple.php b/module/agenda/view/vuesimple/vuesimple.php index 5e0fc46..b974ee3 100644 --- a/module/agenda/view/vuesimple/vuesimple.php +++ b/module/agenda/view/vuesimple/vuesimple.php @@ -9,21 +9,28 @@
getData(['config', 'i18n', 'langBase']), - IntlDateFormatter::FULL, - IntlDateFormatter::SHORT, - null, - IntlDateFormatter::GREGORIAN -); +if( function_exists('datefmt_create') && function_exists('datefmt_create') && extension_loaded('intl') ){ + $fmt = datefmt_create( + $this->getData(['config', 'i18n', 'langBase']), + IntlDateFormatter::FULL, + IntlDateFormatter::SHORT, + null, + IntlDateFormatter::GREGORIAN + ); + $datedeb = datefmt_format($fmt, $module::$evenement['datedebut']); + $datefin = datefmt_format($fmt, $module::$evenement['datefin']); +} else { + $datedeb = date("d/m/Y - H:i",$module::$evenement['datedebut']); + $datefin = date("d/m/Y - H:i",$module::$evenement['datefin']); +} ?>

getData(['module', $this->getUrl(0), 'texts', 'configTextDateStart']).' '; - echo datefmt_format($fmt, $module::$evenement['datedebut']).'
'; + echo $datedeb.'
'; echo $this->getData(['module', $this->getUrl(0), 'texts', 'configTextDateEnd']).' '; - echo datefmt_format($fmt, $module::$evenement['datefin']);?>

+ echo $datefin;?>

diff --git a/module/blog/blog.php b/module/blog/blog.php index 72008fa..bad255a 100644 --- a/module/blog/blog.php +++ b/module/blog/blog.php @@ -18,7 +18,7 @@ class blog extends common { - const VERSION = '6.1'; + const VERSION = '6.2'; const REALNAME = 'Blog'; const DELETE = true; const UPDATE = '0.0'; @@ -129,7 +129,7 @@ class blog extends common { * Mise à jour du module * Appelée par les fonctions index et config */ - private function update() { + private function update() { // Version 5.0 if (version_compare($this->getData(['module', $this->getUrl(0), 'config', 'versionData']), '5.0', '<') ) { $this->setData(['module', $this->getUrl(0), 'config', 'itemsperPage', 6]); @@ -179,9 +179,9 @@ class blog extends common { } $this->setData(['module', $this->getUrl(0), 'config', 'versionData','6.0']); } - // Version 6.1 - if (version_compare($this->getData(['module', $this->getUrl(0), 'config', 'versionData']), '6.1', '<') ) { - $this->setData(['module', $this->getUrl(0), 'config', 'versionData','6.1']); + // Version 6.2 + if (version_compare($this->getData(['module', $this->getUrl(0), 'config', 'versionData']), '6.2', '<') ) { + $this->setData(['module', $this->getUrl(0), 'config', 'versionData','6.2']); } } @@ -266,6 +266,7 @@ class blog extends common { case 'en' : $text[0] = ''; $text[1] = ''; + $text[2] = 'Texts visible to a visitor'; break; } // Soumission du formulaire @@ -619,7 +620,7 @@ class blog extends common { break; } // Mise à jour des données de module - $this->update(); + if( null === $this->getData(['module', $this->getUrl(0), 'config', 'versionData']) )$this->update(); // Soumission du formulaire if($this->isPost()) { $this->setData(['module', $this->getUrl(0), 'config',[ @@ -894,6 +895,22 @@ class blog extends common { $text[5] = 'Bonjour'; $text[6] = 'L\'article '; $text[7] = 'a reçu un nouveau commentaire'; + $text[8] = 'Pas encore de commentaire'; + $text[9] = 'Ecrire un commentaire'; + $text[10] = 'Nom'; + $text[11] = 'Commentaire avec maximum'; + $text[12] = 'caractères'; + $text[13] = 'commentaire'; + $text[14] = 'Commentaire déposé'; + $text[15] = 'Commentaire déposé en attente d\'approbation'; + $text[16] = 'Cet article ne reçoit pas de commentaire'; + $text[17] = 'Connexion'; + $text[18] = 'Editer'; + $text[19] = 'Annuler'; + $text[20] = 'Envoyer'; + $text[21] = 'Vous avez atteint le maximum de'; + $text[22] = 'caractères restants'; + $text[23] = 'Vous alliez dépasser le maximum de '; break; case 'en' : $text[0] = '
A notification has been sent.'; @@ -902,10 +919,54 @@ class blog extends common { $text[5] = 'Hello'; $text[6] = 'The article '; $text[7] = ' has received a new comment'; + $text[8] = 'No comment yet'; + $text[9] = 'Write a comment'; + $text[10] = 'Name'; + $text[11] = 'Comment with maximum'; + $text[12] = 'characters'; + $text[13] = 'Comment'; + $text[14] = 'Comment filed'; + $text[15] = 'Comment submitted pending approval'; + $text[16] = 'This article does not receive comments'; + $text[17] = 'Login'; + $text[18] = 'Edit'; + $text[19] = 'Cancel'; + $text[20] = 'Send'; + $text[21] = 'You have reached the maximum of'; + $text[22] = 'Characters left'; + $text[23] = 'You were about to exceed the maximum of'; break; } - // Mise à jour des données de module - $this->update(); + // Installation ? + if( null === $this->getData(['module', $this->getUrl(0), 'config', 'versionData']) ){ + $this->setData(['module', $this->getUrl(0), 'config',[ + 'feeds' => false, + 'feedsLabel' => '', + 'itemsperPage' => 4, + 'versionData' => self::VERSION + ]]); + $this->setData(['module', $this->getUrl(0), 'texts',[ + 'NoComment' => $text[8], + 'Write' => $text[9], + 'Name' => $text[10], + 'Maxi' => $text[11], + 'Cara' => $text[12], + 'Comment' => $text[13], + 'CommentOK' => $text[14], + 'Waiting' => $text[15], + 'ArticleNoComment' => $text[16], + 'Connection' => $text[17], + 'Edit' => $text[18], + 'Cancel' => $text[19], + 'Send' => $text[20], + 'TinymceMaxi' => $text[21], + 'TinymceCara' => $text[22], + 'TinymceExceed' => $text[23], + ]]); + } else{ + // Mise à jour des données de module + $this->update(); + } // Affichage d'un article if( $this->getUrl(1) @@ -932,7 +993,9 @@ class blog extends common { self::$inputNotices['blogArticleCaptcha'] = 'Incorrect'; } // Crée le commentaire - $commentId = helper::increment(uniqid(), $this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'comment'])); + $key = $this->getData(['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, [ 'author' => $this->getInput('blogArticleAuthor', helper::FILTER_STRING_SHORT, empty($this->getInput('blogArticleUserId')) ? TRUE : FALSE), diff --git a/module/blog/view/article/article.php b/module/blog/view/article/article.php index 6af2068..1c8a9c1 100644 --- a/module/blog/view/article/article.php +++ b/module/blog/view/article/article.php @@ -36,14 +36,16 @@ echo ''; // Pour les dates suivant la langue de rédaction du site -$zone = 'Europe/Paris'; -$fmt = datefmt_create( - $this->getData(['config', 'i18n', 'langBase']), - IntlDateFormatter::LONG, - IntlDateFormatter::SHORT, - $zone, - IntlDateFormatter::GREGORIAN -); +if( function_exists('datefmt_create') && function_exists('datefmt_create') && extension_loaded('intl') ){ + $zone = 'Europe/Paris'; + $fmt = datefmt_create( + $this->getData(['config', 'i18n', 'langBase']), + IntlDateFormatter::LONG, + IntlDateFormatter::SHORT, + $zone, + IntlDateFormatter::GREGORIAN + ); +} ?>
@@ -62,7 +64,18 @@ $fmt = datefmt_create( - getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'publishedOn'])))); ?> + getData(['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']))); + echo $date . ' - ' . $heure; + } ?> + getData(['config', 'i18n', 'langAdmin']); switch ($val) { case 'fr' : $text[0] = 'Lire la suite'; + $text[1] = 'Aucun article'; break; case 'en' : $text[0] = 'Read more'; + $text[1] = 'No article'; break; } // Pour les dates suivant la langue de rédaction du site -$zone = 'Europe/Paris'; -$fmt = datefmt_create( - $this->getData(['config', 'i18n', 'langBase']), - IntlDateFormatter::LONG, - IntlDateFormatter::SHORT, - $zone, - IntlDateFormatter::GREGORIAN -); +if( function_exists('datefmt_create') && function_exists('datefmt_create') && extension_loaded('intl') ){ + $zone = 'Europe/Paris'; + $fmt = datefmt_create( + $this->getData(['config', 'i18n', 'langBase']), + IntlDateFormatter::LONG, + IntlDateFormatter::SHORT, + $zone, + IntlDateFormatter::GREGORIAN + ); +} + if($module::$articles): ?>
@@ -57,7 +62,12 @@ if($module::$articles): ?>
- +

... @@ -80,5 +90,5 @@ if($module::$articles): ?>

- + diff --git a/module/news/news.php b/module/news/news.php index 453d87b..8e0c7df 100644 --- a/module/news/news.php +++ b/module/news/news.php @@ -317,41 +317,46 @@ class news extends common { self::$pages = $pagination['pages']; // News en fonction de la pagination // Pour les dates suivant la langue d'administration - $lang = 'fr_FR'; - $zone = 'Europe/Paris'; - if ( $this->getData(['config', 'i18n', 'langAdmin']) === 'en'){ - $lang = 'en_GB'; - $zone = 'Europe/London'; + if( function_exists('datefmt_create') && function_exists('datefmt_create') && extension_loaded('intl') ){ + $lang = 'fr_FR'; + $zone = 'Europe/Paris'; + if ( $this->getData(['config', 'i18n', 'langAdmin']) === 'en'){ + $lang = 'en_GB'; + $zone = 'Europe/London'; + } + $fmt = datefmt_create( + $lang, + IntlDateFormatter::LONG, + IntlDateFormatter::SHORT, + $zone, + IntlDateFormatter::GREGORIAN + ); } - $fmt = datefmt_create( - $lang, - IntlDateFormatter::LONG, - IntlDateFormatter::SHORT, - $zone, - IntlDateFormatter::GREGORIAN - ); 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 .= $text[3]; - $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']))); - */ - $dateOn = datefmt_format($fmt, strtotime( date('Y/m/d H:i:s',$this->getData(['module', $this->getUrl(0),'posts', $newsIds[$i], 'publishedOn'])))); + if( function_exists('datefmt_create') && function_exists('datefmt_create') && extension_loaded('intl') ){ + $dateOn = datefmt_format($fmt, strtotime( date('Y/m/d H:i:s',$this->getData(['module', $this->getUrl(0),'posts', $newsIds[$i], 'publishedOn'])))); + } else { + $dateOn = mb_detect_encoding(date('d/m/Y', $this->getData(['module', $this->getUrl(0),'posts', $newsIds[$i], 'publishedOn'])), 'UTF-8', true) + ? date('d/m/Y', $this->getData(['module', $this->getUrl(0),'posts', $newsIds[$i], 'publishedOn'])) + : utf8_encode(date('d/m/Y', $this->getData(['module', $this->getUrl(0),'posts', $newsIds[$i], 'publishedOn']))); + $dateOn .= $text[3]; + $dateOn .= mb_detect_encoding(date('H:i', $this->getData(['module', $this->getUrl(0),'posts', $newsIds[$i], 'publishedOn'])), 'UTF-8', true) + ? date('H:i', $this->getData(['module', $this->getUrl(0),'posts', $newsIds[$i], 'publishedOn'])) + : utf8_encode(date('H:i', $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 .= $text[3]; - $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']))); - */ - $dateOff = datefmt_format($fmt, strtotime( date('Y/m/d H:i:s',$this->getData(['module', $this->getUrl(0),'posts', $newsIds[$i], 'publishedOff'])))); + if( function_exists('datefmt_create') && function_exists('datefmt_create') && extension_loaded('intl') ){ + $dateOff = datefmt_format($fmt, strtotime( date('Y/m/d H:i:s',$this->getData(['module', $this->getUrl(0),'posts', $newsIds[$i], 'publishedOff'])))); + } else { + $dateOff = mb_detect_encoding(date('d/m/Y', $this->getData(['module', $this->getUrl(0),'posts', $newsIds[$i], 'publishedOff'])), 'UTF-8', true) + ? date('d/m/Y', $this->getData(['module', $this->getUrl(0),'posts', $newsIds[$i], 'publishedOff'])) + : utf8_encode(date('d/m/Y', $this->getData(['module', $this->getUrl(0),'posts', $newsIds[$i], 'publishedOff']))); + $dateOff .= $text[3]; + $dateOff .= mb_detect_encoding(date('H:i', $this->getData(['module', $this->getUrl(0),'posts', $newsIds[$i], 'publishedOff'])), 'UTF-8', true) + ? date('H:i', $this->getData(['module', $this->getUrl(0),'posts', $newsIds[$i], 'publishedOff'])) + : utf8_encode(date('H:i', $this->getData(['module', $this->getUrl(0),'posts', $newsIds[$i], 'publishedOff']))); + } } else { $dateOff = $text[1]; } diff --git a/module/news/view/article/article.php b/module/news/view/article/article.php index 79c4715..3dcd01a 100644 --- a/module/news/view/article/article.php +++ b/module/news/view/article/article.php @@ -1,3 +1,16 @@ +getData(['config', 'i18n', 'langAdmin']); +switch ($val) { + case 'fr' : + $text[0] = ' à '; + break; + case 'en' : + $text[0] = ' at '; + break; +} +?>
getData(['module', $this->getUrl(0),'posts', $this->getUrl(1), 'content']); ?> @@ -6,8 +19,8 @@
- getData(['config', 'i18n', 'langBase']), @@ -16,9 +29,21 @@ $zone, IntlDateFormatter::GREGORIAN ); - echo $module::$articleSignature . ' - ';?> + } + echo $module::$articleSignature . ' - ';?> - getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'publishedOn'])))); ?> + getData(['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']))); + echo $date . $text[0] . $heure; + } ?> + getUser('password') === $this->getInput('DELTA_USER_PASSWORD') diff --git a/module/news/view/index/index.php b/module/news/view/index/index.php index 4000c9c..8cf0315 100644 --- a/module/news/view/index/index.php +++ b/module/news/view/index/index.php @@ -16,14 +16,16 @@ switch ($val) { } ?> getData(['config', 'i18n', 'langBase']), - IntlDateFormatter::LONG, - IntlDateFormatter::SHORT, - 'Europe/Paris', - IntlDateFormatter::GREGORIAN - ); ?> + if( function_exists('datefmt_create') && function_exists('datefmt_create') && extension_loaded('intl') ){ + // Pour les dates suivant la langue de rédaction du site + $fmt = datefmt_create( + $this->getData(['config', 'i18n', 'langBase']), + IntlDateFormatter::LONG, + IntlDateFormatter::SHORT, + 'Europe/Paris', + IntlDateFormatter::GREGORIAN + ); + } ?>
$news): ?>
@@ -39,7 +41,14 @@ switch ($val) {
- + - 100, 'resultHideContent' => false, 'placeHolder' => 'Un ou plusieurs mots-clés séparés par un espace ou par +', 'submitText' => 'Rechercher', - 'versionData' => '3.0', + 'versionData' => '3.1', 'nearWordText' => 'Mots approchants', 'successTitle' => 'Résultat de votre recherche', 'failureTitle' => 'Aucun résultat', 'commentFailureTitle' => 'Avez-vous pensé aux accents ?' ]; + public static $defaultConfig_en = [ + 'previewLength' => 100, + 'resultHideContent' => false, + 'placeHolder' => 'One or more keywords separated by a space or +', + 'submitText' => 'Search', + 'versionData' => '3.1', + 'nearWordText' => 'NearWord', + 'successTitle' => 'Result of your search', + 'failureTitle' => 'No results', + 'commentFailureTitle' => '' + ]; public static $defaultTheme = [ 'keywordColor' => 'rgba(229, 229, 1, 1)' ]; diff --git a/module/search/search.php b/module/search/search.php index 9dce6ce..8b7dfa2 100644 --- a/module/search/search.php +++ b/module/search/search.php @@ -18,7 +18,7 @@ class search extends common { - const VERSION = '3.0'; + const VERSION = '3.1'; const REALNAME = 'Recherche'; const DELETE = true; const UPDATE = '0.0'; @@ -58,7 +58,9 @@ class search extends common { if ($versionData === NULL) { $this->init(); } - + + $versionData = $this->getData(['module',$this->getUrl(0),'config', 'versionData' ]); + // Mise à jour 2.2 if (version_compare($versionData, '2.2', '<') ) { if (is_dir(self::DATADIRECTORY . 'pages/')) { @@ -79,6 +81,11 @@ class search extends common { // Mettre à jour la version $this->setData(['module',$this->getUrl(0),'config', 'versionData', '3.0' ]); } + // Mise à jour 3.1 + if (version_compare($versionData, '3.1', '<') ) { + // Mettre à jour la version + $this->setData(['module',$this->getUrl(0),'config', 'versionData', '3.1' ]); + } } /** @@ -89,15 +96,20 @@ class search extends common { $fileCSS = self::DATADIRECTORY . $this->getUrl(0) . '/theme.css' ; - if ($this->getData(['module', $this->getUrl(0)]) === null) { + if ( null === $this->getData(['module', $this->getUrl(0)]) ) { // Données du module + $this->setData(['module',$this->getUrl(0),'config', 'versionData', self::VERSION ]); require_once('module/search/ressource/defaultdata.php'); - $this->setData(['module', $this->getUrl(0), 'config',init::$defaultConfig ]); + if( $this->getData(['config', 'i18n', 'langAdmin']) === 'fr'){ + $this->setData(['module', $this->getUrl(0), 'config',init::$defaultConfig_fr ]); + } else { + $this->setData(['module', $this->getUrl(0), 'config',init::$defaultConfig_en ]); + } // Données de thème $this->setData(['module', $this->getUrl(0), 'theme',init::$defaultTheme ]); $this->setData(['module', $this->getUrl(0), 'theme', 'style', self::DATADIRECTORY . $this->getUrl(0) . '/theme.css' ]); // Recharger la page pour éviter une config vide - header("Refresh:0"); + //header("Refresh:0"); } // Dossier de l'instance diff --git a/module/slider/lang/en/lex_slider.php b/module/slider/lang/en/lex_slider.php new file mode 100644 index 0000000..46df0c1 --- /dev/null +++ b/module/slider/lang/en/lex_slider.php @@ -0,0 +1,48 @@ + \ No newline at end of file diff --git a/module/slider/lang/fr/lex_slider.php b/module/slider/lang/fr/lex_slider.php new file mode 100644 index 0000000..4ec79e5 --- /dev/null +++ b/module/slider/lang/fr/lex_slider.php @@ -0,0 +1,48 @@ + \ No newline at end of file diff --git a/module/slider/slider.php b/module/slider/slider.php index 135d65f..6af1f28 100644 --- a/module/slider/slider.php +++ b/module/slider/slider.php @@ -23,13 +23,10 @@ class slider extends common { public static $actions = [ 'config' => self::GROUP_MODERATOR, - 'delete' => self::GROUP_MODERATOR, - 'dirs' => self::GROUP_MODERATOR, - 'edit' => self::GROUP_MODERATOR, 'index' => self::GROUP_VISITOR ]; - const VERSION = '5.0'; + const VERSION = '6.0'; const REALNAME = 'Slider'; const DELETE = true; const UPDATE = '0.0'; @@ -45,6 +42,8 @@ class slider extends common { public static $pageList = []; + public static $listDirs = []; + public static $view_boutons; //Visibilité des boutons de navigation @@ -155,176 +154,42 @@ class slider extends common { 'NONE' => 'Default, unsorted' ]; + /** + * Mise à jour du module + */ + private function update() { + + // Mise à jour version 5.0 vers 6.0 + if (null === $this->getData(['module', $this->getUrl(0), 'config', 'versionData']) ) { + if(null !== $this->getData(['module', $this->getUrl(0) ]) ){ + $name = array_key_first( $this->getData(['module', $this->getUrl(0) ]) ); + // Copie des clefs et données + $old = $this->getData(['module', $this->getUrl(0), $name]); + $this->setData(['module', $this->getUrl(0), $old]); + // Efface les anciennes données et la donnée config name + $this->deleteData(['module', $this->getUrl(0), $name ]); + $this->deleteData(['module', $this->getUrl(0), 'config', 'name' ]); + // Ajoute config versionData + $this->setData(['module', $this->getUrl(0), 'config', 'versionData','6.0']); + } + } + } + + /** * Configuration */ public function config() { // Lexique - $text = []; - $val = $this->getData(['config', 'i18n', 'langAdmin']); - switch ($val) { - case 'fr' : - $text[0] = ' (dossier vide)'; - $text[1] = ' (dossier introuvable)'; - $text[2] = 'Modifications enregistrées'; - $text[3] = 'Configuration du module'; - break; - case 'en' : - $text[0] = ' (empty folder)'; - $text[1] = ' (folder not found)'; - $text[2] = 'Saved changes'; - $text[3] = 'Module configuration'; - break; - } - // Liste des galeries - $galleries = $this->getData(['module', $this->getUrl(0)]); - if($galleries) { - //ksort($galleries); - foreach($galleries as $galleryId => $gallery) { - // Erreur dossier vide - if(is_dir($gallery['config']['directory'])) { - if(count(scandir($gallery['config']['directory'])) === 2) { - $gallery['config']['directory'] = '' . $gallery['config']['directory'] . $text[0] .''; - } - } - // Erreur dossier supprimé - else { - $gallery['config']['directory'] = '' . $gallery['config']['directory'] . $text[1] .''; - } - // Met en forme le tableau meilleure solution $galleries[count($galleries)-1] - self::$galleries[] = [ - $gallery['config']['name'], - $gallery['config']['directory'], - template::button('galleryConfigEdit' . $galleryId, [ - 'href' => helper::baseUrl() . $this->getUrl(0) . '/edit/' . $galleryId . '/' . $_SESSION['csrf'], - 'value' => template::ico('pencil') - ]) - ]; - } - } - - // Soumission du formulaire - if($this->isPost()) { - // Ajout pour effacer les anciens dossiers cible - foreach($galleries as $galleryId => $gallery) { - $this->deleteData(['module', $this->getUrl(0), $galleryId]); - } - //Fin d'ajout - $galleryId = helper::increment($this->getInput('galleryConfigName', helper::FILTER_ID, true), (array) $this->getData(['module', $this->getUrl(0)])); - $this->setData(['module', $this->getUrl(0), $galleryId, [ - 'config' => [ - 'name' => $this->getInput('galleryConfigName'), - //Ajout pour paramétrage par défaut du diaporama - 'boutonsVisibles' => 'slider2', - 'pagerVisible' => 'true', - 'maxiWidth' => '800', - 'fadingTime' => '1500', - 'sliderTime' => '5000', - 'visibiliteLegende' => 'survol', - 'positionLegende' => 'bas', - 'tempsApparition' => 'opacity 2s ease-in', - 'typeBouton' => 'cer_blanc', - 'tri' => 'SORT_ASC', - //Fin d'ajout - 'directory' => $this->getInput('galleryConfigDirectory', helper::FILTER_STRING_SHORT, true) - ], - 'legend' => [] - ]]); - // Valeurs en sortie - $this->addOutput([ - 'redirect' => helper::baseUrl() . $this->getUrl(), - 'notification' => $text[2], - 'state' => true - ]); - } - // Valeurs en sortie - $this->addOutput([ - 'title' => $text[3], - 'view' => 'config' - ]); - } - - /** - * Suppression - */ - public function delete() { - // Lexique - $text = []; - $val = $this->getData(['config', 'i18n', 'langAdmin']); - switch ($val) { - case 'fr' : - $text[0] = 'Suppression non autorisée'; - $text[1] = 'Galerie supprimée'; - break; - case 'en' : - $text[0] = 'Unauthorised deletion'; - $text[1] = 'Gallery deleted'; - break; - } - // $url prend l'adresse sans le token - // La galerie n'existe pas - if($this->getData(['module', $this->getUrl(0), $this->getUrl(2)]) === null) { - // Valeurs en sortie - $this->addOutput([ - 'access' => false - ]); - } - // Jeton incorrect - if ($this->getUrl(3) !== $_SESSION['csrf']) { - // Valeurs en sortie - $this->addOutput([ - 'redirect' => helper::baseUrl() . $this->getUrl(0) . '/config', - 'notification' => $text[0] - ]); - } - // Suppression - else { - $this->deleteData(['module', $this->getUrl(0), $this->getUrl(2)]); - // Valeurs en sortie - $this->addOutput([ - 'redirect' => helper::baseUrl() . $this->getUrl(0) . '/config', - 'notification' => $text[1], - 'state' => true - ]); - } - } - - /** - * Liste des dossiers - */ - public function dirs() { - // Valeurs en sortie - $this->addOutput([ - 'display' => self::DISPLAY_JSON, - 'content' => $this->scanSubDir(self::FILE_DIR.'source') - ]); - } - - /** - * Édition - */ - public function edit() { - // Lexique - $text = []; - $val = $this->getData(['config', 'i18n', 'langAdmin']); - switch ($val) { - case 'fr' : - $text[0] = 'Action non autorisée'; - $text[1] = 'Modifications enregistrées'; - break; - case 'en' : - $text[0] = 'Unauthorised action'; - $text[1] = 'Changes saved'; - break; - } - // Jeton incorrect - if ($this->getUrl(3) !== $_SESSION['csrf']) { - // Valeurs en sortie - $this->addOutput([ - 'redirect' => helper::baseUrl() . $this->getUrl(0) . '/config', - 'notification' => $text[0] - ]); + include('./module/slider/lang/'. $this->getData(['config', 'i18n', 'langAdmin']) . '/lex_slider.php'); + // Liste des dossiers dans site/file/source triés et non vides + self::$listDirs=[]; + $dir_iterator = new RecursiveDirectoryIterator(self::FILE_DIR.'source'); + $iterator = new RecursiveIteratorIterator($dir_iterator); + foreach ($iterator as $dir) { + if( is_dir($dir) && $dir->getFilename() !== '..' ) self::$listDirs[] = $dir->getPath(); } + sort(self::$listDirs); // Liste des pages pour les liens sur image self::$pageList[0]=''; foreach ($this->getHierarchy(null,null,null) as $parentKey=>$parentValue) { @@ -338,138 +203,132 @@ class slider extends common { self::$pageList [] = $childKey; } } - // La galerie n'existe pas - if($this->getData(['module', $this->getUrl(0), $this->getUrl(2)]) === null) { + // Valeurs par défaut si le slider n'existe pas encore + if($this->getData(['module', $this->getUrl(0), 'config', 'directory']) === null){ + $this->setData(['module', $this->getUrl(0), [ + 'config' => [ + 'directory' => self::$listDirs[0], + 'boutonsVisibles' => 'slider2', + 'pagerVisible' => 'true', + 'maxiWidth' => '800', + 'fadingTime' => '1500', + 'sliderTime' => '5000', + 'visibiliteLegende' => 'survol', + 'positionLegende' => 'bas', + 'tempsApparition' => 'opacity 2s ease-in', + 'typeBouton' => 'cer_blanc', + 'tri' => 'SORT_ASC', + 'versionData' => self::VERSION + ], + 'legend' => [], + 'href' => [] + ]]); // Valeurs en sortie $this->addOutput([ - 'access' => false + 'redirect' => helper::baseUrl() . $this->getUrl(0) . '/config', + 'notification' => 'slider init', + 'state' => true ]); } - // La galerie existe - else { - // Soumission du formulaire - if($this->isPost()) { - // Si l'id a changée - $galleryId = $this->getInput('galleryEditName', helper::FILTER_ID, true); - if($galleryId !== $this->getUrl(2)) { - // Incrémente le nouvel id de la galerie - $galleryId = helper::increment($galleryId, $this->getData(['module', $this->getUrl(0)])); - // Supprime l'ancienne galerie - $this->deleteData(['module', $this->getUrl(0), $this->getUrl(2)]); - } - $legends = []; - foreach((array) $this->getInput('legend', null) as $file => $legend) { - $file = str_replace('.','',$file); - $legends[$file] = helper::filter($legend, helper::FILTER_STRING_SHORT); - } - - $hrefs = []; - foreach((array) $this->getInput('sliderHref', null) as $file => $href) { - $file = str_replace('.','',$file); - $hrefs[$file] = self::$pageList[helper::filter($href, helper::FILTER_STRING_SHORT)]; - } + + // Soumission du formulaire + if($this->isPost()) { + $legends = []; + foreach((array) $this->getInput('legend', null) as $file => $legend) { + $file = str_replace('.','',$file); + $legends[$file] = helper::filter($legend, helper::FILTER_STRING_SHORT); + } + + $hrefs = []; + foreach((array) $this->getInput('sliderHref', null) as $file => $href) { + $file = str_replace('.','',$file); + $hrefs[$file] = self::$pageList[helper::filter($href, helper::FILTER_STRING_SHORT)]; + } - $this->setData(['module', $this->getUrl(0), $galleryId, [ - 'config' => [ - 'name' => $this->getInput('galleryEditName', helper::FILTER_STRING_SHORT, true), - - //Ajout pour paramétrage du diaporama - 'boutonsVisibles' => $this->getInput('sliderBoutonsVisibles', helper::FILTER_STRING_SHORT, true), - 'pagerVisible' => $this->getInput('sliderPagerVisible', helper::FILTER_STRING_SHORT, true), - 'maxiWidth' => $this->getInput('sliderMaxiWidth', helper::FILTER_STRING_SHORT, true), - 'fadingTime' => $this->getInput('sliderFadingTime', helper::FILTER_STRING_SHORT, true), - 'sliderTime' => $this->getInput('sliderDiapoTime', helper::FILTER_STRING_SHORT, true), - 'visibiliteLegende' => $this->getInput('sliderVisibiliteLegende', helper::FILTER_STRING_SHORT, true), - 'positionLegende' => $this->getInput('sliderPositionLegende', helper::FILTER_STRING_SHORT, true), - 'tempsApparition' => $this->getInput('sliderTempsApparition', helper::FILTER_STRING_SHORT, true), - 'typeBouton' => $this->getInput('sliderTypeBouton', helper::FILTER_STRING_SHORT, true), - 'tri' => $this->getInput('sliderTri', helper::FILTER_STRING_SHORT, true), - //Fin d'ajout - - 'directory' => $this->getInput('galleryEditDirectory', helper::FILTER_STRING_SHORT, true) - ], - 'legend' => $legends, - 'href' => $hrefs - ]]); - // Valeurs en sortie - $this->addOutput([ - 'redirect' => helper::baseUrl() . $this->getUrl(0) . '/config', - 'notification' => $text[1], - 'state' => true - ]); - } - // Met en forme le tableau - $directory = $this->getData(['module', $this->getUrl(0), $this->getUrl(2), 'config', 'directory']); - if(is_dir($directory)) { - $iterator = new DirectoryIterator($directory); - foreach($iterator as $fileInfos) { - if($fileInfos->isDot() === false AND $fileInfos->isFile() AND @getimagesize($fileInfos->getPathname())) { - self::$pictures[$fileInfos->getFilename()] = [ - $fileInfos->getFilename(), - template::text('legend[' . $fileInfos->getFilename() . ']', [ - 'value' => $this->getData(['module', $this->getUrl(0), $this->getUrl(2), 'legend', str_replace('.','',$fileInfos->getFilename())]) - ]), - template::select('sliderHref[' . $fileInfos->getFilename() . ']', self::$pageList,[ - 'selected' => array_flip(self::$pageList)[$this->getData(['module', $this->getUrl(0), $this->getUrl(2), 'href', str_replace('.','',$fileInfos->getFilename())])] - ]) - ]; - } - } - // Tri des images pour affichage de la liste dans la page d'édition - switch ($this->getData(['module', $this->getUrl(0), $this->getUrl(2), 'config', 'tri'])) { - case 'SORT_DSC': - krsort(self::$pictures,SORT_NATURAL | SORT_FLAG_CASE); - break; - case 'SORT_ASC': - ksort(self::$pictures,SORT_NATURAL | SORT_FLAG_CASE); - break; - case 'RAND': - // sans intérêt ici - break; - case 'NONE': - break; - default: - break; - } - } + $this->setData(['module', $this->getUrl(0), [ + 'config' => [ + 'directory' => self::$listDirs[$this->getInput('galleryEditDirectory')], + 'boutonsVisibles' => $this->getInput('sliderBoutonsVisibles', helper::FILTER_STRING_SHORT, true), + 'pagerVisible' => $this->getInput('sliderPagerVisible', helper::FILTER_STRING_SHORT, true), + 'maxiWidth' => $this->getInput('sliderMaxiWidth', helper::FILTER_STRING_SHORT, true), + 'fadingTime' => $this->getInput('sliderFadingTime', helper::FILTER_STRING_SHORT, true), + 'sliderTime' => $this->getInput('sliderDiapoTime', helper::FILTER_STRING_SHORT, true), + 'visibiliteLegende' => $this->getInput('sliderVisibiliteLegende', helper::FILTER_STRING_SHORT, true), + 'positionLegende' => $this->getInput('sliderPositionLegende', helper::FILTER_STRING_SHORT, true), + 'tempsApparition' => $this->getInput('sliderTempsApparition', helper::FILTER_STRING_SHORT, true), + 'typeBouton' => $this->getInput('sliderTypeBouton', helper::FILTER_STRING_SHORT, true), + 'tri' => $this->getInput('sliderTri', helper::FILTER_STRING_SHORT, true), + 'versionData' => self::VERSION + ], + 'legend' => $legends, + 'href' => $hrefs + ]]); // Valeurs en sortie $this->addOutput([ - 'title' => $this->getData(['module', $this->getUrl(0), $this->getUrl(2), 'config', 'name']), - 'view' => 'edit' + 'redirect' => helper::baseUrl() . $this->getUrl(0) . '/config', + 'notification' => $text['slider']['edit'][1], + 'state' => true ]); } + // Met en forme le tableau + $directory = $this->getData(['module', $this->getUrl(0), 'config', 'directory']); + if(is_dir($directory)) { + $iterator = new DirectoryIterator($directory); + foreach($iterator as $fileInfos) { + if($fileInfos->isDot() === false AND $fileInfos->isFile() AND @getimagesize($fileInfos->getPathname())) { + self::$pictures[$fileInfos->getFilename()] = [ + $fileInfos->getFilename(), + template::text('legend[' . $fileInfos->getFilename() . ']', [ + 'value' => $this->getData(['module', $this->getUrl(0), 'legend', str_replace('.','',$fileInfos->getFilename())]) + ]), + template::select('sliderHref[' . $fileInfos->getFilename() . ']', self::$pageList,[ + 'selected' => array_flip(self::$pageList)[$this->getData(['module', $this->getUrl(0), 'href', str_replace('.','',$fileInfos->getFilename())])] + ]) + ]; + } + } + // Tri des images pour affichage de la liste dans la page de configuration + switch ($this->getData(['module', $this->getUrl(0), 'config', 'tri'])) { + case 'SORT_DSC': + krsort(self::$pictures,SORT_NATURAL | SORT_FLAG_CASE); + break; + case 'SORT_ASC': + ksort(self::$pictures,SORT_NATURAL | SORT_FLAG_CASE); + break; + case 'RAND': + // sans intérêt ici + break; + case 'NONE': + break; + default: + break; + } + } + // Valeurs en sortie + $this->addOutput([ + 'title' => $text['slider']['config'][3], + 'view' => 'config' + ]); } /** - * Fonction index() modifiée par rapport au module Gallery + * Vue publique du slider */ public function index() { - // Liste des galeries - foreach((array) $this->getData(['module', $this->getUrl(0)]) as $galleryId => $gallery) { - if(is_dir($gallery['config']['directory'])) { - $iterator = new DirectoryIterator($gallery['config']['directory']); - foreach($iterator as $fileInfos) { - if($fileInfos->isDot() === false AND $fileInfos->isFile() AND @getimagesize($fileInfos->getPathname())) { - self::$galleries[$galleryId] = $gallery; - self::$firstPictures[$galleryId] = $gallery['config']['directory'] . '/' . $fileInfos->getFilename(); - continue(2); - } - } - - } - } - if( isset($gallery['config']['directory'])){ - $directory = $gallery['config']['directory']; + $this->update(); + $gallery = $this->getData(['module', $this->getUrl(0),'config','directory']); + if( isset($gallery)){ + self::$galleries[0] = $gallery; // Images de la galerie - if(is_dir($directory)) { - $iterator = new DirectoryIterator($directory); + if(is_dir($gallery)) { + $iterator = new DirectoryIterator($gallery); foreach($iterator as $fileInfos) { if($fileInfos->isDot() === false AND $fileInfos->isFile() AND @getimagesize($fileInfos->getPathname())) { - self::$pictures[$directory . '/' . $fileInfos->getFilename()] = $this->getData(['module', $this->getUrl(0), $galleryId,'legend', str_replace('.','',$fileInfos->getFilename())]); + self::$pictures[$gallery . '/' . $fileInfos->getFilename()] = $this->getData(['module', $this->getUrl(0),'legend', str_replace('.','',$fileInfos->getFilename())]); } } // Tri des images par ordre alphabétique, alphabétique inverse, aléatoire ou pas - switch ($this->getData(['module', $this->getUrl(0), $galleryId, 'config', 'tri'])) { + switch ($this->getData(['module', $this->getUrl(0), 'config', 'tri'])) { case 'SORT_DSC': krsort(self::$pictures,SORT_NATURAL | SORT_FLAG_CASE); break; @@ -498,7 +357,7 @@ class slider extends common { break; } // Information sur la visibilité des boutons - self::$view_boutons = $this->getData(['module', $this->getUrl(0), $galleryId, 'config','boutonsVisibles']); + self::$view_boutons = $this->getData(['module', $this->getUrl(0), 'config','boutonsVisibles']); } } // Valeurs en sortie @@ -511,22 +370,5 @@ class slider extends common { 'view' => 'index' ]); } - - /** - * Scan le contenu d'un dossier et de ses sous-dossiers - * @param string $dir Dossier à scanner - * @return array - */ - private function scanSubDir($dir) { - $dirContent = []; - $iterator = new DirectoryIterator($dir); - foreach($iterator as $fileInfos) { - if($fileInfos->isDot() === false AND $fileInfos->isDir()) { - $dirContent[] = $dir . '/' . $fileInfos->getBasename(); - $dirContent = array_merge($dirContent, $this->scanSubDir($dir . '/' . $fileInfos->getBasename())); - } - } - return $dirContent; - } } \ No newline at end of file diff --git a/module/slider/view/config/config.css b/module/slider/view/config/config.css index 375cceb..d515229 100644 --- a/module/slider/view/config/config.css +++ b/module/slider/view/config/config.css @@ -4,7 +4,7 @@ * admin.css */ -.galleryConfigError { - color: #F3674A; +#galleryEditLabelView { + color: red; font-weight: bold; -} +} \ No newline at end of file diff --git a/module/slider/view/config/config.help.html b/module/slider/view/config/config.help.html index c953ebc..86e4d04 100644 --- a/module/slider/view/config/config.help.html +++ b/module/slider/view/config/config.help.html @@ -1,12 +1,10 @@ -

NOM ET SELECTION

-

Saisissez un nom de votre choix, sélectionnez un dossier où vous avez placé les images du diaporama puis validez votre sélection (bouton avec l'icône dossier).

+

SELECTION

+

Sélectionnez un dossier où vous avez placé les images du diaporama puis enregistrer.

Le diaporama va s'adapter automatiquement au format (16/9, 4/3,...) ou à l'orientation des images mais le meilleur résultat visuel sera obtenu avec des images de même format et de même orientation. Mais vous êtes libre de mixer différentes images...

Le diaporama va afficher l'image dans le même conteneur quelque soit sa taille, une image trop petite va être dilatée, une image trop grande va augmenter le temps de chargement du diaporama. Je vous conseille des images de largeur minimum 800px si votre paramétrage de la " Largeur maxi du diaporama " est à 800px.

PARAMETRAGE

-

Cliquez sur le bouton 'Paramétrage du diaporama' (icône crayon) pour modifier le paramétrage par défaut du diaporama.

-

PLUS

Vidéo de présentation de la version réalisée pour Zwiicms

\ No newline at end of file diff --git a/module/slider/view/config/config.help_en.html b/module/slider/view/config/config.help_en.html index 9f71453..dacaa65 100644 --- a/module/slider/view/config/config.help_en.html +++ b/module/slider/view/config/config.help_en.html @@ -1,12 +1,10 @@

NAME AND SELECTION

-

Enter a name of your choice, select a folder where you have placed the images of the slideshow then validate your selection (button with the folder icon).

+

Select a folder where you have placed the slideshow images and save..

The slideshow will automatically adapt to the format (16/9, 4/3,...) or orientation of the images but the best visual result will be obtained with images of the same format and orientation. But you are free to mix different images...

The slideshow will display the image in the same container whatever its size, an image too small will be dilated, an image that is too large will increase the loading time of the slideshow. I advise you to use images with a minimum width of 800px - if your setting of the "Maximum width of the slideshow" is 800px.

. + if your setting of the "Maximum width of the slideshow" is 800px.

SETTINGS

-

Click on the 'Slideshow setting' button (pencil icon) to change the default slideshow setting.

-

PLUS

Video presentation of the version made for Zwiicms

\ No newline at end of file diff --git a/module/slider/view/config/config.js.php b/module/slider/view/config/config.js.php index fb03d91..bd1312e 100644 --- a/module/slider/view/config/config.js.php +++ b/module/slider/view/config/config.js.php @@ -9,59 +9,9 @@ */ /** - * Confirmation de suppression + * Sélection d'un nouveau dossier */ -$(".galleryConfigDelete").on("click", function() { - var _this = $(this); - var text=""; - getData(['config', 'i18n', 'langAdmin' ]) === 'fr'){ - echo 'text = "Êtes-vous sûr de vouloir supprimer ce dossier ?";' ; - } - else{ - echo 'text = "Are you sure you want to delete this folder ?";' ; - } ?> - - return core.confirm(text, function() { - $(location).attr("href", _this.attr("href")); - }); +$("#galleryEditDirectory").on("change", function() { + $("#galleryEditLabelView").removeClass('displayNone'); }); -/** - * Liste des dossiers - */ -var oldResult = []; -var directoryDOM = $("#galleryConfigDirectory"); -var directoryOldDOM = $("#galleryConfigDirectoryOld"); -function dirs() { - $.ajax({ - type: "POST", - url: "getUrl(0); ?>/dirs", - success: function(result) { - if($(result).not(oldResult).length !== 0 || $(oldResult).not(result).length !== 0) { - directoryDOM.empty(); - for(var i = 0; i < result.length; i++) { - directoryDOM.append(function(i) { - var option = $("
'; } else{ - echo template::speech($text[0]); + echo template::speech($text['slider_view']['index'][0]); } } else{ - echo template::speech($text[1]); + echo template::speech($text['slider_view']['index'][1]); } ?> diff --git a/module/statislite/view/index/index.php b/module/statislite/view/index/index.php index dbc3f8d..9eb30d4 100644 --- a/module/statislite/view/index/index.php +++ b/module/statislite/view/index/index.php @@ -101,21 +101,27 @@ $geolocalisation = $this->getData(['module', $this->getUrl(0), 'config', 'geoloc ?>
-

+