Mise à jour de 'module/gallery/gallery.php'

Exclusion des dossiers ne contenant pas d'images
This commit is contained in:
LC 2022-11-11 18:12:13 +01:00
parent 1a73b96039
commit 8b9bb4dfc6
1 changed files with 2 additions and 0 deletions

View File

@ -737,10 +737,12 @@ class galleriesHelper extends helper {
* @return array
*/
public static function scanDir($dir) {
$exclu = array ("agenda","theme", "modules", "fonts", "icones", "backup");
$dirContent = [];
$iterator = new DirectoryIterator($dir);
foreach($iterator as $fileInfos) {
if($fileInfos->isDot() === false AND $fileInfos->isDir()) {
if(in_array($fileInfos, $exclu)) { continue; }
$dirContent[] = $dir . '/' . $fileInfos->getBasename();
$dirContent = array_merge($dirContent, self::scanDir($dir . '/' . $fileInfos->getBasename()));
}