Update of /cvsroot/openinteract/OpenInteract/OpenInteract/Template
In directory usw-pr-cvs1:/tmp/cvs-serv28890
Modified Files:
Provider.pm
Log Message:
ensure template extension is looked up consistently
Index: Provider.pm
===================================================================
RCS file: /cvsroot/openinteract/OpenInteract/OpenInteract/Template/Provider.pm,v
retrieving revision 1.17
retrieving revision 1.18
diff -C2 -d -r1.17 -r1.18
*** Provider.pm 2001/10/17 04:47:07 1.17
--- Provider.pm 2001/10/18 12:02:30 1.18
***************
*** 186,192 ****
unless ( $tmpl_package and $tmpl_name ) {
my $website_dir = $R->CONFIG->get_dir( 'template' );
! my $tmpl_ext = $R->CONFIG->{template_info}{template_ext} ||
! $R->CONFIG->{template_ext} ||
! DEFAULT_TEMPLATE_EXTENSION;
my $common_template_name = "$website_dir/$name";
my $common_template_name_ext = "$common_template_name.$tmpl_ext";
--- 186,190 ----
unless ( $tmpl_package and $tmpl_name ) {
my $website_dir = $R->CONFIG->get_dir( 'template' );
! my $tmpl_ext = $self->_find_template_extension( $R->CONFIG );
my $common_template_name = "$website_dir/$name";
my $common_template_name_ext = "$common_template_name.$tmpl_ext";
***************
*** 452,456 ****
my $info = $repository->fetch_package_by_name({ name => $package });
if ( $info ) {
! my $template_ext = $R->CONFIG->{template_ext} || DEFAULT_TEMPLATE_EXTENSION;
my @template_files = ( DEFAULT_PACKAGE_TEMPLATE_DIR . $template_name,
DEFAULT_PACKAGE_TEMPLATE_DIR . "$template_name.$template_ext" );
--- 450,454 ----
my $info = $repository->fetch_package_by_name({ name => $package });
if ( $info ) {
! my $template_ext = $self->_find_template_extension( $R->CONFIG );
my @template_files = ( DEFAULT_PACKAGE_TEMPLATE_DIR . $template_name,
DEFAULT_PACKAGE_TEMPLATE_DIR . "$template_name.$template_ext" );
***************
*** 466,469 ****
--- 464,475 ----
"information for ($package) not found in repository!" );
return undef;
+ }
+
+
+ sub _find_template_extension {
+ my ( $self, $CONFIG ) = @_;
+ return $CONFIG->{template_info}{template_ext} ||
+ $CONFIG->{template_ext} ||
+ DEFAULT_TEMPLATE_EXTENSION;
}
|