|
|
|
@ -122,6 +122,12 @@ class gallery extends common {
|
|
|
|
|
$iterator = new DirectoryIterator($directory);
|
|
|
|
|
foreach($iterator as $fileInfos) {
|
|
|
|
|
if($fileInfos->isDot() === false AND $fileInfos->isFile() AND @getimagesize($fileInfos->getPathname())) {
|
|
|
|
|
// Créer la miniature si manquante
|
|
|
|
|
if (!file_exists( str_replace('source','thumb',$fileInfos->getPathname()) . '/' . self::THUMBS_SEPARATOR . strtolower($fileInfos->getFilename()))) {
|
|
|
|
|
$this->makeThumb($fileInfos->getPathname(),
|
|
|
|
|
str_replace('source','thumb',$fileInfos->getPath()) . '/' . self::THUMBS_SEPARATOR . strtolower($fileInfos->getFilename()),
|
|
|
|
|
self::THUMBS_WIDTH);
|
|
|
|
|
}
|
|
|
|
|
// Miniatures
|
|
|
|
|
$homePicture = file_exists( str_replace('source','thumb',$directory) . '/' . self::THUMBS_SEPARATOR . strtolower($fileInfos->getFilename()))
|
|
|
|
|
? self::THUMBS_SEPARATOR . strtolower($fileInfos->getFilename())
|
|
|
|
@ -264,6 +270,12 @@ class gallery extends common {
|
|
|
|
|
$iterator = new DirectoryIterator($directory);
|
|
|
|
|
foreach($iterator as $fileInfos) {
|
|
|
|
|
if($fileInfos->isDot() === false AND $fileInfos->isFile() AND @getimagesize($fileInfos->getPathname())) {
|
|
|
|
|
// Créer la miniature si manquante
|
|
|
|
|
if (!file_exists( str_replace('source','thumb',$fileInfos->getPathname()) . '/' . self::THUMBS_SEPARATOR . strtolower($fileInfos->getFilename()))) {
|
|
|
|
|
$this->makeThumb($fileInfos->getPathname(),
|
|
|
|
|
str_replace('source','thumb',$fileInfos->getPath()) . '/' . self::THUMBS_SEPARATOR . strtolower($fileInfos->getFilename()),
|
|
|
|
|
self::THUMBS_WIDTH);
|
|
|
|
|
}
|
|
|
|
|
self::$pictures[$fileInfos->getFilename()] = [
|
|
|
|
|
$fileInfos->getFilename(),
|
|
|
|
|
template::checkbox( 'homePicture[' . $fileInfos->getFilename() . ']', true, '', [
|
|
|
|
@ -321,7 +333,13 @@ class gallery extends common {
|
|
|
|
|
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), $this->getUrl(1), 'legend', str_replace('.','',$fileInfos->getFilename())]);
|
|
|
|
|
// Miniatures
|
|
|
|
|
// Créer la miniature si manquante
|
|
|
|
|
if (!file_exists( str_replace('source','thumb',$fileInfos->getPathname()) . '/' . self::THUMBS_SEPARATOR . strtolower($fileInfos->getFilename()))) {
|
|
|
|
|
$this->makeThumb($fileInfos->getPathname(),
|
|
|
|
|
str_replace('source','thumb',$fileInfos->getPath()) . '/' . self::THUMBS_SEPARATOR . strtolower($fileInfos->getFilename()),
|
|
|
|
|
self::THUMBS_WIDTH);
|
|
|
|
|
}
|
|
|
|
|
// Définir la Miniature
|
|
|
|
|
self::$thumbs[$directory . '/' . $fileInfos->getFilename()] = file_exists( str_replace('source','thumb',$directory) . '/' . self::THUMBS_SEPARATOR . strtolower($fileInfos->getFilename()))
|
|
|
|
|
? str_replace('source','thumb',$directory) . '/' . self::THUMBS_SEPARATOR . strtolower($fileInfos->getFilename())
|
|
|
|
|
: str_replace('source','thumb',$directory) . '/' . strtolower($fileInfos->getFilename());
|
|
|
|
@ -380,6 +398,13 @@ class gallery extends common {
|
|
|
|
|
foreach($iterator as $fileInfos) {
|
|
|
|
|
if($fileInfos->isDot() === false AND $fileInfos->isFile() AND @getimagesize($fileInfos->getPathname())) {
|
|
|
|
|
self::$galleries[$galleryId] = $gallery;
|
|
|
|
|
// Créer la miniature si manquante
|
|
|
|
|
if (!file_exists( str_replace('source','thumb',$fileInfos->getPathname()) . '/' . self::THUMBS_SEPARATOR . strtolower($fileInfos->getFilename()))) {
|
|
|
|
|
$this->makeThumb($fileInfos->getPathname(),
|
|
|
|
|
str_replace('source','thumb',$fileInfos->getPath()) . '/' . self::THUMBS_SEPARATOR . strtolower($fileInfos->getFilename()),
|
|
|
|
|
self::THUMBS_WIDTH);
|
|
|
|
|
}
|
|
|
|
|
// Définir l'image de couverture
|
|
|
|
|
self::$firstPictures[$galleryId] = file_exists( str_replace('source','thumb',$gallery['config']['directory']) . '/' . self::THUMBS_SEPARATOR . strtolower($gallery['config']['homePicture']))
|
|
|
|
|
? str_replace('source','thumb',$gallery['config']['directory']) . '/' . self::THUMBS_SEPARATOR . strtolower($gallery['config']['homePicture'])
|
|
|
|
|
: str_replace('source','thumb',$gallery['config']['directory']) . '/' . strtolower($gallery['config']['homePicture']);
|
|
|
|
|