mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-03-12 00:45:34 +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);
|
||||
|
||||
$files = array();
|
||||
foreach ($rii as $file)
|
||||
foreach ($rii as $file) {
|
||||
if (!$file->isDir())
|
||||
$files[] = [substr($file->getPath(), strlen($path)+1), $file->getFilename()];
|
||||
if(count($files) > 20)
|
||||
return $files;
|
||||
}
|
||||
|
||||
return $files;
|
||||
}
|
||||
|
@ -68,11 +71,14 @@ $('.folderselect').click(function(ev) {
|
|||
$rii = new DirectoryIterator($path);
|
||||
|
||||
$files = array();
|
||||
foreach ($rii as $file)
|
||||
foreach ($rii as $file) {
|
||||
if ($file->isDir()) {
|
||||
if(($t = substr($file->getPath(), strlen($path)+1)) && ($file->getFilename() == '.'))
|
||||
$files[] = $t;
|
||||
}
|
||||
if(count($files) > 20)
|
||||
return $files;
|
||||
}
|
||||
|
||||
return $files;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user