Changeset 251 for trunk


Ignore:
Timestamp:
1999-05-03T17:33:31+12:00 (25 years ago)
Author:
sjboddie
Message:

Made it sort the '0-9' section to the back rather than the front

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/perllib/classify/AZClassify.pm

    r244 r251  
    4545    # if this document doesn't contain the metadata element we're
    4646    # sorting by we won't include it in this classification
     47
    4748    if (defined $metavalue) {
    4849    if ($self->{'metaname'} eq 'Creator') {
     
    111112    $classhash = $self->compactlist ($classhash);
    112113
     114    my @tmparr = ();
     115    foreach $subsection (sort keys (%$classhash)) {
     116    push (@tmparr, $subsection);
     117    }
     118   
     119    # if there's a 0-9 section it will have been sorted to the beginning
     120    # but we want it at the end
     121    if ($tmparr[0] eq '0-9') {
     122    shift @tmparr;
     123    push (@tmparr, '0-9');
     124    }
     125
    113126    my $count = 1;
    114     foreach $subsection (sort keys (%$classhash)) {
     127    foreach $subsection (@tmparr) {
    115128    push (@$rarr, [$subsection, $count, $classhash->{$subsection}]);
    116129    $count ++;
    117130    }
     131
    118132    return $rarr;
    119133}
Note: See TracChangeset for help on using the changeset viewer.