Changeset 12309


Ignore:
Timestamp:
2006-07-26T15:28:37+12:00 (18 years ago)
Author:
kjdon
Message:

changed to explodes=yes, put table tags around the HTMLDisplay metadata, changed the patterm in the while loops in include whitespace, otherwise it can go into an infinite loop

File:
1 edited

Legend:

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

    r12169 r12309  
    5757        'abstract' => "no",
    5858        'inherits' => "yes",
     59        'explodes' => "yes",
    5960        'args'     => $arguments };
    6061
     
    116117    my $self = shift (@_);
    117118    my ($filename, $encoding, $language, $textref) = @_;
    118 
     119   
    119120    # Store the workform definitions for this file
    120121    my %workform_definitions = ();
     
    133134    $$textref =~ s/^\<Workform Definition\>(.*)\n//;
    134135    my $workform_definition = $1;
    135 
    136136    # Parse the workform definitions and store them for later
    137137    $workform_definition =~ s/^\"([^\"]*)\",//;
    138138    my $workform_name = $1;
    139 
    140139    my @workform_values;
    141     while ($workform_definition !~ /^$/) {
     140    while ($workform_definition !~ /^\s*$/) {
    142141        $workform_definition =~ s/^\"([^\"]*)\",?//;
    143142        my $workform_field = $1;
     
    167166
    168167    # Build up an HTML view of the record for easy display at run-time
    169     my $html_record = "";
     168    my $html_record = "<table>";
    170169
    171170    # Read the record's workform indicator and record number
     
    182181    my %workform_definitions = %{$self->{'workform_definitions'}->{$filename}};
    183182    if (!$workform_definitions{$workform_indicator}) {
    184     print STDERR "Unknown workform!\n";
     183    print STDERR "Unknown workform $workform_indicator!\n";
    185184    return 0;
    186185    }
     
    202201    # Read each field (surrounded by quotes) of the record
    203202    my $fieldnum = 0;
    204     while ($$textref !~ /^$/) {
     203    while ($$textref !~ /^\s*$/) {
    205204    $$textref =~ s/^\"([^\"]*)\",?//;
    206205    my $field_value_raw = $1;
     
    231230    }
    232231
     232    $html_record .= "</table>";
    233233    # Store HTML view of record as metadata
    234234    $doc_obj->add_utf8_metadata($cursection, "HTMLDisplay", $html_record);
Note: See TracChangeset for help on using the changeset viewer.