Gallery , mettre à jour la couverture import v9

This commit is contained in:
Fred Tempez 2020-04-05 18:59:17 +02:00
parent 77d4fcbdd8
commit 4111ae6270

View File

@ -1140,7 +1140,13 @@ class common {
} }
// Image de couverture // Image de couverture
if ( $this->getdata(['module',$parent,$galleryKey,'config','homePicture']) === NULL) { if ( $this->getdata(['module',$parent,$galleryKey,'config','homePicture']) === NULL) {
$this->setdata(['module',$parent,$galleryKey,'config','homePicture','']); $iterator = new DirectoryIterator($this->getdata(['module',$parent,$galleryKey,'config','directory']));
foreach($iterator as $fileInfos) {
if($fileInfos->isDot() === false AND $fileInfos->isFile() AND @getimagesize($fileInfos->getPathname())) {
$this->setdata(['module',$parent,$galleryKey,'config','homePicture',$fileInfos->getFilename()]);
break;
}
}
} }
} }
} }