mirror of
https://github.com/EGroupware/egroupware.git
synced 2025-01-13 01:18:20 +01:00
* sorting fileselection popup always by directory on top and then name
This commit is contained in:
parent
27abf5f015
commit
65813764ed
@ -220,7 +220,11 @@ class filemanager_select
|
||||
{
|
||||
$content['path'] = filemanager_ui::get_home_dir();
|
||||
}
|
||||
if (!($d = egw_vfs::opendir($content['path'])))
|
||||
if (!($files = egw_vfs::find($content['path'],array(
|
||||
'order' => 'name',
|
||||
'sort' => 'ASC',
|
||||
'maxdepth' => 1,
|
||||
))))
|
||||
{
|
||||
$content['msg'] = lang("Can't open directory %1!",$content['path']);
|
||||
}
|
||||
@ -228,10 +232,10 @@ class filemanager_select
|
||||
{
|
||||
$n = 0;
|
||||
$content['dir'] = array('mode' => $content['mode']);
|
||||
while (($name = readdir($d)))
|
||||
array_shift($files); // remove directory itself
|
||||
foreach($files as $path)
|
||||
{
|
||||
if ($name[0] == '.' || $name == 'Thumbs.db') continue; // ignore hidden files
|
||||
$path = egw_vfs::concat($content['path'],$name);
|
||||
$name = egw_vfs::basename($path);
|
||||
$is_dir = egw_vfs::is_dir($path);
|
||||
if ($content['mime'] && !$is_dir && egw_vfs::mime_content_type($path) != $content['mime'])
|
||||
{
|
||||
@ -251,7 +255,6 @@ class filemanager_select
|
||||
++$n;
|
||||
}
|
||||
if (!$n) $readonlys['selected[]'] = true; // remove checkbox from empty line
|
||||
closedir($d);
|
||||
}
|
||||
|
||||
$content['js'] = '<script type="text/javascript">
|
||||
|
Loading…
Reference in New Issue
Block a user