Changeset 8402


Ignore:
Timestamp:
2004-10-21T14:25:38+13:00 (20 years ago)
Author:
kjdon
Message:

fixed up the header page stuff with pagedimgplug - docs always have a toplevel section, with all tehimages underneath. if there is text in teh top section, then this becomes a header page, otherwise, this is an invisible page

Location:
trunk/gsdl/perllib
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/perllib/mgbuildproc.pm

    r8220 r8402  
    216216    if (defined $gsdlthistype) {
    217217    if ($gsdlthistype eq "Paged") {
    218         $thistype = "Paged";
    219218        $childtype = "Paged";
     219        if ($doc_obj->get_text_length ($doc_obj->get_top_section())) {
     220        $thistype = "Paged";
     221        } else {
     222        $thistype = "Invisible";
     223        }
     224       
    220225        return ($thistype, $childtype);
    221226    } elsif ($gsdlthistype eq "Hierarchy") {
  • trunk/gsdl/perllib/mgppbuildproc.pm

    r8220 r8402  
    253253    if (defined $gsdlthistype) {
    254254    if ($gsdlthistype eq "Paged") {
    255         $thistype = "Paged";
    256255        $childtype = "Paged";
     256        if ($doc_obj->get_text_length ($doc_obj->get_top_section())) {
     257        $thistype = "Paged";
     258        } else {
     259        $thistype = "Invisible";
     260        }
     261       
    257262        return ($thistype, $childtype);
    258263    } elsif ($gsdlthistype eq "Hierarchy") {
  • trunk/gsdl/perllib/plugins/PagedImgPlug.pm

    r8365 r8402  
    573573    my $line = "";
    574574    my $num = 0;
    575     my $first = 1;
    576575    while (defined ($line = <ITEMFILE>)) {
    577576    next unless $line =~ /\w/;
     
    588587       
    589588        # create a new section for each image file
    590         # the first image may go in the top section or in the first child section (if headerpage is true)
    591         my $cursection;
    592         if ($first) {
    593         if ( $self->{'headerpage'}) {
    594             $cursection = $doc_obj->insert_section($doc_obj->get_end_child($topsection));
    595         } else {
    596             $cursection = $topsection;
    597         }
    598         $first=0;
    599         } else {
    600         $cursection = $doc_obj->insert_section($doc_obj->get_end_child($topsection));
    601         }
     589        my $cursection = $doc_obj->insert_section($doc_obj->get_end_child($topsection));
    602590        # the page number becomes the Title
    603591        $doc_obj->set_utf8_metadata_element($cursection, 'Title', $pagenum);
     
    626614    close ITEMFILE;
    627615
     616    # if we want a header page, we need to add some text into the top section, otherwise this section will become invisible
     617    if ($self->{'headerpage'}) {
     618    $doc_obj->add_text($topsection, &gsprintf::lookup_string("{BasPlug.dummy_text}"));
     619    }
    628620    $file =~ s/\.item//i;
    629621    $doc_obj->set_OID ();
Note: See TracChangeset for help on using the changeset viewer.