From: <bo...@kr...> - 2007-12-27 16:23:11
|
Revision: 4610 Author: bodo Date: 2007-12-27 11:22:57 -0500 (Thu, 27 Dec 2007) Log Message: ----------- Modified template pre-loading code to work with localized templates. Modified Paths: -------------- trunk/krang/conf/krang-preload.pl Modified: trunk/krang/conf/krang-preload.pl =================================================================== --- trunk/krang/conf/krang-preload.pl 2007-12-25 06:50:00 UTC (rev 4609) +++ trunk/krang/conf/krang-preload.pl 2007-12-27 16:22:57 UTC (rev 4610) @@ -15,6 +15,7 @@ use Krang::ClassLoader 'lib'; use Krang::ClassLoader Conf => qw(KrangRoot); use File::Find qw(find); +use File::Spec::Functions qw(catdir); use Krang::ClassLoader 'HTMLTemplate'; @@ -39,14 +40,15 @@ print STDERR "Pre-loading HTML Templates...\n"; find( sub { - return if /^\.?#/; # skip emacs droppings - return if /\.base\.tmpl$/; - return unless /\.tmpl$/; + return if /^\.?#/; # skip emacs droppings + return if /\.base\.tmpl$/; # skip base templates + return unless /\.tmpl$/; # only load localized templates pkg('HTMLTemplate')->new( - filename => "$File::Find::dir/$_", - cache => 1, - loop_context_vars => 1, - ); + path => $File::Find::dir, + filename => $_, + cache => 1, + loop_context_vars => 1, + ); }, KrangRoot . '/templates'); |