Changeset 300
- Timestamp:
- 03/05/06 08:59:07
- Files:
-
- trunk/plagger/assets (added)
- trunk/plagger/assets/plugins (added)
- trunk/plagger/assets/plugins/notify-irc (added)
- trunk/plagger/assets/plugins/notify-irc/irc_notify.tt (moved) (moved from trunk/plagger/templates/plugins/irc_notify.tt)
- trunk/plagger/assets/plugins/publish-chtml (added)
- trunk/plagger/assets/plugins/publish-chtml/chtml_entry.tt (moved) (moved from trunk/plagger/templates/plugins/chtml_entry.tt)
- trunk/plagger/assets/plugins/publish-chtml/chtml_feed.tt (moved) (moved from trunk/plagger/templates/plugins/chtml_feed.tt)
- trunk/plagger/assets/plugins/publish-chtml/chtml_index.tt (moved) (moved from trunk/plagger/templates/plugins/chtml_index.tt)
- trunk/plagger/assets/plugins/publish-gmail (added)
- trunk/plagger/assets/plugins/publish-gmail/gmail_notify.tt (moved) (moved from trunk/plagger/templates/plugins/gmail_notify.tt)
- trunk/plagger/assets/plugins/publish-javascript (added)
- trunk/plagger/assets/plugins/publish-javascript/javascript.tt (moved) (moved from trunk/plagger/templates/plugins/javascript.tt)
- trunk/plagger/assets/plugins/publish-mtwidget (added)
- trunk/plagger/assets/plugins/publish-mtwidget/mt_widget.tt (moved) (moved from trunk/plagger/templates/plugins/mt_widget.tt)
- trunk/plagger/assets/plugins/publish-planet (added)
- trunk/plagger/assets/plugins/publish-planet/default (added)
- trunk/plagger/assets/plugins/publish-planet/default/static (added)
- trunk/plagger/assets/plugins/publish-planet/default/static/css (added)
- trunk/plagger/assets/plugins/publish-planet/default/static/css/handheld.css (added)
- trunk/plagger/assets/plugins/publish-planet/default/static/css/print.css (added)
- trunk/plagger/assets/plugins/publish-planet/default/static/css/screen.css (added)
- trunk/plagger/assets/plugins/publish-planet/default/template (added)
- trunk/plagger/assets/plugins/publish-planet/default/template/index.tt (added)
- trunk/plagger/assets/plugins/publish-psp (added)
- trunk/plagger/assets/plugins/publish-psp/psp.tt (moved) (moved from trunk/plagger/templates/plugins/psp.tt)
- trunk/plagger/assets/plugins/publish-spotlight (added)
- trunk/plagger/assets/plugins/publish-spotlight/spotlight.tt (moved) (moved from trunk/plagger/templates/plugins/spotlight.tt)
- trunk/plagger/assets/plugins/search-namazu (added)
- trunk/plagger/assets/plugins/search-namazu/namazu.tt (moved) (moved from trunk/plagger/templates/plugins/namazu.tt)
- trunk/plagger/lib/Plagger.pm (modified) (1 diff)
- trunk/plagger/lib/Plagger/Plugin.pm (modified) (3 diffs)
- trunk/plagger/lib/Plagger/Template.pm (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/plagger/lib/Plagger.pm
r273 r300 241 241 sub template { 242 242 my $self = shift; 243 $self->{template} ||= Plagger::Template->new($self);243 Plagger::Template->new($self, (caller)[0]->class_id); 244 244 } 245 245 trunk/plagger/lib/Plagger/Plugin.pm
r299 r300 7 7 use Plagger::Rule; 8 8 use Plagger::Rules; 9 10 use FindBin; 11 use File::Spec; 9 12 10 13 sub new { … … 43 46 my $self = shift; 44 47 45 my $pkg = ref($self) ;48 my $pkg = ref($self) || $self; 46 49 $pkg =~ s/Plagger::Plugin:://; 47 50 my @pkg = split /::/, $pkg; … … 50 53 } 51 54 55 sub 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 52 65 1; trunk/plagger/lib/Plagger/Template.pm
r178 r300 10 10 11 11 sub new { 12 my($class, $context ) = @_;12 my($class, $context, $plugin_class_id) = @_; 13 13 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" ]; 16 16 17 17 return $class->SUPER::new({
