Changeset 18171
- Timestamp:
- 2008-12-11T10:37:02+13:00 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
gsdl/trunk/perllib/plugins/BasePlugin.pm
r17300 r18171 402 402 my $associate_tail_re = $self->{'associate_tail_re'}; 403 403 if ((defined $associate_tail_re) && ($associate_tail_re ne "")) { 404 405 404 my ($file_prefix,$file_ext) 406 405 = &util::get_prefix_and_tail_by_regex($filename_full_path,$associate_tail_re); 407 408 406 if ((defined $file_prefix) && (defined $file_ext)) { 409 407 my $shared_fileroot = $block_hash->{'shared_fileroot'}; … … 545 543 } 546 544 547 print STDERR "**** UTF8 encoding the filename $filemeta ";545 #print STDERR "**** UTF8 encoding the filename $filemeta "; 548 546 549 547 # if the filename encoding is set to utf8 but it isn't utf8 already--such as when … … 563 561 } 564 562 565 print STDERR " from encoding $filename_encoding -> $filemeta\n";563 #print STDERR " from encoding $filename_encoding -> $filemeta\n"; 566 564 return $filemeta; 567 565 } … … 593 591 } 594 592 595 print STDERR "*** filename encoding determined based on locale: " . $self->{'filesystem_encoding'} . "\n";593 #print STDERR "*** filename encoding determined based on locale: " . $self->{'filesystem_encoding'} . "\n"; 596 594 return $self->{'filesystem_encoding'}; # can be the string "undefined" 597 595 } … … 1003 1001 foreach my $gaf (@{$metadata->{$field}}) { 1004 1002 my ($full_filename,$mimetype) = ($gaf =~ m/^(.*):(.*):$/); 1005 #my ($tail_filename) = ($full_filename =~ /^.*[\/\\](.+?)$/); 1006 my $tail_filename = $doc_obj->get_assocfile_from_sourcefile(); 1007 my $filename = $full_filename; 1003 my ($tail_filename) = ($full_filename =~ /^.*[\/\\](.+?)$/); 1004 1005 # we need to make sure the filename is valid utf-8 - we do 1006 # this by url encoding it 1007 # $tail_filename is the name that we store the file as 1008 $tail_filename = &unicode::url_encode($tail_filename); 1008 1009 $doc_obj->associate_file($full_filename,$tail_filename,$mimetype); 1009 1010 # then we need to encode the % signs in the filename, so that 1011 # it works in a url 1012 my $url_tail_filename = &unicode::filename_to_url($tail_filename); 1010 1013 # work out extended tail extension (i.e. matching tail re) 1011 1014 … … 1013 1016 = &util::get_prefix_and_tail_by_regex($tail_filename,$associate_tail_re); 1014 1017 my ($pre_doc_ext) = ($file_extended_ext =~ m/^(.*)\..*$/); 1015 1016 1018 my ($doc_ext) = ($tail_filename =~ m/^.*\.(.*)$/); 1017 my $start_doclink = "<a href=\"_httpprefix_/collect/[collection]/index/assoc/{Or}{[parent(Top):archivedir],[archivedir]}/$ tail_filename\">";1019 my $start_doclink = "<a href=\"_httpprefix_/collect/[collection]/index/assoc/{Or}{[parent(Top):archivedir],[archivedir]}/$url_tail_filename\">"; 1018 1020 my $srcicon = "_icon".$doc_ext."_"; 1019 1021 my $end_doclink = "</a>"; … … 1021 1023 my $assoc_form = "$start_doclink\{If\}{$srcicon,$srcicon,$doc_ext\}$end_doclink"; 1022 1024 1023 if (defined $pre_doc_ext ) {1025 if (defined $pre_doc_ext && $pre_doc_ext ne "") { 1024 1026 # for metadata such as [mp3._edited] [mp3._full] ... 1025 1027 $doc_obj->add_utf8_metadata ($cursection, "$doc_ext.$pre_doc_ext", $assoc_form);
Note:
See TracChangeset
for help on using the changeset viewer.