mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-05-16 06:31:21 +00:00
do not list more than 20 folders/files
This commit is contained in:
parent
4e2af679e9
commit
7c1479708f
|
@ -54,9 +54,12 @@ $('.folderselect').click(function(ev) {
|
||||||
$rii = new DirectoryIterator($path);
|
$rii = new DirectoryIterator($path);
|
||||||
|
|
||||||
$files = array();
|
$files = array();
|
||||||
foreach ($rii as $file)
|
foreach ($rii as $file) {
|
||||||
if (!$file->isDir())
|
if (!$file->isDir())
|
||||||
$files[] = [substr($file->getPath(), strlen($path)+1), $file->getFilename()];
|
$files[] = [substr($file->getPath(), strlen($path)+1), $file->getFilename()];
|
||||||
|
if(count($files) > 20)
|
||||||
|
return $files;
|
||||||
|
}
|
||||||
|
|
||||||
return $files;
|
return $files;
|
||||||
}
|
}
|
||||||
|
@ -68,11 +71,14 @@ $('.folderselect').click(function(ev) {
|
||||||
$rii = new DirectoryIterator($path);
|
$rii = new DirectoryIterator($path);
|
||||||
|
|
||||||
$files = array();
|
$files = array();
|
||||||
foreach ($rii as $file)
|
foreach ($rii as $file) {
|
||||||
if ($file->isDir()) {
|
if ($file->isDir()) {
|
||||||
if(($t = substr($file->getPath(), strlen($path)+1)) && ($file->getFilename() == '.'))
|
if(($t = substr($file->getPath(), strlen($path)+1)) && ($file->getFilename() == '.'))
|
||||||
$files[] = $t;
|
$files[] = $t;
|
||||||
}
|
}
|
||||||
|
if(count($files) > 20)
|
||||||
|
return $files;
|
||||||
|
}
|
||||||
|
|
||||||
return $files;
|
return $files;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user