Changeset 11089 for trunk/gsdl/perllib/plugins/BasPlug.pm
- Timestamp:
- 2006-01-24T10:23:40+13:00 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/gsdl/perllib/plugins/BasPlug.pm
r11069 r11089 99 99 'desc' => "{BasPlug.smart_block}", 100 100 'type' => "flag", 101 'reqd' => "no" }, 101 'reqd' => "no", 102 'hiddengli' => "yes" }, 102 103 { 'name' => "associate_ext", 103 104 'desc' => "{BasPlug.associate_ext}", … … 183 184 'reqd' => "no", 184 185 'hiddengli' => "yes" }, 185 { 'name' => "smart_block",186 'desc' => "{BasPlug.smart_block}",187 'type' => "flag",188 'reqd' => "no",189 'hiddengli' => "yes" },190 186 { 'name' => "new_extract_email", 191 187 'desc' => "", … … 413 409 $self->{'cover_image'} = 1; # cover image is on by default 414 410 $self->{'cover_image'} = 0 if ($self->{'no_cover_image'}); 415 $self->{'file_blocks'} = {};416 411 #$self->{'option_list'} = $hashArgOptLists->{"OptList"}; 417 412 … … 447 442 } 448 443 } 444 449 445 return bless $self, $class; 450 446 … … 479 475 $self->{'block_exp'} = $self->get_default_block_exp (); 480 476 } 477 481 478 } 482 479 … … 534 531 my $self =shift; 535 532 my $filename = shift; 536 537 if (exists $self->{'file_blocks'}->{$filename}) {538 # we've already checked if this file exists, so don't stat() again.539 # (eg for multi-sectioned files using SplitPlug)540 return;541 }542 533 543 534 if ($self->{'cover_image'}) { … … 549 540 if (-e $coverfile) { 550 541 $self->{'file_blocks'}->{$coverfile} = 1; 551 } else { 552 $self->{'file_blocks'}->{$coverfile} = 0; 553 } 542 } 554 543 } 555 544 … … 599 588 600 589 # do smart blocking if appropriate 601 if (defined $self->{'smart_block'}) { 590 if ($self->{'smart_block'}) { 591 $self->store_block_files($filename); 592 } 593 # block the cover image if there is one 594 if ($self->{'cover_image'}) { 602 595 $self->block_cover_image($filename); 603 $self->store_block_files($filename);604 596 } 605 597 … … 714 706 my $smart_block = $self->{'smart_block'}; 715 707 my $smart_block_BN = $self->{'smart_block_BN'}; 716 708 717 709 if ($smart_block || $smart_block_BN) { 718 710 if (defined $self->{'file_blocks'}->{$filename} && $self->{'file_blocks'}->{$filename} == 1){ … … 720 712 return (0,undef); # blocked 721 713 } 722 } elsif ($self->{'block_exp'} ne "" && $filename =~ /$self->{'block_exp'}/) { 723 $self->{'num_blocked'} ++; 724 return (0,undef); # blocked 725 } 726 714 } else { 715 if ($self->{'block_exp'} ne "" && $filename =~ /$self->{'block_exp'}/) { 716 $self->{'num_blocked'} ++; 717 return (0,undef); # blocked 718 } 719 if ($self->{'cover_image'}) { 720 if (defined $self->{'file_blocks'}->{$filename} && $self->{'file_blocks'}->{$filename} == 1){ 721 $self->{'num_blocked'} ++; 722 return (0,undef); # blocked 723 } 724 } 725 } 727 726 if ($filename !~ /$self->{'process_exp'}/ || !-f $filename) { 728 727 return (undef,undef); # can't recognise … … 885 884 sub process { 886 885 my $self = shift (@_); 887 my ($textref, $pluginfo, $base_dir, $file, $metadata, $doc_obj ) = @_;886 my ($textref, $pluginfo, $base_dir, $file, $metadata, $doc_obj, $gli) = @_; 888 887 889 888 gsprintf(STDERR, "BasPlug::process {common.must_be_implemented}\n") && die "\n";
Note:
See TracChangeset
for help on using the changeset viewer.