mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-07 16:44:20 +01:00
"egw_vfs::find() always use name as second sort criteria"
This commit is contained in:
parent
7ba0af7f28
commit
0d28eb4cea
@ -447,7 +447,10 @@ class egw_vfs extends vfs_stream_wrapper
|
||||
case 'mode':
|
||||
case 'ctime':
|
||||
case 'mtime':
|
||||
uasort($result,create_function('$a,$b',$c='return '.$dirsfirst.$sort.'($a[\''.$options['order'].'\']-$b[\''.$options['order'].'\']);'));
|
||||
$code = $dirsfirst.$sort.'($a[\''.$options['order'].'\']-$b[\''.$options['order'].'\']);';
|
||||
// always use name as second sort criteria
|
||||
$code = '$cmp = '.$code.' return $cmp ? $cmp : strcasecmp($a[\'name\'],$b[\'name\']);';
|
||||
uasort($result,create_function('$a,$b',$code));
|
||||
break;
|
||||
|
||||
// sort alphanumerical
|
||||
@ -456,7 +459,17 @@ class egw_vfs extends vfs_stream_wrapper
|
||||
// fall throught
|
||||
case 'name':
|
||||
case 'mime':
|
||||
uasort($result,create_function('$a,$b',$c='return '.$dirsfirst.$sort.'strcasecmp($a[\''.$options['order'].'\'],$b[\''.$options['order'].'\']);'));
|
||||
$code = $dirsfirst.$sort.'strcasecmp($a[\''.$options['order'].'\'],$b[\''.$options['order'].'\']);';
|
||||
if ($options['order'] != 'name')
|
||||
{
|
||||
// always use name as second sort criteria
|
||||
$code = '$cmp = '.$code.' return $cmp ? $cmp : strcasecmp($a[\'name\'],$b[\'name\']);';
|
||||
}
|
||||
else
|
||||
{
|
||||
$code = 'return '.$code;
|
||||
}
|
||||
uasort($result,create_function('$a,$b',$code));
|
||||
break;
|
||||
}
|
||||
//echo "order='$options[order]', sort='$options[sort]' --> '$c'<br>\n";
|
||||
|
Loading…
Reference in New Issue
Block a user