Changeset 18404 for gsdl/trunk


Ignore:
Timestamp:
2009-01-16T18:23:59+13:00 (15 years ago)
Author:
ak19
Message:
  1. BasePlugin's file_rename_method option changed from inherited to none; 2. unicode::filename_to_url subroutine no longer takes rename_method as a parameter (back to how it was before).
Location:
gsdl/trunk/perllib
Files:
6 edited

Legend:

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

    r18398 r18404  
    5252      { 'name' => "base64",
    5353    'desc' => "{BasePlugin.rename_method.base64}" },
    54       { 'name' => "inherited",
    55     'desc' => "{BasePlugin.rename_method.inherited}",
     54      { 'name' => "none",
     55    'desc' => "{BasePlugin.rename_method.none}",
    5656    'hiddengli' => "yes" } ];
    5757
     
    776776    # If using URL encoding, then SourceFile is the url-reference to url-encoded
    777777    # filemeta: it's a url that refers to the actual file on the system
    778     $filemeta = &unicode::filename_to_url($filemeta, $self->{'file_rename_method'});
     778    $filemeta = &unicode::filename_to_url($filemeta);
    779779
    780780    $doc_obj->set_utf8_metadata_element($top_section, "SourceFile", $filemeta);
     
    10431043        # If the filename is url_encoded, we need to encode the % signs
    10441044        # in the filename, so that it works in a url
    1045         my $url_tail_filename = &unicode::filename_to_url($tail_filename, $self->{'file_rename_method'});
     1045        my $url_tail_filename = &unicode::filename_to_url($tail_filename);
    10461046        # work out extended tail extension (i.e. matching tail re)
    10471047
  • gsdl/trunk/perllib/plugins/HTMLPlugin.pm

    r18401 r18404  
    11491149    # of filenames, URL-encode the additional percent signs of the URL-encoded filename
    11501150    my $newname_url = $newname;
    1151     $newname_url = &unicode::filename_to_url($newname_url, $self->{'file_rename_method'});
     1151    $newname_url = &unicode::filename_to_url($newname_url);
    11521152    return "_httpdocimg_/$newname_url";
    11531153    }
  • gsdl/trunk/perllib/plugins/ImageConverter.pm

    r18403 r18404  
    188188    # The images that will get generated may contain percent signs in their src filenames
    189189    # Encode those percent signs themselves so that urls to the imgs refer to them correctly
    190     my $url_to_filehead = &unicode::filename_to_url($filehead, $self->{'file_rename_method'});
    191     my $url_to_filename_no_path = &unicode::filename_to_url($filename_no_path, $self->{'file_rename_method'});
     190    my $url_to_filehead = &unicode::filename_to_url($filehead);
     191    my $url_to_filename_no_path = &unicode::filename_to_url($filename_no_path);
    192192   
    193193    # Convert the image to a new type (if required).
  • gsdl/trunk/perllib/strings.properties

    r18321 r18404  
    722722BasePlugin.rename_method.base64:Use base64 encoding in renaming imported files and associated files.
    723723
     724BasePlugin.rename_method.none:Don't rename imported files and associated files.
     725
    724726BibTexPlugin.desc:BibTexPlugin reads bibliography files in BibTex format. BibTexPlugin creates a document object for every reference in the file. It is a subclass of SplitTextFile, so if there are multiple records, all are read.
    725727
  • gsdl/trunk/perllib/unicode.pm

    r18379 r18404  
    620620# a url more than once this way.
    621621sub filename_to_url {
    622     my ($text, $rename_method) = @_;
    623    
    624     if(!defined $rename_method || $rename_method eq "url") {
    625     if($text !~ m/%25/) {
    626         $text =~ s/%/%25/g;
    627     }
     622    my ($text) = @_;
     623   
     624    if($text !~ m/%25/) {
     625    $text =~ s/%/%25/g;
    628626    }
    629627    return $text;
  • gsdl/trunk/perllib/util.pm

    r18400 r18404  
    10261026    my ($cpackage,$cfilename,$cline,$csubr,$chas_args,$cwantarray) = caller(1);
    10271027    print STDERR "Calling method: $cfilename:$cline $cpackage->$csubr\n";
     1028    } elsif($rename_method eq "none") {
     1029    return $filename; # would have already been renamed
    10281030    }
    10291031
Note: See TracChangeset for help on using the changeset viewer.