set $options[need_mime] for $dirsontop, as it can NOT work otherwise

This commit is contained in:
Ralf Becker 2010-11-09 12:56:43 +00:00
parent e83456daa8
commit 113888c439

View File

@ -396,6 +396,7 @@ class egw_vfs extends vfs_stream_wrapper
$dirs_last = $options['depth']; // put content of dirs before the dir itself $dirs_last = $options['depth']; // put content of dirs before the dir itself
// show dirs on top by default, if no recursive listing (allways disabled if $type specified, as unnecessary) // show dirs on top by default, if no recursive listing (allways disabled if $type specified, as unnecessary)
$dirsontop = !$type && (isset($options['dirsontop']) ? (boolean)$options['dirsontop'] : isset($options['maxdepth'])&&$options['maxdepth']>0); $dirsontop = !$type && (isset($options['dirsontop']) ? (boolean)$options['dirsontop'] : isset($options['maxdepth'])&&$options['maxdepth']>0);
if ($dirsontop) $options['need_mime'] = true; // otherwise dirsontop can NOT work
// process some of the options (need to be done only once) // process some of the options (need to be done only once)
if (isset($options['name']) && !isset($options['name_preg'])) // change from simple *,? wildcards to preg regular expression once if (isset($options['name']) && !isset($options['name_preg'])) // change from simple *,? wildcards to preg regular expression once
@ -507,7 +508,7 @@ class egw_vfs extends vfs_stream_wrapper
$code = $dirsfirst.$sort.'($a[\''.$options['order'].'\']-$b[\''.$options['order'].'\']);'; $code = $dirsfirst.$sort.'($a[\''.$options['order'].'\']-$b[\''.$options['order'].'\']);';
// always use name as second sort criteria // always use name as second sort criteria
$code = '$cmp = '.$code.' return $cmp ? $cmp : strcasecmp($a[\'name\'],$b[\'name\']);'; $code = '$cmp = '.$code.' return $cmp ? $cmp : strcasecmp($a[\'name\'],$b[\'name\']);';
uasort($result,create_function('$a,$b',$code)); $ok = uasort($result,create_function('$a,$b',$code));
break; break;
// sort alphanumerical // sort alphanumerical
@ -526,10 +527,10 @@ class egw_vfs extends vfs_stream_wrapper
{ {
$code = 'return '.$code; $code = 'return '.$code;
} }
uasort($result,create_function('$a,$b',$code)); $ok = uasort($result,create_function('$a,$b',$code));
break; break;
} }
//echo "order='$options[order]', sort='$options[sort]' --> '$c'<br>\n"; //echo "<p>order='$options[order]', sort='$options[sort]' --> uasort($result,create_function(,'$code'))=".array2string($ok)."</p>>\n";
} }
// limit resultset // limit resultset
self::$find_total = count($result); self::$find_total = count($result);