album photo V4
This commit is contained in:
parent
70a38dc753
commit
0ac2431c45
|
@ -5,7 +5,7 @@
|
|||
*/
|
||||
setlocale(LC_NUMERIC,'English','en_US','en_US.UTF-8');
|
||||
class album extends common {
|
||||
const VERSION = '4.3.2';
|
||||
const VERSION = '4.4';
|
||||
const REALNAME = 'Album Photo';
|
||||
const DELETE = true;
|
||||
const UPDATE = '0.0';
|
||||
|
@ -31,6 +31,20 @@ class album extends common {
|
|||
'index' => self::GROUP_VISITOR
|
||||
];
|
||||
|
||||
/**
|
||||
* Mise à jour du module
|
||||
* Appelée par la fonction index
|
||||
*/
|
||||
private function update() {
|
||||
// Versions < 4.4 : versionData absent
|
||||
if( null === $this->getData(['module', $this->getUrl(0), 'config', 'versionData']) ) $this->setData(['module', $this->getUrl(0), 'config', 'versionData', '4.3']);
|
||||
|
||||
// Version 4.4
|
||||
if (version_compare($this->getData(['module', $this->getUrl(0), 'config', 'versionData']), '4.4', '<') ) {
|
||||
$this->setData(['module', $this->getUrl(0), 'config', 'versionData','4.4']);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Tri de la liste des galeries sans bouton
|
||||
*/
|
||||
|
@ -128,6 +142,8 @@ class album extends common {
|
|||
// Traitement de l'affichage
|
||||
if($galleries) {
|
||||
foreach($galleries as $galleryId => $gallery) {
|
||||
// pour ne pas prendre en compte la fausse galerie 'config'
|
||||
if(isset($gallery['config']['directory'])){
|
||||
// Erreur dossier vide
|
||||
if(is_dir($gallery['config']['directory'])) {
|
||||
if(count(scandir($gallery['config']['directory'])) === 2) {
|
||||
|
@ -158,6 +174,7 @@ class album extends common {
|
|||
self::$galleriesId[] = $galleryId;
|
||||
}
|
||||
}
|
||||
}
|
||||
// Soumission du formulaire d'ajout d'un album
|
||||
if($this->isPost()) {
|
||||
if (!$this->getInput('galleryConfigFilterResponse')) {
|
||||
|
@ -410,6 +427,8 @@ class album extends common {
|
|||
* Accueil (deux affichages en un pour éviter une url à rallonge)
|
||||
*/
|
||||
public function index() {
|
||||
// Mise à jour des données de module
|
||||
$this->update();
|
||||
// Images d'une galerie
|
||||
if($this->getUrl(1)) {
|
||||
// La galerie n'existe pas
|
||||
|
|
Loading…
Reference in New Issue