Changeset 6769
- Timestamp:
- 2004-02-10T17:05:50+13:00 (20 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/perllib/plugins/PagedImgPlug.pm
r6555 r6769 128 128 'type' => "int", 129 129 'deft' => "100", 130 'reqd' => "no" }, 131 { 'name' => "noheaderpage", 132 'desc' => "{PagedImgPlug.noheaderpage}", 133 'type' => "flag", 134 'reqd' => "no" }, 135 { 'name' => "documenttype", 136 'desc' => "{PagedImgPlug.documenttype}", 137 'type' => "enum", 138 'list' => $type_list, 139 'deft' => "paged", 130 140 'reqd' => "no" } ]; 141 142 my $type_list = 143 [ { 'name' => "paged", 144 'desc' => "{PagedImgPlug.documenttype.paged}" }, 145 { 'name' => "hierarchy", 146 'desc' => "{PagedImgPlug.documenttype.hierarchy}" } ]; 131 147 132 148 my $options = { 'name' => "PagedImgPlug", … … 155 171 q^thumbnail^, \$self->{'thumbnail'}, 156 172 q^screenview^, \$self->{'screenview'}, 173 q^noheaderpage^, \$self->{'noheaderpage'}, 174 'documenttype/^(paged|hierarchy)$/paged', \$self->{'doctype'}, 157 175 "allow_extra_options")) { 158 176 … … 514 532 my $topsection = $doc_obj->get_top_section(); 515 533 516 # set the gsdlthistype metadata to Paged - this ensures this document will 517 # be treated as a Paged doc, even if Titles are not numeric 518 $doc_obj->set_utf8_metadata_element ($topsection, "gsdlthistype", "Paged"); 519 534 if ($self->{'doctype'} eq 'paged') { 535 # set the gsdlthistype metadata to Paged - this ensures this document will 536 # be treated as a Paged doc, even if Titles are not numeric 537 538 $doc_obj->set_utf8_metadata_element ($topsection, "gsdlthistype", "Paged"); 539 } else { 540 $doc_obj->set_utf8_metadata_element ($topsection, "gsdlthistype", "Hierarchy"); 541 } 520 542 open (ITEMFILE, $filename) || die "couldn't open $filename\n"; 521 543 my $line = ""; … … 536 558 537 559 # create a new section for each image file 538 my $cursection = $doc_obj->insert_section($doc_obj->get_end_child($topsection)); 560 # the first image may go in the top section or in the first child section (if headerpage is true) 561 my $cursection; 562 if ($first) { 563 if ( $self->{'noheaderpage'}) { 564 $cursection = $topsection; 565 } else { 566 $cursection = $doc_obj->insert_section($doc_obj->get_end_child($topsection)); 567 } 568 $first=0; 569 } else { 570 $cursection = $doc_obj->insert_section($doc_obj->get_end_child($topsection)); 571 } 539 572 # the page number becomes the Title 540 573 $doc_obj->set_utf8_metadata_element($cursection, 'Title', $pagenum);
Note:
See TracChangeset
for help on using the changeset viewer.