# # modules/templates.pm # # Developed by Lubomir Host 'rajo' # Copyright (c) 2005 Platon SDG, http://platon.sk/ # Licensed under terms of GNU General Public License. # All rights reserved. # # Changelog: # 2005-03-14 - created # # $Platon$ package templates; use strict; use Carp; use English; use Template::Namespace::Constants; use config; use vars qw($VERSION @ISA @EXPORT $AUTOLOAD); use base qw( Template ); use vars qw( $VERSION $DEBUG ); $VERSION = sprintf("%d.%02d", q$Revision: 1.1 $ =~ /(\d+)\.(\d+)/); $DEBUG = 0 unless defined $DEBUG; sub new { #{{{ my $this = shift; my $class = ref($this) || $this; my $config = shift; my $self = Template->new({ AUTHOR => 'Ľubomír Host (rajo)', INCLUDE_PATH => [ @_, './templates' ], RELATIVE => 1, PRE_PROCESS => 'http-header.tt2', COMPILE_DIR => "/tmp/rajo-ttc-$EUID", NAMESPACE => { author => Template::Namespace::Constants->new({ name => 'Ľubomír Host (rajo)', email => '', callto => 'rajo207', icq => 257322664, }), const => Template::Namespace::Constants->new({ fastcgi_name => $config->fastcgi_name(), site_title => $config->site_title(), site_base => $config->site_base(), site_base_uri => $config->site_base_uri(), admin_base_uri => $config->admin_base_uri(), }), }, PLUGIN_BASE => 'Platon::Template::Plugin', PLUGINS => { lang => 'lang', obfuscator => 'obfuscator', myurl => 'myurl', }, VARIABLES => { conf => $config, env => \%ENV, } }); bless $self, $class; return $self; } # }}} 1; __END__ =head1 NAME templates - <<>> =head1 SYNOPSIS use templates; my $xxx = new templates; =head1 DESCRIPTION The templates module allows you ... <<>> =head2 EXPORT <>> =head1 SEE ALSO =head1 AUTHORS Lubomir Host 'rajo', =cut # vim: ts=4 # vim600: fdm=marker fdl=0 fdc=3