Mise à jour de 'module/gallery/gallery.php'
Exclusion des dossiers ne contenant pas d'images
This commit is contained in:
parent
1a73b96039
commit
8b9bb4dfc6
|
@ -737,10 +737,12 @@ class galleriesHelper extends helper {
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
public static function scanDir($dir) {
|
public static function scanDir($dir) {
|
||||||
|
$exclu = array ("agenda","theme", "modules", "fonts", "icones", "backup");
|
||||||
$dirContent = [];
|
$dirContent = [];
|
||||||
$iterator = new DirectoryIterator($dir);
|
$iterator = new DirectoryIterator($dir);
|
||||||
foreach($iterator as $fileInfos) {
|
foreach($iterator as $fileInfos) {
|
||||||
if($fileInfos->isDot() === false AND $fileInfos->isDir()) {
|
if($fileInfos->isDot() === false AND $fileInfos->isDir()) {
|
||||||
|
if(in_array($fileInfos, $exclu)) { continue; }
|
||||||
$dirContent[] = $dir . '/' . $fileInfos->getBasename();
|
$dirContent[] = $dir . '/' . $fileInfos->getBasename();
|
||||||
$dirContent = array_merge($dirContent, self::scanDir($dir . '/' . $fileInfos->getBasename()));
|
$dirContent = array_merge($dirContent, self::scanDir($dir . '/' . $fileInfos->getBasename()));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue