Changeset 15874


Ignore:
Timestamp:
2008-06-05T09:46:07+12:00 (16 years ago)
Author:
kjdon
Message:

replaced some code with equivalent method from util (filename_within_collection)

File:
1 edited

Legend:

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

    r14966 r15874  
    6565   
    6666    if (defined $source_filename) {
    67     my $collect_dir = $ENV{'GSDLCOLLECTDIR'};
    68 
    69     if (defined $collect_dir) {
    70         my $dirsep = &util::get_dirsep();
    71         if ($collect_dir !~ m/$dirsep$/) {
    72         $collect_dir .= $dirsep;
    73         }
    74 
    75         $collect_dir =~ s/\\/\\\\/g; # escape DOS style file separator
    76 
    77         # if from within GSDLCOLLECTDIR, then remove directory prefix
    78         # so source_filename is realative to it.  This is done to aid
    79         # portability, i.e. the collection can be moved to somewhere
    80         # else on the file system and the archives directory will still
    81         # work.  This is needed, for example in the applet version of
    82         # GLI where GSDLHOME/collect on the server will be different to
    83         # the collect directory of the remove user.  Of course,
    84         # GSDLCOLLECTDIR subsequently needs to be put back on to turn
    85         # it back into a full pathname.
    86 
    87         if ($source_filename =~ /^$collect_dir(.*)$/) {
    88         $source_filename = $1;
    89         }
    90     }
    91 
     67    $source_filename = &util::filename_within_collection($source_filename);
    9268    $self->set_source_filename ($source_filename);
    9369    }
Note: See TracChangeset for help on using the changeset viewer.