Changeset 1372 for branches/release-30/lib/MT/Template.pm
- Timestamp:
- 02/14/08 22:31:01 (22 months ago)
- Files:
-
- 1 modified
-
branches/release-30/lib/MT/Template.pm (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/release-30/lib/MT/Template.pm
r1369 r1372 91 91 $tmpl->{include_path} = $param{path}; 92 92 $tmpl->{include_filter} = $param{filter}; 93 $tmpl->{__file} = $file; 93 94 my $contents = $tmpl->load_file($file); 94 95 if (defined $contents) { … … 211 212 $ctx ||= $tmpl->context; 212 213 214 my ($timer, $start); 215 if (MT->config->PerformanceLogging) { 216 $timer = MT->get_timer(); 217 } 218 local $timer->{elapsed} = 0 if $timer; 219 213 220 local $ctx->{__stash}{template} = $tmpl; 214 221 my $tokens = $tmpl->tokens … … 243 250 $ctx->var( 'page_columns', $columns ) if $columns; 244 251 } 245 defined(my $res = $build->build($ctx, $tokens, $cond)) or 252 253 $timer->pause_partial if $timer; 254 255 my $res = $build->build($ctx, $tokens, $cond); 256 257 if ($timer) { 258 $timer->mark("MT::Template::build[" . ($tmpl->name || $tmpl->{__file}).']'); 259 } 260 261 unless (defined($res)) { 246 262 return $tmpl->error(MT->translate( 247 263 "Publish error in template '[_1]': [_2]", 248 264 $tmpl->name || $tmpl->{__file}, $build->errstr)); 265 } 249 266 $res =~ s/^\s*//; 250 267 return $res;
