Sfoglia il codice sorgente

More #221: All uses themed_render now

George S. Baugh 3 anni fa
parent
commit
0b15beaaa2
1 ha cambiato i file con 3 aggiunte e 7 eliminazioni
  1. 3 7
      lib/TCMS.pm

+ 3 - 7
lib/TCMS.pm

@@ -237,12 +237,6 @@ sub _serve ($path, $streaming=0, $last_fetch=0, $deflate=0) {
 
 sub _render ($template, $vars, @headers) {
 
-    state $processor = Text::Xslate->new(
-        path   => 'www/templates',
-        header => ['header.tx'],
-        footer => ['footer.tx'],
-    );
-
     #XXX default vars that need to be pulled from config
     $vars->{dir}       //= 'ltr';
     $vars->{lang}      //= 'en-US';
@@ -264,7 +258,9 @@ sub _render ($template, $vars, @headers) {
     push(@headers, $ct => $vars->{contenttype});
     push(@headers, $cc => $vars->{cachecontrol}) if $vars->{cachecontrol};
 
-    my $body = $processor->render($template,$vars);
+    my $body = Trog::Routes::HTML::themed_render('header.tx', $vars);
+    $body   .= Trog::Routes::HTML::themed_render($template,$vars);
+    $body   .= Trog::Routes::HTML::themed_render('footer.tx', $vars);
     $body = encode_utf8($body);
 
     #Return data in the event the caller does not support deflate