lists are now sorted correctly at first view

This commit is contained in:
Roland Gruber 2003-04-22 17:01:19 +00:00
parent 0506e97446
commit c7a97314df
2 changed files with 4 additions and 2 deletions

View File

@ -137,8 +137,9 @@ echo "</body></html>\n";
function cmp_array($a, $b) {
// list specifies the sort column
global $list;
global $attr_array;
// sort by first attribute with name $list
if (!$list) $list = 0;
if (!$list) $list = strtolower($attr_array[0]);
if ($a[$list][0] == $b[$list][0]) return 0;
else if ($a[$list][0] == max($a[$list][0], $b[$list][0])) return 1;
else return -1;

View File

@ -119,8 +119,9 @@ echo "</body></html>\n";
function cmp_array($a, $b) {
// list specifies the sort column
global $list;
global $attr_array;
// sort by first attribute with name $list
if (!$list) $list = 0;
if (!$list) $list = strtolower($attr_array[0]);
if ($a[$list][0] == $b[$list][0]) return 0;
else if ($a[$list][0] == max($a[$list][0], $b[$list][0])) return 1;
else return -1;