changed the sort order of file list

This commit is contained in:
hyung-hwan 2016-10-25 09:29:18 +00:00
parent 64baf91b37
commit b77a9f36b4

View File

@ -309,17 +309,21 @@ $this->load->view (
if ($q != 0) return $q; if ($q != 0) return $q;
} }
return ($cx > $cy)? -1: return ($cx > $cy)? 1:
($cx < $cy)? 1: 0; ($cx < $cy)? -1: 0;
} }
function comp_files ($a, $b) function comp_files ($a, $b)
{ {
//$cmp = version_compare ($b->tag, $a->tag); //$cmp = version_compare ($b->tag, $a->tag);
$cmp = comp_tag ($b->tag, $a->tag); $cmp = comp_tag ($b->tag, $a->tag); // descending
if ($cmp == 0) if ($cmp == 0)
{ {
$cmp = strcmp ($a->name, $b->name); $cmp = comp_tag ($a->name, $b->name); // ascending
if ($cmp == 0)
{
$cmp = strcmp ($a->filename, $b->filename);
}
} }
return $cmp; return $cmp;
} }