--- Webpacus/lib/Webpacus/Controller/Editor.pm 2005/11/24 16:30:16 134 +++ Webpacus/lib/Webpacus/Controller/Editor.pm 2005/11/24 22:29:29 135 @@ -35,15 +35,28 @@ } sub template : Local { - my ( $self, $c ) = @_; + my ( $self, $c ) = @_; - $c->stash->{template} = 'editor/template.tt'; + my $template_file = $c->config->{webpac}->{default_template} || die("need default_template"); + + my $webpac = $c->comp('Model::WebPAC'); + + my $template_full_path = $webpac->{template_path} . "/$template_file"; + + $c->stash->{'template_content'} = + $webpac->load_html( $template_full_path ); + + $c->stash->{template} = 'editor/template.tt'; } sub css : Local { - my ( $self, $c ) = @_; + my ( $self, $c ) = @_; - $c->stash->{template} = 'editor/css.tt'; + my $css_file = $c->config->{webpac}->{default_css} || die("need default_css"); + my $css_path = $c->config->{webpac}->{css_path} || die("need css_path"); + my $webpac = $c->comp('Model::WebPAC'); + $c->stash->{'css_content'} = $webpac->load_html( "$css_path/$css_file" ); + $c->stash->{template} = 'editor/css.tt'; } =back