Changeset 10344


Ignore:
Timestamp:
2005-07-28T16:15:19+12:00 (19 years ago)
Author:
kjdon
Message:

if there was no Title, add PageNum as a Title

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/gsdl/perllib/plugins/PagedImgPlug.pm

    r10276 r10344  
    247247    return q^(?i)(\.jpe?g|\.gif|\.png|\.tif?f|\.te?xt|~)$^
    248248}
     249
    249250# Create the thumbnail and screenview images, and discover the Image's
    250251# size, width, and height using the convert utility.
     
    734735    my $doc_obj = $self->{'doc_obj'};
    735736    if ($element eq "Page" || $element eq "PageGroup") {
     737    # if Title hasn't been assigned, set PageNum as Title
     738    if (!defined $doc_obj->get_metadata_element ($self->{'current_section'}, "Title") && defined $doc_obj->get_metadata_element ($self->{'current_section'}, "PageNum" )) {
     739        $doc_obj->add_utf8_metadata ($self->{'current_section'}, "Title", $doc_obj->get_metadata_element ($self->{'current_section'}, "PageNum" ));
     740    }
    736741    # move the current section back to the parent
    737742    $self->{'current_section'} = $doc_obj->get_parent_section($self->{'current_section'});
Note: See TracChangeset for help on using the changeset viewer.