/[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 189 by dpavlin, Tue Nov 29 13:02:53 2005 UTC revision 243 by dpavlin, Wed Dec 14 23:04:05 2005 UTC
# Line 75  sub template : Local { Line 75  sub template : Local {
75                  if ($webpac->save_html( $template_full_path, $t )) {                  if ($webpac->save_html( $template_full_path, $t )) {
76                          $c->res->output("<span>saved $template_filename, $size bytes</span>");                          $c->res->output("<span>saved $template_filename, $size bytes</span>");
77                  } else {                  } else {
78                          $c->res->output("<span>error saving $template_filename!</span>");                          $c->res->output("<span class=\"error\">error saving $template_filename!</span>");
79                  }                  }
80                  return;                  return;
81          }          }
# Line 131  sub css : Local { Line 131  sub css : Local {
131                  if ($webpac->save_html( $css_full_path, $t )) {                  if ($webpac->save_html( $css_full_path, $t )) {
132                          $c->res->output("<span>saved $css_filename, $size bytes</span>");                          $c->res->output("<span>saved $css_filename, $size bytes</span>");
133                  } else {                  } else {
134                          $c->res->output("<span>error saving $css_filename!</span>");                          $c->res->output("<span class=\"error\">error saving $css_filename!</span>");
135                  }                  }
136                  return;                  return;
137          }          }
# Line 156  sub record : Local { Line 156  sub record : Local {
156    
157          $c->log->debug('record params '.Dumper($c->req->params));          $c->log->debug('record params '.Dumper($c->req->params));
158    
159          my $mfn = $c->req->params->{mfn};          my $record_uri = $c->req->params->{record_uri};
160    
161          if (! $mfn) {          if (! $record_uri) {
162                  $c->log->warn("no mfn, using 1");                  $c->log->fatal("no record_uri");
163                  $mfn = 1;                  $c->stash->{error} = 'record retrival failed';
164                    $c->stash->{template} = 'error.tt';
165                    return;
166          }          }
167    
168          my $template_filename = $c->req->params->{template_filename};          my $template_filename = $c->req->params->{template_filename};
# Line 171  sub record : Local { Line 173  sub record : Local {
173    
174          my $webpac = $c->comp('Model::WebPAC');          my $webpac = $c->comp('Model::WebPAC');
175    
176          my $html = $webpac->record( mfn => $mfn, template => $template_filename );          my $html = $webpac->record( record_uri => $record_uri, template => $template_filename );
177    
178          if ($html) {          if ($html) {
179                  $c->log->debug('check html with tidy');                  $c->log->debug('check html with tidy');
# Line 213  __TIDY_CLOSE__ Line 215  __TIDY_CLOSE__
215                  } else {                  } else {
216                          $html .= qq{<div class="tidy tidy_error">Can't parse this record with HTML Tidy!</div>};                          $html .= qq{<div class="tidy tidy_error">Can't parse this record with HTML Tidy!</div>};
217                  }                  }
218            } else {
219                    $html .= qq{<div class="no_results">Can't find record</div>};
220          }          }
221                    
                   
222          $c->response->content_type('text/html; charset=utf-8');          $c->response->content_type('text/html; charset=utf-8');
223          $c->res->output( $html );          $c->response->body( $html );
224  }  }
225    
226    

Legend:
Removed from v.189  
changed lines
  Added in v.243

  ViewVC Help
Powered by ViewVC 1.1.26