/[webpac2]/Webpacus/lib/Webpacus/Controller/Editor.pm
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Diff of /Webpacus/lib/Webpacus/Controller/Editor.pm

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 166 by dpavlin, Sat Nov 26 20:21:54 2005 UTC revision 167 by dpavlin, Sat Nov 26 21:11:41 2005 UTC
# Line 53  C<< webpac->default_template >>. Line 53  C<< webpac->default_template >>.
53  sub template : Local {  sub template : Local {
54          my ( $self, $c ) = @_;          my ( $self, $c ) = @_;
55    
56          my $template_file =          my $template_filename =
57                  $c->req->params->{template_filename} ||                  $c->req->params->{template_filename} ||
58                  $c->config->{webpac}->{default_template} ||                  $c->config->{webpac}->{default_template} ||
59                  $c->log->fatal("need default_template");                  $c->log->fatal("need default_template");
60    
61          my $webpac = $c->comp('Model::WebPAC');          my $webpac = $c->comp('Model::WebPAC');
62    
63          my $template_full_path = $webpac->{template_path} . "/$template_file";          my $template_path = $webpac->{template_path} || $c->log->fatal("can't find template_path in Model::WebPAC");
64    
65            my $template_full_path = "$template_path/$template_filename";
66    
67          $c->log->debug("loading $template_full_path");          $c->log->debug("loading $template_full_path");
68    
# Line 70  sub template : Local { Line 72  sub template : Local {
72                  return;                  return;
73          }          }
74    
75            # load template html
76          $c->stash->{'template_content'} =          $c->stash->{'template_content'} =
77                  $webpac->load_html( $template_full_path );                  $webpac->load_html( $template_full_path );
78    
79            # load template list
80    
81            opendir(my $d, $template_path) || $c->log->fatal("can't opendir '$template_path': $!");
82            my @templates = grep { /\.tt$/i } readdir($d);
83    
84            $c->stash->{template_list} = \@templates;
85            $c->stash->{template_filename} = $template_filename;
86    
87          $c->stash->{template} = 'editor/template.tt';          $c->stash->{template} = 'editor/template.tt';
88  }  }
89    
90  =item css  =item css
91    
92    Return css.
93    
94    B<Not finished>
95    
96  =cut  =cut
97    
98  sub css : Local {  sub css : Local {
# Line 98  sub css : Local { Line 113  sub css : Local {
113    
114  =item record  =item record
115    
116    Return html of record taking C<mfn> and C<template_filename> from request.
117    
118  =cut  =cut
119    
120  sub record : Local {  sub record : Local {
# Line 125  sub record : Local { Line 142  sub record : Local {
142          );          );
143  }  }
144    
 =back  
145    
146    
147    =back
148    
149  =head1 AUTHOR  =head1 AUTHOR
150    
151  Dobrica Pavlinusic, C<< <dpavlin@rot13.org> >>  Dobrica Pavlinusic, C<< <dpavlin@rot13.org> >>

Legend:
Removed from v.166  
changed lines
  Added in v.167

  ViewVC Help
Powered by ViewVC 1.1.26