Maj 4301
This commit is contained in:
parent
e7867bf707
commit
4bffa24d1d
10
CHANGES.md
10
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,
|
||||
|
|
|
@ -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.
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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 = [];
|
||||
|
|
|
@ -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]);
|
||||
}
|
||||
?>
|
||||
|
|
|
@ -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) {
|
|||
]); ?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col12">
|
||||
<?php
|
||||
$texte ='';
|
||||
// Tests des directives php
|
||||
$directives = array( 'allow_url_include', 'allow_url_fopen');
|
||||
foreach( $directives as $key=>$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)
|
||||
]);
|
||||
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col12">
|
||||
<?php // $infoModules[nom_module]['realName'], ['version'], ['update'], ['delete'], ['dataDirectory']
|
||||
|
|
|
@ -70,7 +70,7 @@ class init extends common {
|
|||
]
|
||||
],
|
||||
'core' => [
|
||||
'dataVersion' => 4204,
|
||||
'dataVersion' => 4301,
|
||||
'lastBackup' => 0,
|
||||
'lastClearTmp' => 0,
|
||||
'lastAutoUpdate' => 0,
|
||||
|
|
|
@ -9,21 +9,28 @@
|
|||
</div>
|
||||
</div>
|
||||
<?php
|
||||
$fmt = datefmt_create(
|
||||
$this->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']);
|
||||
}
|
||||
?>
|
||||
<div class="row">
|
||||
<div class="col6 offset3">
|
||||
<div class="block">
|
||||
<h4><?php echo $this->getData(['module', $this->getUrl(0), 'texts', 'configTextDateStart']).' ';
|
||||
echo datefmt_format($fmt, $module::$evenement['datedebut']).'<br>';
|
||||
echo $datedeb.'<br>';
|
||||
echo $this->getData(['module', $this->getUrl(0), 'texts', 'configTextDateEnd']).' ';
|
||||
echo datefmt_format($fmt, $module::$evenement['datefin']);?> </h4>
|
||||
echo $datefin;?> </h4>
|
||||
<p><?php echo $module::$evenement['texte'];?></p>
|
||||
|
||||
</div>
|
||||
|
|
|
@ -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] = '<br/>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),
|
||||
|
|
|
@ -36,14 +36,16 @@ echo '<script src="'. helper::baseUrl(false).'core/vendor/tinymce/init.js"></scr
|
|||
echo '<script src="'. helper::baseUrl(false).'core/vendor/tinymce/init.css"></script>';
|
||||
|
||||
// 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
|
||||
);
|
||||
}
|
||||
?>
|
||||
|
||||
<div class="row">
|
||||
|
@ -62,7 +64,18 @@ $fmt = datefmt_create(
|
|||
<!-- bloc signature et date -->
|
||||
<?php echo $module::$articleSignature . ' - ';?>
|
||||
<i class="far fa-calendar-alt"></i>
|
||||
<?php echo datefmt_format($fmt, strtotime( date('Y/m/d H:i:s',$this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'publishedOn'])))); ?>
|
||||
<?php if( function_exists('datefmt_create') && function_exists('datefmt_create') && extension_loaded('intl') ){
|
||||
echo datefmt_format($fmt, strtotime( date('Y/m/d H:i:s',$this->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;
|
||||
} ?>
|
||||
|
||||
<!-- Bloc edition -->
|
||||
<?php if (
|
||||
|
||||
|
|
|
@ -5,20 +5,25 @@ $val = $this->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): ?>
|
||||
<div class="row">
|
||||
<div class="col12">
|
||||
|
@ -57,7 +62,12 @@ if($module::$articles): ?>
|
|||
</div>
|
||||
<div class="blogDate">
|
||||
<i class="far fa-calendar-alt"></i>
|
||||
<?php echo datefmt_format($fmt, strtotime( date('Y/m/d H:i:s',$article['publishedOn']))); ?>
|
||||
<?php if( function_exists('datefmt_create') && function_exists('datefmt_create') && extension_loaded('intl') ){
|
||||
echo datefmt_format($fmt, strtotime( date('Y/m/d H:i:s',$article['publishedOn'])));
|
||||
} else {
|
||||
echo mb_detect_encoding(date('d/m/Y - H:i', $article['publishedOn']), 'UTF-8', true)?
|
||||
date('d/m/Y', $article['publishedOn']): utf8_encode(date('d/m/Y', $article['publishedOn']));
|
||||
} ?>
|
||||
</div>
|
||||
<p class="blogContent">
|
||||
<?php echo helper::subword(strip_tags($article['content']), 0, 400); ?>...
|
||||
|
@ -80,5 +90,5 @@ if($module::$articles): ?>
|
|||
</div>
|
||||
<?php endif; ?>
|
||||
<?php else: ?>
|
||||
<?php echo template::speech('Aucun article.'); ?>
|
||||
<?php echo template::speech($text[1]); ?>
|
||||
<?php endif; ?>
|
||||
|
|
|
@ -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];
|
||||
}
|
||||
|
|
|
@ -1,3 +1,16 @@
|
|||
<?php
|
||||
// Lexique
|
||||
$text = [];
|
||||
$val = $this->getData(['config', 'i18n', 'langAdmin']);
|
||||
switch ($val) {
|
||||
case 'fr' :
|
||||
$text[0] = ' à ';
|
||||
break;
|
||||
case 'en' :
|
||||
$text[0] = ' at ';
|
||||
break;
|
||||
}
|
||||
?>
|
||||
<div class="row">
|
||||
<div class="col12">
|
||||
<?php echo $this->getData(['module', $this->getUrl(0),'posts', $this->getUrl(1), 'content']); ?>
|
||||
|
@ -6,8 +19,8 @@
|
|||
<div class="row verticalAlignMiddle">
|
||||
<div class="col12 newsDate">
|
||||
<!-- bloc signature et date -->
|
||||
<?php
|
||||
// Pour les dates suivant la langue de rédaction du site
|
||||
<?php // Pour les dates suivant la langue de rédaction du site
|
||||
if( function_exists('datefmt_create') && function_exists('datefmt_create') && extension_loaded('intl') ){
|
||||
$zone = 'Europe/Paris';
|
||||
$fmt = datefmt_create(
|
||||
$this->getData(['config', 'i18n', 'langBase']),
|
||||
|
@ -16,9 +29,21 @@
|
|||
$zone,
|
||||
IntlDateFormatter::GREGORIAN
|
||||
);
|
||||
echo $module::$articleSignature . ' - ';?>
|
||||
}
|
||||
echo $module::$articleSignature . ' - ';?>
|
||||
<i class="far fa-calendar-alt"></i>
|
||||
<?php echo datefmt_format($fmt, strtotime( date('Y/m/d H:i:s',$this->getData(['module', $this->getUrl(0), 'posts', $this->getUrl(1), 'publishedOn'])))); ?>
|
||||
<?php if( function_exists('datefmt_create') && function_exists('datefmt_create') && extension_loaded('intl') ){
|
||||
echo datefmt_format($fmt, strtotime( date('Y/m/d H:i:s',$this->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;
|
||||
} ?>
|
||||
|
||||
<!-- Bloc edition -->
|
||||
<?php if (
|
||||
$this->getUser('password') === $this->getInput('DELTA_USER_PASSWORD')
|
||||
|
|
|
@ -16,14 +16,16 @@ switch ($val) {
|
|||
}
|
||||
?>
|
||||
<?php if($module::$news):
|
||||
// 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
|
||||
); ?>
|
||||
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
|
||||
);
|
||||
} ?>
|
||||
<div class="row">
|
||||
<?php foreach($module::$news as $newsId => $news): ?>
|
||||
<div class="col<?php echo $module::$nbrCol ;?>" >
|
||||
|
@ -39,7 +41,14 @@ switch ($val) {
|
|||
<?php endif; ?>
|
||||
<div class="newsSignature">
|
||||
<i class="far fa-calendar-alt"></i>
|
||||
<?php echo datefmt_format($fmt, strtotime( date('Y/m/d H:i:s',$news['publishedOn']))); ?>
|
||||
<?php if( function_exists('datefmt_create') && function_exists('datefmt_create') && extension_loaded('intl') ){
|
||||
echo datefmt_format($fmt, strtotime( date('Y/m/d H:i:s',$news['publishedOn'])));
|
||||
} else {
|
||||
echo mb_detect_encoding(date('d/m/Y', $news['publishedOn']), 'UTF-8', true)?
|
||||
date('d/m/Y', $news['publishedOn'])
|
||||
: utf8_encode(date('d/m/Y', $news['publishedOn']));
|
||||
}
|
||||
?>
|
||||
- <?php echo $news['userId']; ?>
|
||||
<!-- Bloc edition -->
|
||||
<?php if (
|
||||
|
|
|
@ -1,16 +1,27 @@
|
|||
<?php
|
||||
class init extends search {
|
||||
public static $defaultConfig = [
|
||||
public static $defaultConfig_fr = [
|
||||
'previewLength' => 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)'
|
||||
];
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -0,0 +1,48 @@
|
|||
<?php
|
||||
$text['slider']['edit'][0] = 'Unauthorised action';
|
||||
$text['slider']['edit'][1] = 'Changes saved';
|
||||
$text['slider']['config'][0] = ' (empty folder)';
|
||||
$text['slider']['config'][1] = ' (folder not found)';
|
||||
$text['slider']['config'][2] = 'Saved changes';
|
||||
$text['slider']['config'][3] = 'Module configuration';
|
||||
$text['slider_view']['index'][0] = 'No images in selected folder';
|
||||
$text['slider_view']['index'][1] = 'No folder selected for the slideshow pictures';
|
||||
$text['slider_view']['edit'][0] = 'Back';
|
||||
$text['slider_view']['edit'][1] = 'Save';
|
||||
$text['slider_view']['edit'][2] = 'Slideshow setting';
|
||||
$text['slider_view']['edit'][3] = 'Name';
|
||||
$text['slider_view']['edit'][4] = 'Target folder';
|
||||
$text['slider_view']['edit'][5] = 'Manual navigation by next or previous button or by right or left image area';
|
||||
$text['slider_view']['edit'][6] = 'Navigation with or without buttons';
|
||||
$text['slider_view']['edit'][7] = 'Choice of black rectangular or white circular button type';
|
||||
$text['slider_view']['edit'][8] = 'Button type';
|
||||
$text['slider_view']['edit'][9] = 'Visibility of navigation pager or bullets';
|
||||
$text['slider_view']['edit'][10] = 'Visibility of navigation bullets';
|
||||
$text['slider_view']['edit'][11] = 'Maximum width of slideshow in pixels. The 100% selection corresponds to the width of the site defined in configuration - 40 pixels';
|
||||
$text['slider_view']['edit'][12] = 'Maximum width of slideshow';
|
||||
$text['slider_view']['edit'][13] = 'Transition or fade time in milliseconds or seconds';
|
||||
$text['slider_view']['edit'][14] = 'Duration of transition';
|
||||
$text['slider_view']['edit'][15] = 'Total duration of the fading slide in s or ms. It is at least equal to the duration of the transition plus 100 ms';
|
||||
$text['slider_view']['edit'][16] = 'Duration of each slide';
|
||||
$text['slider_view']['edit'][17] = 'Visibility of caption only on hover, always visible or never visible';
|
||||
$text['slider_view']['edit'][18] = 'Caption visibility';
|
||||
$text['slider_view']['edit'][19] = 'Caption position at top or bottom of image';
|
||||
$text['slider_view']['edit'][20] = 'Caption position';
|
||||
$text['slider_view']['edit'][21] = 'Appearance time of caption and buttons';
|
||||
$text['slider_view']['edit'][22] = 'Caption and button appearance time';
|
||||
$text['slider_view']['edit'][23] = 'Selection of the type of image sorting, the order of reading on the server generally corresponds to a sorting according to the date of the images, from the oldest to the most recent';
|
||||
$text['slider_view']['edit'][24] = 'Image sorting';
|
||||
$text['slider_view']['edit'][25] = 'Image';
|
||||
$text['slider_view']['edit'][26] = 'Caption';
|
||||
$text['slider_view']['edit'][27] = 'Link';
|
||||
$text['slider_view']['config'][0] = 'Back';
|
||||
$text['slider_view']['config'][1] = 'Help';
|
||||
$text['slider_view']['config'][2] = 'Selection of the folder containing the images';
|
||||
$text['slider_view']['config'][3] = 'Name';
|
||||
$text['slider_view']['config'][4] = 'Target folder';
|
||||
$text['slider_view']['config'][5] = 'Slider setup';
|
||||
$text['slider_view']['config'][6] = 'No gallery';
|
||||
$text['slider_view']['config'][7] = 'Slider module version no.';
|
||||
$text['slider_view']['config'][8] = 'module/slider/view/config/config.help_en.html';
|
||||
$text['slider_view']['config'][9] = 'Modified file, save before continuing';
|
||||
?>
|
|
@ -0,0 +1,48 @@
|
|||
<?php
|
||||
$text['slider']['edit'][0] = 'Action non autorisée';
|
||||
$text['slider']['edit'][1] = 'Modifications enregistrées';
|
||||
$text['slider']['config'][0] = ' (dossier vide)';
|
||||
$text['slider']['config'][1] = ' (dossier introuvable)';
|
||||
$text['slider']['config'][2] = 'Modifications enregistrées';
|
||||
$text['slider']['config'][3] = 'Configuration du module';
|
||||
$text['slider_view']['index'][0] = 'Aucune image dans le dossier sélectionné.';
|
||||
$text['slider_view']['index'][1] = 'Aucun dossier sélectionné pour les photos du diaporama.';
|
||||
$text['slider_view']['edit'][0] = 'Retour';
|
||||
$text['slider_view']['edit'][1] = 'Enregistrer';
|
||||
$text['slider_view']['edit'][2] = 'Paramétrage du diaporama';
|
||||
$text['slider_view']['edit'][3] = 'Nom';
|
||||
$text['slider_view']['edit'][4] = 'Dossier cible';
|
||||
$text['slider_view']['edit'][5] = 'Navigation manuelle par bouton suivant ou précédent ou par zone droite ou gauche de l\'image';
|
||||
$text['slider_view']['edit'][6] = 'Navigation avec ou sans boutons';
|
||||
$text['slider_view']['edit'][7] = 'Choix du type de bouton rectangulaire noir ou circulaire blanc.';
|
||||
$text['slider_view']['edit'][8] = 'Type de bouton';
|
||||
$text['slider_view']['edit'][9] = 'Visibilité des puces de navigation ou pager';
|
||||
$text['slider_view']['edit'][10] = 'Visibilité des puces de navigation';
|
||||
$text['slider_view']['edit'][11] = 'Largeur maximale du diaporama en pixels. La sélection 100% correspond à la largeur du site définie en configuration - 40 pixels';
|
||||
$text['slider_view']['edit'][12] = 'Largeur maxi du diaporama';
|
||||
$text['slider_view']['edit'][13] = 'Durée de la transition ou fading en millisecondes ou en secondes';
|
||||
$text['slider_view']['edit'][14] = 'Durée de la transition';
|
||||
$text['slider_view']['edit'][15] = 'Durée totale de la diapositive fading compris en s ou en ms. Elle est au minimum égale à la durée de la transition plus 100 ms';
|
||||
$text['slider_view']['edit'][16] = 'Durée de chaque diapositive';
|
||||
$text['slider_view']['edit'][17] = 'Visibilité de la légende uniquement au survol, toujours visible ou jamais visible.';
|
||||
$text['slider_view']['edit'][18] = 'Visibilité de la légende';
|
||||
$text['slider_view']['edit'][19] = 'Positionnement de la légende en haut ou en bas de l\'image.';
|
||||
$text['slider_view']['edit'][20] = 'Position de la légende';
|
||||
$text['slider_view']['edit'][21] = 'Temps d\'apparition de la légende et des boutons.';
|
||||
$text['slider_view']['edit'][22] = 'Temps d\'apparition légende et boutons';
|
||||
$text['slider_view']['edit'][23] = 'Choix du type de tri des images, l\'ordre de lecture sur le serveur correspond généralement à un tri suivant la date des images, de la plus ancienne à la plus récente.';
|
||||
$text['slider_view']['edit'][24] = 'Tri des images';
|
||||
$text['slider_view']['edit'][25] = 'Image';
|
||||
$text['slider_view']['edit'][26] = 'Légende';
|
||||
$text['slider_view']['edit'][27] = 'Lien';
|
||||
$text['slider_view']['config'][0] = 'Retour';
|
||||
$text['slider_view']['config'][1] = 'Aide';
|
||||
$text['slider_view']['config'][2] = 'Sélection du dossier contenant les images';
|
||||
$text['slider_view']['config'][3] = 'Nom';
|
||||
$text['slider_view']['config'][4] = 'Dossier cible';
|
||||
$text['slider_view']['config'][5] = 'Paramétrage du Diaporama';
|
||||
$text['slider_view']['config'][6] = 'Aucune galerie.';
|
||||
$text['slider_view']['config'][7] = 'Module Slider version n°';
|
||||
$text['slider_view']['config'][8] = 'module/slider/view/config/config.help.html';
|
||||
$text['slider_view']['config'][9] = 'Dossier modifié, enregistrez avant de poursuivre';
|
||||
?>
|
|
@ -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'] = '<span class="galleryConfigError">' . $gallery['config']['directory'] . $text[0] .'</span>';
|
||||
}
|
||||
}
|
||||
// Erreur dossier supprimé
|
||||
else {
|
||||
$gallery['config']['directory'] = '<span class="galleryConfigError">' . $gallery['config']['directory'] . $text[1] .'</span>';
|
||||
}
|
||||
// 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;
|
||||
}
|
||||
|
||||
}
|
|
@ -4,7 +4,7 @@
|
|||
* admin.css
|
||||
*/
|
||||
|
||||
.galleryConfigError {
|
||||
color: #F3674A;
|
||||
#galleryEditLabelView {
|
||||
color: red;
|
||||
font-weight: bold;
|
||||
}
|
||||
}
|
|
@ -1,12 +1,10 @@
|
|||
<h3>NOM ET SELECTION</h3>
|
||||
<p>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).</p>
|
||||
<h3>SELECTION</h3>
|
||||
<p>Sélectionnez un dossier où vous avez placé les images du diaporama puis enregistrer.</p>
|
||||
<p>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...</p>
|
||||
<p>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.</p>
|
||||
<h3>PARAMETRAGE</h3>
|
||||
<p>Cliquez sur le bouton 'Paramétrage du diaporama' (icône crayon) pour modifier le paramétrage par défaut du diaporama.</p>
|
||||
<h3>PLUS</h3>
|
||||
<p>Vidéo de présentation de la version réalisée pour Zwiicms</p>
|
||||
<iframe width="333" height="185" src="https://www.youtube.com/embed/jLCe73DBbdQ" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen="allowfullscreen"></iframe>
|
|
@ -1,12 +1,10 @@
|
|||
<h3>NAME AND SELECTION</h3>
|
||||
<p>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).</p>
|
||||
<p>Select a folder where you have placed the slideshow images and save..</p>
|
||||
<p>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...</p>
|
||||
<p>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.</p>.
|
||||
if your setting of the "Maximum width of the slideshow" is 800px.</p>
|
||||
<h3>SETTINGS</h3>
|
||||
<p>Click on the 'Slideshow setting' button (pencil icon) to change the default slideshow setting.</p>
|
||||
<h3>PLUS</h3>
|
||||
<p>Video presentation of the version made for Zwiicms</p>
|
||||
<iframe width="333" height="185" src="https://www.youtube.com/embed/jLCe73DBbdQ" title="YouTube video player" frameborder="0" allow="accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture" allowfullscreen="allowfullscreen"></iframe>
|
|
@ -9,59 +9,9 @@
|
|||
*/
|
||||
|
||||
/**
|
||||
* Confirmation de suppression
|
||||
* Sélection d'un nouveau dossier
|
||||
*/
|
||||
$(".galleryConfigDelete").on("click", function() {
|
||||
var _this = $(this);
|
||||
var text="";
|
||||
<?php if( $this->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: "<?php echo helper::baseUrl() . $this->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 = $("<option>").val(result[i]).text(result[i]);
|
||||
if(directoryOldDOM.val() === result[i]) {
|
||||
option.prop("selected", true);
|
||||
}
|
||||
return option;
|
||||
}(i))
|
||||
}
|
||||
oldResult = result;
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
dirs();
|
||||
// Actualise la liste des dossiers toutes les trois secondes
|
||||
setInterval(function() {
|
||||
dirs();
|
||||
}, 3000);
|
||||
|
||||
/**
|
||||
* Stock le dossier choisi pour le re-sélectionner en cas d'actualisation ajax de la liste des dossiers
|
||||
*/
|
||||
directoryDOM.on("change", function() {
|
||||
directoryOldDOM.val($(this).val());
|
||||
});
|
|
@ -1,89 +1,155 @@
|
|||
<?php
|
||||
// Lexique
|
||||
$text = [];
|
||||
include('./module/slider/lang/'. $this->getData(['config', 'i18n', 'langAdmin']) . '/lex_slider.php');
|
||||
$val = $this->getData(['config', 'i18n', 'langAdmin']);
|
||||
switch ($val) {
|
||||
case 'fr' :
|
||||
$text[0] = 'Retour';
|
||||
$text[1] = 'Aide';
|
||||
$text[2] = 'Nommez le diaporama et sélectionnez le dossier contenant les images';
|
||||
$text[3] = 'Nom';
|
||||
$text[4] = 'Dossier cible';
|
||||
$text[5] = 'Paramétrage du Diaporama';
|
||||
$text[6] = 'Aucune galerie.';
|
||||
$text[7] = 'Module Slider version n°';
|
||||
$text[8] = 'module/slider/view/config/config.help.html';
|
||||
break;
|
||||
case 'en' :
|
||||
$text[0] = 'Back';
|
||||
$text[1] = 'Help';
|
||||
$text[2] = 'Name the slideshow and select the folder containing the images';
|
||||
$text[3] = 'Name';
|
||||
$text[4] = 'Target folder';
|
||||
$text[5] = 'Slider setup';
|
||||
$text[6] = 'No gallery';
|
||||
$text[7] = 'Slider module version no.';
|
||||
$text[8] = 'module/slider/view/config/config.help_en.html';
|
||||
$boutonsVisibles = $module::$boutonsVisibles;
|
||||
$bouton = $module::$bouton;
|
||||
$pagerVisible = $module::$pagerVisible;
|
||||
$visibilite_legende = $module::$visibilite_legende;
|
||||
$position_legende = $module::$position_legende;
|
||||
$sort = $module::$sort;
|
||||
break;
|
||||
|
||||
default :
|
||||
$boutonsVisibles = $module::$boutonsVisibles_en;
|
||||
$bouton = $module::$bouton_en;
|
||||
$pagerVisible = $module::$pagerVisible_en;
|
||||
$visibilite_legende = $module::$visibilite_legende_en;
|
||||
$position_legende = $module::$position_legende_en;
|
||||
$sort = $module::$sort_en;
|
||||
}
|
||||
|
||||
?>
|
||||
<?php echo template::formOpen('galleryConfigForm'); ?>
|
||||
<?php echo template::formOpen('galleryEditForm'); ?>
|
||||
<div class="row">
|
||||
<div class="col2">
|
||||
<?php echo template::button('galleryConfigBack', [
|
||||
<?php echo template::button('galleryEditBack', [
|
||||
'class' => 'buttonGrey',
|
||||
'href' => helper::baseUrl() . 'page/edit/' . $this->getUrl(0),
|
||||
'href' => helper::baseUrl() . $this->getUrl(0),
|
||||
'ico' => 'left',
|
||||
'value' => $text[0]
|
||||
'value' => $text['slider_view']['edit'][0]
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col2">
|
||||
<?php echo template::button('sliderIndexHelp', [
|
||||
'class' => 'buttonHelp',
|
||||
'ico' => 'help',
|
||||
'value' => $text[1]
|
||||
'value' => $text['slider_view']['config'][1]
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col2 offset6">
|
||||
<?php echo template::submit('galleryEditSubmit',[
|
||||
'value' => $text['slider_view']['edit'][1]
|
||||
]); ?>
|
||||
</div>
|
||||
</div>
|
||||
<!-- Aide à propos de la configuration de slider, view config -->
|
||||
<!-- Aide à propos de la configuration de slider, view config -->
|
||||
<div class="helpDisplayContent">
|
||||
<?php echo file_get_contents( $text[8]) ;?>
|
||||
<?php echo file_get_contents( $text['slider_view']['config'][8]) ;?>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col12">
|
||||
<div class="block">
|
||||
<h4><?php echo $text[2]; ?></h4>
|
||||
<h4><?php echo $text['slider_view']['config'][2]; ?></h4>
|
||||
<div class="row">
|
||||
<div class="col6">
|
||||
<?php echo template::text('galleryConfigName', [
|
||||
'label' => $text[3]
|
||||
]); ?>
|
||||
<?php echo template::select('galleryEditDirectory', $module::$listDirs, [
|
||||
'label' => $text['slider_view']['config'][4],
|
||||
'selected' => array_search($this->getData(['module', $this->getUrl(0), 'config', 'directory']), $module::$listDirs)
|
||||
]);
|
||||
?>
|
||||
</div>
|
||||
<div class="col5">
|
||||
<?php echo template::hidden('galleryConfigDirectoryOld', [
|
||||
'noDirty' => true // Désactivé à cause des modifications en ajax
|
||||
]); ?>
|
||||
<?php echo template::select('galleryConfigDirectory', [], [
|
||||
'label' => $text[4],
|
||||
'noDirty' => true // Désactivé à cause des modifications en ajax
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col1 verticalAlignBottom">
|
||||
<?php echo template::submit('galleryConfigSubmit', [
|
||||
'ico' => '',
|
||||
'value' => template::ico('folder')
|
||||
]); ?>
|
||||
<div id="galleryEditLabelView" class="col4 offset2 displayNone">
|
||||
<?php echo template::label('galleryEditLabel', $text['slider_view']['config'][9], []);
|
||||
?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php if($module::$galleries): ?>
|
||||
<?php echo template::table([4, 6, 1], $module::$galleries, [$text[3], $text[4], $text[5]]); ?>
|
||||
<?php else: ?>
|
||||
<?php echo template::speech($text[6]); ?>
|
||||
<?php endif; ?>
|
||||
<?php echo template::formClose(); ?>
|
||||
<div class="moduleVersion"><?php echo $text[7]; ?>
|
||||
<?php echo $module::VERSION; ?>
|
||||
</div>
|
||||
<div class="row">
|
||||
<div class="col12">
|
||||
<div class="block">
|
||||
<h4><?php echo $text['slider_view']['edit'][2]; ?></h4>
|
||||
<div class="row">
|
||||
<div class="col4">
|
||||
<?php echo template::select('sliderBoutonsVisibles', $boutonsVisibles,[
|
||||
'help' => $text['slider_view']['edit'][5],
|
||||
'label' => $text['slider_view']['edit'][6],
|
||||
'selected' => $this->getData(['module', $this->getUrl(0), 'config', 'boutonsVisibles'])
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col4">
|
||||
<?php echo template::select('sliderTypeBouton', $bouton,[
|
||||
'help' => $text['slider_view']['edit'][7],
|
||||
'label' => $text['slider_view']['edit'][8],
|
||||
'selected' => $this->getData(['module', $this->getUrl(0), 'config', 'typeBouton'])
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col4">
|
||||
<?php echo template::select('sliderPagerVisible', $pagerVisible,[
|
||||
'help' => $text['slider_view']['edit'][9],
|
||||
'label' => $text['slider_view']['edit'][10],
|
||||
'selected' => $this->getData(['module', $this->getUrl(0), 'config', 'pagerVisible'])
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col4">
|
||||
<?php echo template::select('sliderMaxiWidth', $module::$maxwidth,[
|
||||
'help' => $text['slider_view']['edit'][11],
|
||||
'label' => $text['slider_view']['edit'][12],
|
||||
'selected' => $this->getData(['module', $this->getUrl(0), 'config', 'maxiWidth'])
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col4">
|
||||
<?php echo template::select('sliderFadingTime', $module::$fadingtime,[
|
||||
'help' => $text['slider_view']['edit'][13],
|
||||
'label' => $text['slider_view']['edit'][14],
|
||||
'selected' => $this->getData(['module', $this->getUrl(0), 'config', 'fadingTime'])
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col4">
|
||||
<?php echo template::select('sliderDiapoTime', $module::$slidertime,[
|
||||
'help' => $text['slider_view']['edit'][15],
|
||||
'label' => $text['slider_view']['edit'][16],
|
||||
'selected' => $this->getData(['module', $this->getUrl(0), 'config', 'sliderTime'])
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col4">
|
||||
<?php echo template::select('sliderVisibiliteLegende', $visibilite_legende,[
|
||||
'help' => $text['slider_view']['edit'][17],
|
||||
'label' => $text['slider_view']['edit'][18],
|
||||
'selected' => $this->getData(['module', $this->getUrl(0), 'config', 'visibiliteLegende'])
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col4">
|
||||
<?php echo template::select('sliderPositionLegende', $position_legende,[
|
||||
'help' => $text['slider_view']['edit'][19],
|
||||
'label' => $text['slider_view']['edit'][20],
|
||||
'selected' => $this->getData(['module', $this->getUrl(0), 'config', 'positionLegende'])
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col4">
|
||||
<?php echo template::select('sliderTempsApparition', $module::$apparition,[
|
||||
'help' => $text['slider_view']['edit'][21],
|
||||
'label' => $text['slider_view']['edit'][22],
|
||||
'selected' => $this->getData(['module', $this->getUrl(0), 'config', 'tempsApparition'])
|
||||
]); ?>
|
||||
</div>
|
||||
<div class="col4">
|
||||
<?php echo template::select('sliderTri', $sort,[
|
||||
'help' => $text['slider_view']['edit'][23],
|
||||
'label' => $text['slider_view']['edit'][24],
|
||||
'selected' => $this->getData(['module', $this->getUrl(0), 'config', 'tri'])
|
||||
]); ?>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<?php if($module::$pictures):
|
||||
echo template::table([3, 5, 4], $module::$pictures, [$text['slider_view']['edit'][25], $text['slider_view']['edit'][26], $text['slider_view']['edit'][27]]);
|
||||
endif;
|
||||
echo template::formClose();
|
||||
?>
|
|
@ -1,18 +1,8 @@
|
|||
<link rel="stylesheet" href="./module/slider/view/index/index.css">
|
||||
<?php
|
||||
// Lexique
|
||||
$text = [];
|
||||
$val = $this->getData(['config', 'i18n', 'langAdmin']);
|
||||
switch ($val) {
|
||||
case 'fr' :
|
||||
$text[0] = 'Aucune image dans le dossier sélectionné.';
|
||||
$text[1] = 'Aucun dossier sélectionné pour les photos du diaporama.';
|
||||
break;
|
||||
case 'en' :
|
||||
$text[0] = 'No images in selected folder';
|
||||
$text[1] = 'No folder selected for the slideshow pictures';
|
||||
break;
|
||||
}
|
||||
include('./module/slider/lang/'. $this->getData(['config', 'i18n', 'langAdmin']) . '/lex_slider.php');
|
||||
|
||||
/*
|
||||
Création automatique du slider avec les images du dossier sélectionné en configuration du module
|
||||
puis affichage du slider.
|
||||
|
@ -33,14 +23,9 @@ if($module::$galleries){
|
|||
}
|
||||
else{
|
||||
echo '<ul class="rslides" id="slider2">';
|
||||
}
|
||||
$name='';
|
||||
foreach( $this->getData(['module', $this->getUrl(0)]) as $key=>$value){
|
||||
$name = $key;
|
||||
break;
|
||||
}
|
||||
}
|
||||
foreach($module::$pictures as $picture => $legend):
|
||||
$href = $this->getData(['module', $this->getUrl(0), $name, 'href', str_replace('.','',substr(strrchr( $picture, '/'), 1)) ]);
|
||||
$href = $this->getData(['module', $this->getUrl(0), 'href', str_replace('.','',substr(strrchr( $picture, '/'), 1)) ]);
|
||||
$link = '';
|
||||
$endLink = '';
|
||||
if ($href != '' && $href != null){
|
||||
|
@ -57,31 +42,31 @@ if($module::$galleries){
|
|||
echo '</ul></div><p> </p></div>';
|
||||
}
|
||||
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]);
|
||||
}
|
||||
?>
|
||||
<!--Pour liaison entre variables php et javascript-->
|
||||
<script>
|
||||
// Integer: largeur MAXI du diaporama, en pixels. Par exemple : 800, 920, 500
|
||||
var maxwidth=<?php echo $this->getData(['module', $this->getUrl(0), $galleryId, 'config','maxiWidth']); ?>;
|
||||
var maxwidth=<?php echo $this->getData(['module', $this->getUrl(0), 'config','maxiWidth']); ?>;
|
||||
// Integer: Vitesse de transition entre 2 diapositives (fading) : de 500 à 3500
|
||||
var speed=<?php echo $this->getData(['module', $this->getUrl(0), $galleryId, 'config','fadingTime']); ?>;
|
||||
var speed=<?php echo $this->getData(['module', $this->getUrl(0), 'config','fadingTime']); ?>;
|
||||
// Integer: Durée d'une diapositive en millisecondes (fading compris) : minimum speed +100
|
||||
var timeout=<?php echo $this->getData(['module', $this->getUrl(0), $galleryId, 'config','sliderTime']); ?>;
|
||||
var timeout=<?php echo $this->getData(['module', $this->getUrl(0), 'config','sliderTime']); ?>;
|
||||
// Boolean: visibilité des puces de navigation, true ou false
|
||||
var pager=<?php echo $this->getData(['module', $this->getUrl(0), $galleryId, 'config','pagerVisible']); ?>;
|
||||
var pager=<?php echo $this->getData(['module', $this->getUrl(0), 'config','pagerVisible']); ?>;
|
||||
//Visibilité de la légende
|
||||
var legendeVisibilite="<?php echo $this->getData(['module', $this->getUrl(0), $galleryId, 'config','visibiliteLegende']); ?>";
|
||||
var legendeVisibilite="<?php echo $this->getData(['module', $this->getUrl(0), 'config','visibiliteLegende']); ?>";
|
||||
//Position de la légende, "haut" ou "bas"
|
||||
var legendePosition="<?php echo $this->getData(['module', $this->getUrl(0), $galleryId, 'config','positionLegende']); ?>";
|
||||
var legendePosition="<?php echo $this->getData(['module', $this->getUrl(0), 'config','positionLegende']); ?>";
|
||||
//Temps d'apparition de la légende et des boutons
|
||||
var timeLegende="<?php echo $this->getData(['module', $this->getUrl(0), $galleryId, 'config','tempsApparition']); ?>";
|
||||
var timeLegende="<?php echo $this->getData(['module', $this->getUrl(0), 'config','tempsApparition']); ?>";
|
||||
//Type de bouton
|
||||
var boutonType="<?php echo $this->getData(['module', $this->getUrl(0), $galleryId, 'config','typeBouton']); ?>";
|
||||
var boutonType="<?php echo $this->getData(['module', $this->getUrl(0), 'config','typeBouton']); ?>";
|
||||
</script>
|
||||
|
||||
|
||||
|
|
|
@ -101,21 +101,27 @@ $geolocalisation = $this->getData(['module', $this->getUrl(0), 'config', 'geoloc
|
|||
?>
|
||||
<div class="block">
|
||||
<?php
|
||||
$lang = 'fr_FR';
|
||||
$zone = 'Europe/Paris';
|
||||
if ($val === '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 ($val === 'en'){
|
||||
$lang = 'en_GB';
|
||||
$zone = 'Europe/London';
|
||||
}
|
||||
$fmt = datefmt_create(
|
||||
$lang,
|
||||
IntlDateFormatter::LONG,
|
||||
IntlDateFormatter::SHORT,
|
||||
$zone,
|
||||
IntlDateFormatter::GREGORIAN
|
||||
);
|
||||
$datedeb = datefmt_format($fmt, strtotime($module::$datedebut));
|
||||
|
||||
} else{
|
||||
$datedeb = $module::$datedebut;
|
||||
}
|
||||
$fmt = datefmt_create(
|
||||
$lang,
|
||||
IntlDateFormatter::LONG,
|
||||
IntlDateFormatter::SHORT,
|
||||
$zone,
|
||||
IntlDateFormatter::GREGORIAN
|
||||
);
|
||||
?>
|
||||
<h4><?php echo $text[0]; echo datefmt_format($fmt, strtotime($module::$datedebut)); ?></h4>
|
||||
<h4><?php echo $text[0]; echo $datedeb;?></h4>
|
||||
<div class="row">
|
||||
<div class="col4"><h3>
|
||||
<?php echo $text[1].$module::$comptepagestotal;?></h3>
|
||||
|
|
Loading…
Reference in New Issue