Ignore:
Timestamp:
2011-01-13T11:49:38+13:00 (13 years ago)
Author:
kjdon
Message:

moved the block_filename from BasePlugin into util. then I don't need to duplicate it for DirectoryPlugin which doesn't inherit from BasePlugin

File:
1 edited

Legend:

Unmodified
Added
Removed
  • main/trunk/greenstone2/perllib/plugins/BasePlugin.pm

    r23544 r23561  
    382382}
    383383
    384 sub block_filename
    385 {
    386     my $self = shift(@_);
    387     my ($block_hash,$filename) = @_;
    388    
    389     if ($ENV{'GSDLOS'} =~ m/^windows$/) {
    390    
    391     # lower case the entire thing, eg for cover.jpg when its actually cover.JPG
    392     my $lower_filename = lc($filename);
    393     $block_hash->{'file_blocks'}->{$lower_filename} = 1;
    394 #   my $lower_drive = $filename;
    395 #   $lower_drive =~ s/^([A-Z]):/\l$1:/i;
    396    
    397 #   my $upper_drive = $filename;
    398 #   $upper_drive =~ s/^([A-Z]):/\u$1:/i;
    399 #   
    400 #   $block_hash->{'file_blocks'}->{$lower_drive} = 1;
    401 #   $block_hash->{'file_blocks'}->{$upper_drive} = 1;       
    402     }
    403     else {
    404     $block_hash->{'file_blocks'}->{$filename} = 1;
    405     }
    406 }
    407384
    408385# rename imported files and assoc files using URL encoding by default
     
    441418
    442419    if ($self->{'block_exp'} ne "" && $filename_full_path =~ /$self->{'block_exp'}/) {
    443     $self->block_filename($block_hash,$filename_full_path);
     420    &util::block_filename($block_hash,$filename_full_path);
    444421    }
    445422
     
    461438    }   
    462439    if (&util::fd_exists($coverfile)) {
    463         $self->block_filename($block_hash,$coverfile);
     440        &util::block_filename($block_hash,$coverfile);
    464441    }
    465442    }
Note: See TracChangeset for help on using the changeset viewer.