forked from extern/egroupware
- Add some more filter options
- Fix maxdepth option to work
This commit is contained in:
parent
eefc75369c
commit
47df86be97
@ -457,6 +457,8 @@ class filemanager_ui
|
||||
'' => 'Current directory',
|
||||
'2' => 'Directories sorted in',
|
||||
'3' => 'Show hidden files',
|
||||
'4' => 'All subdirectories',
|
||||
'5' => 'Files from next subdirectory',
|
||||
'0' => 'Files from subdirectories',
|
||||
);
|
||||
|
||||
@ -767,11 +769,14 @@ class filemanager_ui
|
||||
|
||||
// Re-map so 'No filters' favorite ('') is depth 1
|
||||
$filter = $query['filter'] === '' ? 1 : $query['filter'];
|
||||
|
||||
$maxdepth = $filter && $filter != 4 ? (int)(boolean)$filter : null;
|
||||
if($filter == 5) $maxdepth = 2;
|
||||
foreach(egw_vfs::find(!empty($query['col_filter']['dir']) ? $query['col_filter']['dir'] : $query['path'],array(
|
||||
'mindepth' => 1,
|
||||
'maxdepth' => $filter ? (int)(boolean)$filter : null,
|
||||
'maxdepth' => $maxdepth,
|
||||
'dirsontop' => $filter <= 1,
|
||||
'type' => $filter ? null : 'f',
|
||||
'type' => $filter && $filter != 5 ? ($filter == 4 ? 'd' : null) : 'f',
|
||||
'order' => $query['order'], 'sort' => $query['sort'],
|
||||
'limit' => (int)$query['num_rows'].','.(int)$query['start'],
|
||||
'need_mime' => true,
|
||||
|
@ -495,7 +495,7 @@ class egw_vfs extends vfs_stream_wrapper
|
||||
{
|
||||
self::_check_add($options,$path,$result);
|
||||
}
|
||||
if ($is_dir && (!isset($options['maxdepth']) || $options['maxdepth'] > 0) && ($dir = @opendir($path)))
|
||||
if ($is_dir && (!isset($options['maxdepth']) || ($options['maxdepth'] > 0 && $options['depth'] < $options['maxdepth'])) && ($dir = @opendir($path)))
|
||||
{
|
||||
while(($file = readdir($dir)) !== false)
|
||||
{
|
||||
@ -514,7 +514,7 @@ class egw_vfs extends vfs_stream_wrapper
|
||||
{
|
||||
$opts = $options;
|
||||
if ($opts['mindepth']) $opts['mindepth']--;
|
||||
if ($opts['maxdepth']) $opts['maxdepth']++;
|
||||
if ($opts['maxdepth']) $opts['depth']++;;
|
||||
unset($opts['order']);
|
||||
unset($opts['limit']);
|
||||
foreach(self::find($options['url']?$file:parse_url($file,PHP_URL_PATH),$opts,true) as $p => $s)
|
||||
|
Loading…
Reference in New Issue
Block a user