mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-11-08 00:54:50 +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 'mode':
|
||||||
case 'ctime':
|
case 'ctime':
|
||||||
case 'mtime':
|
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;
|
break;
|
||||||
|
|
||||||
// sort alphanumerical
|
// sort alphanumerical
|
||||||
@ -456,7 +459,17 @@ class egw_vfs extends vfs_stream_wrapper
|
|||||||
// fall throught
|
// fall throught
|
||||||
case 'name':
|
case 'name':
|
||||||
case 'mime':
|
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;
|
break;
|
||||||
}
|
}
|
||||||
//echo "order='$options[order]', sort='$options[sort]' --> '$c'<br>\n";
|
//echo "order='$options[order]', sort='$options[sort]' --> '$c'<br>\n";
|
||||||
|
Loading…
Reference in New Issue
Block a user