Ignore:
Timestamp:
2005-09-29T10:54:06+12:00 (19 years ago)
Author:
kjdon
Message:

added documents_last - display document nodes after classifier nodes in the lists

File:
1 edited

Legend:

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

    r10483 r10663  
    7474    'desc' => "{Hierarchy.hlist_at_top}",
    7575    'type' => "flag",
    76     'reqd' => "no" } ];
     76    'reqd' => "no" },
     77      { 'name' => "documents_last",
     78    'desc' => "{Hierarchy.documents_last}",
     79    'type' => "flag",
     80    'reqd' => "no"}
     81      ];
    7782
    7883my $options =
     
    273278
    274279    $classifyinfo->{'contains'} = [] unless defined $classifyinfo->{'contains'};
     280    if ($self->{'documents_last'}) {
     281    # documents should come after nodes in the classifier
     282
     283    my $doc_pos = 0;
     284    foreach my $thing (@{$classifyinfo->{'contains'}}) {
     285        last if defined $thing->{'OID'};
     286        $doc_pos++;
     287    }
     288   
     289    while ($doc_pos < $headOID) {
     290        splice(@{$classifyinfo->{'contains'}}, $doc_pos, 0, $self->get_entry("", $classifytype));
     291        $doc_pos++;
     292    }
     293
     294    return $self->get_OID_entry ($tailOID, $classifyinfo->{'contains'}->[($headOID-1)], $title, $classifytype);
     295
     296    }
     297   
     298    # else, documents come before nodes
    275299    my $offset = 0;
    276300    foreach my $thing (@{$classifyinfo->{'contains'}}) {
Note: See TracChangeset for help on using the changeset viewer.