-
+
-
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
VIDEO
\ 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
VIDEO
\ 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 = $("
").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());
-});
\ No newline at end of file
diff --git a/module/slider/view/config/config.php b/module/slider/view/config/config.php
index 918680a..cdfb58b 100644
--- a/module/slider/view/config/config.php
+++ b/module/slider/view/config/config.php
@@ -1,89 +1,155 @@
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;
}
+
?>
-
+
- '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]
]); ?>
'buttonHelp',
'ico' => 'help',
- 'value' => $text[1]
+ 'value' => $text['slider_view']['config'][1]
+ ]); ?>
+
+
+ $text['slider_view']['edit'][1]
]); ?>
-
+
-
+
-
+
- $text[3]
- ]); ?>
+ $text['slider_view']['config'][4],
+ 'selected' => array_search($this->getData(['module', $this->getUrl(0), 'config', 'directory']), $module::$listDirs)
+ ]);
+ ?>
-
- true // Désactivé à cause des modifications en ajax
- ]); ?>
- $text[4],
- 'noDirty' => true // Désactivé à cause des modifications en ajax
- ]); ?>
-
-
- '',
- 'value' => template::ico('folder')
- ]); ?>
+
+
-
-
-
-
-
-
-
-
-
\ No newline at end of file
+
+
+
+
+
+
+ $text['slider_view']['edit'][5],
+ 'label' => $text['slider_view']['edit'][6],
+ 'selected' => $this->getData(['module', $this->getUrl(0), 'config', 'boutonsVisibles'])
+ ]); ?>
+
+
+ $text['slider_view']['edit'][7],
+ 'label' => $text['slider_view']['edit'][8],
+ 'selected' => $this->getData(['module', $this->getUrl(0), 'config', 'typeBouton'])
+ ]); ?>
+
+
+ $text['slider_view']['edit'][9],
+ 'label' => $text['slider_view']['edit'][10],
+ 'selected' => $this->getData(['module', $this->getUrl(0), 'config', 'pagerVisible'])
+ ]); ?>
+
+
+ $text['slider_view']['edit'][11],
+ 'label' => $text['slider_view']['edit'][12],
+ 'selected' => $this->getData(['module', $this->getUrl(0), 'config', 'maxiWidth'])
+ ]); ?>
+
+
+ $text['slider_view']['edit'][13],
+ 'label' => $text['slider_view']['edit'][14],
+ 'selected' => $this->getData(['module', $this->getUrl(0), 'config', 'fadingTime'])
+ ]); ?>
+
+
+ $text['slider_view']['edit'][15],
+ 'label' => $text['slider_view']['edit'][16],
+ 'selected' => $this->getData(['module', $this->getUrl(0), 'config', 'sliderTime'])
+ ]); ?>
+
+
+ $text['slider_view']['edit'][17],
+ 'label' => $text['slider_view']['edit'][18],
+ 'selected' => $this->getData(['module', $this->getUrl(0), 'config', 'visibiliteLegende'])
+ ]); ?>
+
+
+ $text['slider_view']['edit'][19],
+ 'label' => $text['slider_view']['edit'][20],
+ 'selected' => $this->getData(['module', $this->getUrl(0), 'config', 'positionLegende'])
+ ]); ?>
+
+
+ $text['slider_view']['edit'][21],
+ 'label' => $text['slider_view']['edit'][22],
+ 'selected' => $this->getData(['module', $this->getUrl(0), 'config', 'tempsApparition'])
+ ]); ?>
+
+
+ $text['slider_view']['edit'][23],
+ 'label' => $text['slider_view']['edit'][24],
+ 'selected' => $this->getData(['module', $this->getUrl(0), 'config', 'tri'])
+ ]); ?>
+
+
+
+
+
+
\ No newline at end of file
diff --git a/module/slider/view/index/index.php b/module/slider/view/index/index.php
index 68de923..71d9f78 100644
--- a/module/slider/view/index/index.php
+++ b/module/slider/view/index/index.php
@@ -1,18 +1,8 @@
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 '
';
- }
- $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 '
';
}
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
?>