@{[(scalar $self->meta_cookie())?(map { qq( \n) } $self->meta_cookie()):q[]]}@{[$self->meta_refresh()?qq():q[]]}@{[$self->meta_expires()?qq():q[]]}
@{[$self->title || 'ClearPress Application']}
$ss$rss$atom$js$script
\n);
}
sub footer {
return q(
);
}
sub cgi {
my ($self, $cgi) = @_;
if($cgi) {
$self->{cgi} = $cgi;
} elsif(!$self->{cgi}) {
$self->{cgi} = CGI->new();
}
return $self->{cgi};
}
sub session {
return {};
}
sub save_session {
return;
}
1;
__END__
=head1 NAME
ClearPress::decorator - HTML site-wide header & footer handling
=head1 VERSION
$LastChangeRevision$
=head1 SYNOPSIS
=head1 DESCRIPTION
=head1 SUBROUTINES/METHODS
=head2 new
=head2 defaults - Accessor for default settings used in HTML headers
my $sValue = $oDecorator->defaults($sKey);
=head2 fields - All generic get/set accessors for this object
my @aFields = $oDecorator->fields();
=head2 cookie - Get/set cookies
$oDecorator->cookie(@aCookies);
my @aCookies = $oDecorator->cookie();
=head2 header - construction of HTTP and HTML site headers
=head2 http_header - construction of HTTP response headers
e.g. content-type, set-cookie etc.
my $sHTTPHeaders = $oDecorator->http_header();
=head2 site_header - construction of HTML site headers
i.e. ...
Subclass and extend this method to provide consistent site-branding
my $sHTMLHeader = $oDecorator->site_header();
=head2 footer - pass-through to site_footer
=head2 site_footer - construction of HTML site footers
i.e. by default
my $sHTMLFooter = $oDecorator->site_footer
=head2 username - get/set username of authenticated user
my $sUsername = $oDecorator->username();
=head2 cgi - get/set accessor for a CGI object
$oDecorator->cgi($oCGI);
my $oCGI = $oDecorator->cgi();
=head2 session - Placeholder for a session hashref
my $hrSession = $oUtil->session();
This will not do any session handling until subclassed and overridden for a specific environment/service.
=head2 save_session - Placeholder for session saving
This will not do any session handling until subclassed and overridden for a specific environment/service.
=head1 DIAGNOSTICS
=head1 CONFIGURATION AND ENVIRONMENT
=head2 title - HTML page title
=head2 stylesheet - External CSS URL (arrayref permitted)
=head2 style - Embedded CSS content
=head2 jsfile - External Javascript URL (arrayref permitted)
=head2 script - Embedded Javascript content (arrayref permitted)
=head2 atom - External ATOM feed URL (arrayref permitted)
=head2 rss - External RSS feed URL (arrayref permitted)
=head2 meta_keywords - HTML meta keywords
=head2 meta_description - HTML meta description
=head2 meta_author - HTML meta author
=head2 meta_version - HTML meta version
=head2 meta_refresh - HTML meta refresh
=head2 meta_cookie - HTML meta cookie
=head2 meta_content_type - HTML meta content-type
=head2 meta_expires - HTML meta expires
=head2 onload - body onload value (javascript)
=head2 onunload - body onunload value (javascript)
=head2 onresize - body onresize value (javascript)
=head1 DEPENDENCIES
=over
=item strict
=item warnings
=item CGI
=item base
=item Class::Accessor
=back
=head1 INCOMPATIBILITIES
=head1 BUGS AND LIMITATIONS
=head1 AUTHOR
Roger Pettett, Erpettett@cpan.orgE
=head1 LICENSE AND COPYRIGHT
Copyright (C) 2008 Roger Pettett
This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself, either Perl version 5.8.4 or,
at your option, any later version of Perl 5 you may have available.
=cut