|
From: Chris W. <la...@us...> - 2001-10-18 02:47:46
|
Update of /cvsroot/openinteract/OpenInteract/OpenInteract/UI
In directory usw-pr-cvs1:/tmp/cvs-serv7158
Modified Files:
Main.pm
Log Message:
don't assume that the template will be a fully-qualified name, or that
a non-qualified name will be in the base_theme package
Index: Main.pm
===================================================================
RCS file: /cvsroot/openinteract/OpenInteract/OpenInteract/UI/Main.pm,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** Main.pm 2001/09/21 17:10:44 1.4
--- Main.pm 2001/10/18 02:47:43 1.5
***************
*** 9,18 ****
my $R = OpenInteract::Request->instance;
! # Put the Popup and other directives here. A 'directive' exists
! # before the actual url and should have been parsed out in the main
! # Apache handler (see pkg/base/OpenInteract.pm). The value for the
! # directive should be the key in the 'template_names' configuration
! # information which is used below. More information about directives
! # in the POD.
if ( my $directive = $R->{ui}{directive} ) {
--- 9,13 ----
my $R = OpenInteract::Request->instance;
! # Put the Popup and other directives here. (See DIRECTIVES in POD.)
if ( my $directive = $R->{ui}{directive} ) {
***************
*** 23,27 ****
else {
$R->{page}{_template_key_} = $R->CONFIG->{page_directives}{ $directive };
! $R->DEBUG && $R->scrib( 1, "Using template key from directive: ($R->{page}{_template_key_})" );
}
}
--- 18,23 ----
else {
$R->{page}{_template_key_} = $R->CONFIG->{page_directives}{ $directive };
! $R->DEBUG && $R->scrib( 1, "Using template key from directive: ",
! "($R->{page}{_template_key_})" );
}
}
***************
*** 45,73 ****
# Do our special content cases
! return undef if ( $R->{page}{send_file} );
return $R->{page}{content} if ( $R->{page}{_no_template_} );
! # $template_key here is being used to lookup a template name within a
! # theme
! my $template_key = $R->{page}{_template_key_};
! $template_key ||= 'simple_template' if ( $R->{page}{_simple_} );
! $template_key ||= 'main_template';
! my $db_template_name = $R->{page}{_template_name_} ||
! $R->{theme}->property_value( $template_key );
! my ( $template_pkg, $template_name ) = $R->site_template->parse_name( $db_template_name );
! unless ( $template_pkg and $template_name ) {
! $template_name = $db_template_name;
! $template_pkg = 'base_theme';
}
! $R->DEBUG && $R->scrib( 1, "Using template <<$db_template_name>> for full page" );
$R->{main_template_vars} ||= {};
! return $R->template->handler( {},
{ %{ $R->{main_template_vars} },
page => $R->{page} },
! { db => $template_name,
! package => $template_pkg } );
}
--- 41,66 ----
# Do our special content cases
! return undef if ( $R->{page}{send_file} );
return $R->{page}{content} if ( $R->{page}{_no_template_} );
! my $template_name = $R->{page}{_template_name_};
! # If the template name isn't specified by the request, look for a
! # template key which we can use to find the template in the theme.
!
! unless ( $template_name ) {
! my $template_key = $R->{page}{_template_key_};
! $template_key ||= 'simple_template' if ( $R->{page}{_simple_} );
! $template_key ||= 'main_template';
! $template_name = $R->{theme}->property_value( $template_key );
}
! $R->DEBUG && $R->scrib( 1, "Using template ($template_name) for full page" );
$R->{main_template_vars} ||= {};
! return $R->template->handler( {},
{ %{ $R->{main_template_vars} },
page => $R->{page} },
! { name => $template_name } );
}
***************
*** 109,114 ****
$R->{page}{_template_name_}
! to the name of the template to use. (This, and all templates named
! here, should be found in the 'base_theme' package.)
You can also set a template that might vary by theme. This is not the
--- 102,109 ----
$R->{page}{_template_name_}
! to the name of the template to use. This should be a fully-qualified
! template name -- such as 'mypkg::mytemplate'. If you do not specify a
! package the OI template provider will try to find the template in the
! global template directory.
You can also set a template that might vary by theme. This is not the
***************
*** 163,167 ****
A directive (or 'page directive') is placed before the relevant action
in the URL and tells OpenInteract to display the content in a certain
! manner.
For instance:
--- 158,163 ----
A directive (or 'page directive') is placed before the relevant action
in the URL and tells OpenInteract to display the content in a certain
! manner. The directive should have been parsed out in the main content
! handler (OpenInteract.pm).
For instance:
|