Changeset 300

Show
Ignore:
Timestamp:
03/05/06 08:59:07
Author:
cwest
Message:

Move plugin assets into assets/plugin

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/plagger/lib/Plagger.pm

    r273 r300  
    241241sub template { 
    242242    my $self = shift; 
    243     $self->{template} ||= Plagger::Template->new($self); 
     243    Plagger::Template->new($self, (caller)[0]->class_id); 
    244244} 
    245245 
  • trunk/plagger/lib/Plagger/Plugin.pm

    r299 r300  
    77use Plagger::Rule; 
    88use Plagger::Rules; 
     9 
     10use FindBin; 
     11use File::Spec; 
    912 
    1013sub new { 
     
    4346    my $self = shift; 
    4447 
    45     my $pkg = ref($self)
     48    my $pkg = ref($self) || $self
    4649       $pkg =~ s/Plagger::Plugin:://; 
    4750    my @pkg = split /::/, $pkg; 
     
    5053} 
    5154 
     55sub assets_dir { 
     56    my $self = shift; 
     57 
     58    my $assets_dir = File::Spec->catfile( 
     59                            $self->conf->{assets_path} 
     60                         || ($FindBin::Bin, "assets/plugins", $self->class_id) 
     61                     ); 
     62 
     63} 
     64 
    52651; 
  • trunk/plagger/lib/Plagger/Template.pm

    r178 r300  
    1010 
    1111sub new { 
    12     my($class, $context) = @_; 
     12    my($class, $context, $plugin_class_id) = @_; 
    1313 
    14     my $path = $context->conf->{template_path} || File::Spec->catfile($FindBin::Bin, "templates"); 
    15     my $paths = [ $path, "$path/plugins" ]; 
     14    my $path = $context->conf->{assets_path} || File::Spec->catfile($FindBin::Bin, "assets"); 
     15    my $paths = [ "$path/plugins/$plugin_class_id" ]; 
    1616 
    1717    return $class->SUPER::new({