[vhffs-dev] [865] A new API for Panel/Public is coming (note, small changes on all panel .pl files are needed). |
[ Thread Index |
Date Index
| More vhffs.org/vhffs-dev Archives
]
Revision: 865
Author: gradator
Date: 2007-09-06 03:41:55 +0000 (Thu, 06 Sep 2007)
Log Message:
-----------
A new API for Panel/Public is coming (note, small changes on all panel .pl files are needed).
Modified Paths:
--------------
trunk/vhffs-api/src/Vhffs/Panel/Commons.pm
trunk/vhffs-api/src/Vhffs/Panel/Main.pm
trunk/vhffs-panel/ajax/help.pl
trunk/vhffs-panel/auth.pl
trunk/vhffs-panel/lost.pl
trunk/vhffs-panel/lost_ack.pl
trunk/vhffs-panel/panel.pl
trunk/vhffs-panel/subscribe.pl
trunk/vhffs-panel/templates/Makefile.am
trunk/vhffs-panel/templates/main/auth.tmpl
trunk/vhffs-panel/templates/main/close.tmpl
trunk/vhffs-panel/templates/main/lost.tmpl
trunk/vhffs-panel/templates/main/lost_failed.tmpl
trunk/vhffs-panel/templates/main/lost_ok.tmpl
trunk/vhffs-panel/templates/main/panel.tmpl
trunk/vhffs-panel/templates/misc/simplemsg.tmpl
trunk/vhffs-panel/templates/user/create.tmpl
trunk/vhffs-panel/templates/user/create_complete.tmpl
trunk/vhffs-panel/themes/vhffs/main.css
trunk/vhffs-panel/user/prefs.pl
trunk/vhffs-panel/user/projects.pl
trunk/vhffs-public/allgroups.pl
trunk/vhffs-public/allwebsites.pl
trunk/vhffs-public/group.pl
trunk/vhffs-public/index.pl
trunk/vhffs-public/lastgroups.pl
trunk/vhffs-public/lastusers.pl
trunk/vhffs-public/templates/allwebsites.tmpl
trunk/vhffs-public/templates/group.tmpl
trunk/vhffs-public/templates/index.tmpl
trunk/vhffs-public/templates/lastgroups.tmpl
trunk/vhffs-public/templates/lastusers.tmpl
trunk/vhffs-public/templates/simplemsg.tmpl
trunk/vhffs-public/templates/user.tmpl
trunk/vhffs-public/user.pl
trunk/vhffs-public/websearch.pl
Added Paths:
-----------
trunk/vhffs-panel/templates/main/main.tmpl
Modified: trunk/vhffs-api/src/Vhffs/Panel/Commons.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Panel/Commons.pm 2007-09-04 17:34:02 UTC (rev 864)
+++ trunk/vhffs-api/src/Vhffs/Panel/Commons.pm 2007-09-06 03:41:55 UTC (rev 865)
@@ -53,9 +53,8 @@
}
my $templatedir = $panel->{templatedir};
- my $template = new HTML::Template( filename => $templatedir."/panel/main/auth.tmpl" );
+ my $template = new HTML::Template( filename => $templatedir.'/panel/main/auth.tmpl' );
- $template->param( TITLE => gettext("VHFFS Login") );
$template->param( TEXT_WELCOME => sprintf( gettext("Welcome on %s") , $hosturl ) );
$template->param( VHFFS_INFO => sprintf( "Run VHFFS %s (%s)" , Vhffs::Constants::VHFFS_VERSION , Vhffs::Constants::VHFFS_RELEASE_NAME ) );
$template->param( TEXT_PLEASEIDENTIFY => gettext("Please enter your username and password") );
@@ -66,7 +65,7 @@
$template->param( TEXT_LOSTPASSWORD => gettext("I've lost my password") );
$template->param( TEXT_SUBSCRIBE => gettext("Subscribe") );
- $template->param( LANGS => Vhffs::Panel::Main::select_lang( $vhffs ) );
+ $template->param( LANGS => $panel->select_lang );
if( $vhffs->get_config->get_panel->{'stats_on_home'} eq 'yes' ) {
@@ -83,7 +82,8 @@
$template->param( URL_PUBLIC => $vhffs->get_config->get_panel->{'url_public'} );
}
- $panel->display_light( $template );
+ $panel->light( $template );
+ $panel->display;
}
1;
Modified: trunk/vhffs-api/src/Vhffs/Panel/Main.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Panel/Main.pm 2007-09-04 17:34:02 UTC (rev 864)
+++ trunk/vhffs-api/src/Vhffs/Panel/Main.pm 2007-09-06 03:41:55 UTC (rev 865)
@@ -3,7 +3,7 @@
package Vhffs::Panel::Main;
require Exporter;
@ISA = qw(Exporter);
-@EXPORT = qw( display display_light );
+@EXPORT = qw( display );
use POSIX qw(locale_h);
use HTML::Template;
@@ -47,37 +47,6 @@
=cut
-sub check
-{
- my $vhffs = shift;
- my $templatedir = $vhffs->get_config->get_templatedir;
- my $template;
-
- if( $vhffs->is_valid() == 0 )
- {
- $template = new HTML::Template( filename => $templatedir."/panel/main/close.tmpl" );
- $template->param( TITLE => gettext("Platform temporary closed") );
- $template->param( TEXT_CLOSE => gettext("Platform temporary closed<br/>database error") );
- $template->param( TEXT_EXPLAIN => gettext("This platform is temporary closed. Administrators are performing some maintenances tasks or system has database errors. Please come back in a few minutes to log in.") );
-
- display_light Vhffs::Panel::Main( $template );
- exit( 0 );
- }
-
- if( $vhffs->get_config->get_panel->{'open'} ne 'yes' )
- {
- $template = new HTML::Template( filename => $templatedir."/panel/main/close.tmpl" );
- $template->param( TITLE => gettext("Platform temporary closed") );
- $template->param( TEXT_CLOSE => gettext("Platform temporary closed.") );
- $template->param( TEXT_EXPLAIN => gettext("This platform is temporary closed. Administrators are performing some maintenances tasks. Please come back in a few minutes to log in.") );
-
- display_light Vhffs::Panel::Main( $template );
- exit( 0 );
- }
-
- return 0;
-}
-
=pod
=head2 check_public
@@ -89,16 +58,16 @@
=cut
sub check_public {
- my $self = shift;
- my $vhffs = $self->{vhffs};
+ my $panel = shift;
+ my $vhffs = $panel->{vhffs};
my $templatedir = $vhffs->get_config->get_templatedir;
if( $vhffs->get_config->get_panel->{'use_public'} ne 'yes' ) {
my $template = new HTML::Template( filename => $templatedir.'/panel/main/close.tmpl' );
- $template->param( TITLE => gettext('Public area not available') );
$template->param( TEXT_CLOSE => gettext('Public area not available') );
$template->param( TEXT_EXPLAIN => gettext('Public area is not available on this platform.') );
-
- $self->display_light( $template );
+
+ $panel->light( $template );
+ $panel->display;
exit( 0 );
}
}
@@ -115,8 +84,8 @@
=cut
sub is_open {
- my $self = shift;
- my $vhffs = $self->{vhffs};
+ my $panel = shift;
+ my $vhffs = $panel->{vhffs};
use Vhffs::Functions;
return Vhffs::Functions::strtoboolean( $vhffs->get_config->get_panel->{'open'} );
}
@@ -133,8 +102,8 @@
=cut
sub is_public {
- my $self = shift;
- my $vhffs = $self->{vhffs};
+ my $panel = shift;
+ my $vhffs = $panel->{vhffs};
use Vhffs::Functions;
return Vhffs::Functions::strtoboolean( $vhffs->get_config->get_panel->{'use_public'} );
}
@@ -151,8 +120,8 @@
=cut
sub use_avatars {
- my $self = shift;
- my $vhffs = $self->{vhffs};
+ my $panel = shift;
+ my $vhffs = $panel->{vhffs};
use Vhffs::Functions;
return ( Vhffs::Functions::strtoboolean( $vhffs->get_config->get_panel->{'users_avatars'} )
|| Vhffs::Functions::strtoboolean( $vhffs->get_config->get_panel->{'groups_avatars'} ) );
@@ -170,8 +139,8 @@
=cut
sub use_users_avatars {
- my $self = shift;
- my $vhffs = $self->{vhffs};
+ my $panel = shift;
+ my $vhffs = $panel->{vhffs};
use Vhffs::Functions;
return Vhffs::Functions::strtoboolean( $vhffs->get_config->get_panel->{'users_avatars'} );
}
@@ -188,8 +157,8 @@
=cut
sub use_groups_avatars {
- my $self = shift;
- my $vhffs = $self->{vhffs};
+ my $panel = shift;
+ my $vhffs = $panel->{vhffs};
use Vhffs::Functions;
return Vhffs::Functions::strtoboolean( $vhffs->get_config->get_panel->{'groups_avatars'} );
}
@@ -207,12 +176,12 @@
=cut
sub check_modo {
- my $self = shift;
- my $user = $self->{user};
+ my $panel = shift;
+ my $user = $panel->{user};
unless($user->is_moderator || $user->is_admin) {
- $self->set_title( gettext('Access denied') );
- $self->add_error( gettext('You are not granted to access this page') );
- $self->display( '' );
+ $panel->set_title( gettext('Access denied') );
+ $panel->add_error( gettext('You are not granted to access this page') );
+ $panel->display( '' );
exit( 0 );
}
}
@@ -227,12 +196,12 @@
=cut
sub check_admin {
- my $self = shift;
- my $user = $self->{user};
+ my $panel = shift;
+ my $user = $panel->{user};
unless($user->is_admin) {
- $self->set_title( gettext('Access denied') );
- $self->add_error( gettext('You are not granted to access this page') );
- $self->display( '' );
+ $panel->set_title( gettext('Access denied') );
+ $panel->add_error( gettext('You are not granted to access this page') );
+ $panel->display( '' );
exit( 0 );
}
}
@@ -263,34 +232,6 @@
}
-sub cookie_theme
-{
- my $vhffs;
- my $cgi;
- my $cookie;
- my $theme;
-
- $vhffs = shift;
- $cgi = shift;
-
- $theme = $cgi->param( 'theme' ) if defined $cgi;
- $cookie = CGI->cookie( -name=>'theme', -value=>$theme, -expires=>'+10y' ) if defined $theme;
- $theme = CGI->cookie( 'theme' ) unless defined $theme;
- $theme = $vhffs->get_config->get_panel->{'default_theme'} unless defined $theme;
- $theme = 'vhffs' unless( defined $theme && -f $vhffs->get_config->get_panel->{'themesdir'}.'/'.$theme.'/main.css' );
-
- return ( $theme, $cookie );
-}
-
-
-sub get_theme
-{
- my $vhffs = shift;
- my ( $theme, $cookie ) = cookie_theme( $vhffs );
- return $theme;
-}
-
-
sub list_languages
{
my $vhffs = shift;
@@ -323,147 +264,163 @@
sub select_lang
{
use Vhffs::Intl;
- my $main = shift;
- my $txt = "";
- my $langs = Vhffs::Intl::get_languages( $main );
- my $l;
- foreach $l ( @{$langs} )
+ my $panel = shift;
+ my $txt = '';
+ my $langs = Vhffs::Intl::get_languages( $panel->{vhffs} );
+ foreach my $l ( @{$langs} )
{
- $txt .= "<a href=\"auth.pl?lang=".$l."\"><img src=\"/themes/".get_theme( $main )."/images/".$l.".png\" alt=\"".$l."language\"/></a>";
+ $txt .= "<a href=\"auth.pl?lang=".$l."\"><img src=\"/themes/".$panel->{theme}."/images/".$l.".png\" alt=\"".$l."language\"/></a>";
}
return $txt;
}
-sub cookie_lang
-{
- my $vhffs;
- my $cgi;
- my $cookie;
- my $lang;
-
- $vhffs = shift;
- $cgi = shift;
-
- $lang = $cgi->param( "lang" ) if ( defined $cgi );
- $cookie = CGI->cookie( -name=>"language", -value=>$lang, -expires=>'+10y' ) if ( defined $lang );
- $lang = CGI->cookie( "language" ) if ( ! defined $lang );
- $lang = $vhffs->get_config->get_default_language() if ( ! defined $lang );
- $lang = "en_US" if ( ! defined $lang );
-
- setlocale(LC_ALL, $lang );
- bindtextdomain("vhffs", $vhffs->get_config->get_intldir);
- textdomain("vhffs");
-
- return ( $lang, $cookie );
-}
-
-
sub get_lang
{
- my $vhffs = shift;
- my ( $lang, $cookie ) = cookie_lang( $vhffs );
- return $lang;
+ return CGI->cookie( 'language' );
}
sub new
{
- my $class = ref($_[0]) || $_[0];
- my $bad_news;
- my $session;
- my $user;
- my $username;
- my $uid;
- my ( $lang, $langcookie );
- my ( $theme, $themecookie );
+ my $class = ref($_[0]) || $_[0];
+ my $this = {};
+ $this->{errors} = [];
+ $this->{infos} = [];
+ $this->{cookies} = [];
+ bless( $this, $class );
my $cgi = new CGI;
+ $this->{cgi} = $cgi;
+
my $vhffs = init Vhffs::Main;
- if ( ! defined $vhffs ) {
- print CGI->header( -type=>"text/html", -charset=>"utf-8" ), "Unable to open database connection\n";
+ $this->{vhffs} = $vhffs;
+ unless( defined $vhffs ) {
+ print CGI->header( -type=>'text/html', -charset=>'utf-8' ), 'Unable to open database connection\n';
exit 1;
}
- ( $lang, $langcookie ) = cookie_lang( $vhffs , $cgi );
- ( $theme, $themecookie ) = cookie_theme( $vhffs , $cgi );
-
- Vhffs::Panel::Main::check( $vhffs );
-
my $config = $vhffs->get_config;
- my $templatedir = $vhffs->get_config->get_templatedir;
-
- # We need to create an object now in order
- # to be able to call display if something
- # fails
- my $this = {};
- $this->{vhffs} = $vhffs;
- $this->{templatedir} = $templatedir;
- $this->{cgi} = $cgi;
$this->{config} = $config;
+ my $templatedir = $config->get_templatedir;
+ $this->{templatedir} = $templatedir;
+
+ # lang cookie
+ my $lang = $cgi->param('lang');
+ $this->add_cookie( CGI->cookie( -name=>'language', -value=>$lang, -expires=>'+10y' ) ) if defined $lang;
+ $lang = CGI->cookie('language') unless defined $lang;
+ $lang = $vhffs->get_config->get_default_language() unless defined $lang;
+ $lang = 'en_US' unless defined $lang;
$this->{lang} = $lang;
- $this->{langcookie} = $langcookie;
+
+ setlocale(LC_ALL, $lang);
+ bindtextdomain('vhffs', $config->get_intldir);
+ textdomain('vhffs');
+
+ # theme cookie
+ my $theme = $cgi->param('theme');
+ $this->add_cookie( CGI->cookie( -name=>'theme', -value=>$theme, -expires=>'+10y' ) ) if defined $theme;
+ $theme = CGI->cookie('theme') unless defined $theme;
+ $theme = $config->get_panel->{'default_theme'} unless defined $theme;
+ $theme = 'vhffs' unless( defined $theme && -f $config->get_panel->{'themesdir'}.'/'.$theme.'/main.css' );
$this->{theme} = $theme;
- $this->{themecookie} = $themecookie;
- $this->{errors} = [];
- $this->{infos} = [];
- bless($this, $class);
+ my $template = new HTML::Template( filename => $templatedir.'/panel/main/main.tmpl' );
+ $this->{template} = $template;
- # fetch the cookie which contain the sessions ID and the session
- my $sid = $cgi->cookie(CGI::Session::name());
- if( ! defined $sid ) {
- $bad_news = gettext("No cookie found, please accept the cookie and then please login again !");
- } else {
- $session = new CGI::Session(undef, $sid, {Directory=>'/tmp'});
- $username = $session->param("username");
- $uid = $session->param("uid");
+ if( $vhffs->is_valid() == 0 )
+ {
+ my $template = new HTML::Template( filename => $templatedir.'/panel/main/close.tmpl' );
+ $template->param( TEXT_CLOSE => gettext("Platform temporary closed<br/>database error") );
+ $template->param( TEXT_EXPLAIN => gettext("This platform is temporary closed. Administrators are performing some maintenances tasks or system has database errors. Please come back in a few minutes to log in.") );
+
+ $this->light( $template );
+ $this->display;
+ exit 0;
+ }
- if(!$username || !$uid || $session->is_new()) {
- $bad_news = gettext("Expired session ! Please login again");
- $session->delete();
- } elsif( ! defined($user = Vhffs::User::get_by_uid($vhffs, $uid)) ) {
- $bad_news = gettext("User does not exist");
- } elsif( $user->get_status != Vhffs::Constants::ACTIVATED ) {
- $bad_news = gettext("You're are not allowed to browse panel");
- }
+ if( $vhffs->get_config->get_panel->{'open'} ne 'yes' )
+ {
+ $template = new HTML::Template( filename => $templatedir.'/panel/main/close.tmpl' );
+ $template->param( TEXT_CLOSE => gettext("Platform temporary closed.") );
+ $template->param( TEXT_EXPLAIN => gettext("This platform is temporary closed. Administrators are performing some maintenances tasks. Please come back in a few minutes to log in.") );
+
+ $this->light( $template );
+ $this->display;
+ exit 0;
}
- if( defined $bad_news ) {
- $this->add_error($bad_news);
- Vhffs::Panel::Commons::display_login($vhffs, $this);
- exit(0);
+ return $this;
+}
+
+
+
+sub get_session
+{
+ my $panel = shift;
+ my $vhffs = $panel->{vhffs};
+ my $cgi = $panel->{cgi};
+
+ my $sid = $cgi->cookie( CGI::Session::name() );
+ unless( defined $sid ) {
+ $panel->add_error( gettext('No cookie found, please accept the cookie and then please login again !') );
+ Vhffs::Panel::Commons::display_login( $vhffs, $panel );
+ exit 0;
}
+ my $session = new CGI::Session( undef, $sid, {Directory=>'/tmp'} );
+ unless( defined $session ) {
+ $panel->add_error( gettext('Cannot create or fetch session file, please check that /tmp is readable and writeable') );
+ Vhffs::Panel::Commons::display_login( $vhffs, $panel );
+ exit 0;
+ }
- my $projectname = $cgi->param("project");
- $session->param("project", $projectname) if( defined $projectname );
+ my $username = $session->param('username');
+ my $uid = $session->param('uid');
+ unless( defined $username && defined $uid && !$session->is_new() ) {
+ $panel->add_error( gettext('Expired session ! Please login again') );
+ $session->delete();
+ Vhffs::Panel::Commons::display_login( $vhffs, $panel );
+ exit 0;
+ }
- my $group;
- $projectname = $session->param("project");
- if( defined $projectname ) {
- $group = Vhffs::Group::get_by_groupname($vhffs, $projectname);
- if( (! defined($group)) || $group->get_status != Vhffs::Constants::ACTIVATED || $group->is_user_in_group( $user ) != 1 )
- {
- $session->param("project", NULL);
- undef $group;
- }
+ my $user = Vhffs::User::get_by_uid($vhffs, $uid);
+ unless ( defined $user ) {
+ $panel->add_error( gettext('User does not exist') );
+ $session->delete();
+ Vhffs::Panel::Commons::display_login( $vhffs, $panel );
+ exit 0;
}
+ unless( $user->get_status == Vhffs::Constants::ACTIVATED ) {
+ $panel->add_error( gettext('You\'re are not allowed to browse panel') );
+ $session->delete();
+ Vhffs::Panel::Commons::display_login( $vhffs, $panel );
+ exit 0;
+ }
- my $maintemplate = new HTML::Template( filename => $templatedir."/panel/main/panel.tmpl" );
+ $panel->{session} = $session;
+ $panel->{user} = $user;
- $this->{session} = $session;
- $this->{template} = $maintemplate;
- $this->{user} = $user;
- if( defined $group ) {
- $this->{'group'} = $group;
- $this->{'groupname'} = $projectname;
+ my $groupname = $cgi->param('project');
+ $session->param('project', $groupname) if( defined $groupname );
+
+ $groupname = $session->param('project');
+ if( defined $groupname ) {
+ my $group = Vhffs::Group::get_by_groupname( $vhffs, $groupname );
+ if( defined $group && $group->get_status == Vhffs::Constants::ACTIVATED && $group->is_user_in_group( $user ) ) {
+ $panel->{'group'} = $group;
+ $panel->{'groupname'} = $groupname;
+ }
+ else {
+ $session->param('project', NULL);
+ }
}
- return $this;
+ return $session;
}
+
=head2 generate_header
print $panel->generate_header;
@@ -473,12 +430,12 @@
=cut
sub generate_header {
- my $self = shift;
- my $user = $self->{user};
- my $theme = $self->{theme};
- my $templatedir = $self->{templatedir};
- my $groupname = $self->{groupname};
- my $vhffs = $self->{vhffs};
+ my $panel = shift;
+ my $user = $panel->{user};
+ my $theme = $panel->{theme};
+ my $templatedir = $panel->{templatedir};
+ my $groupname = $panel->{groupname};
+ my $vhffs = $panel->{vhffs};
my $menutemplate = new HTML::Template( filename => $templatedir.'/panel/menu/main.tmpl' );
$menutemplate->param( THEME => $theme );
@@ -520,32 +477,38 @@
sub has_errors
{
- my $self = shift;
- return (@{$self->{errors}} > 0);
+ my $panel = shift;
+ return (@{$panel->{errors}} > 0);
}
sub set_title
{
- my ($self, $title) = @_;
- $self->{template}->param( TEXT_TITLE => $title );
+ my ($panel, $title) = @_;
+ $panel->{title} = $title;
}
sub add_error
{
- my ($self, $error) = @_;
- push(@{$self->{errors}}, {msg => $error});
+ my ($panel, $error) = @_;
+ push(@{$panel->{errors}}, {msg => $error});
}
sub add_info
{
- my ($self, $info) = @_;
- push(@{$self->{infos}}, {msg => $info});
+ my ($panel, $info) = @_;
+ push(@{$panel->{infos}}, {msg => $info});
}
+sub add_cookie
+{
+ my ($panel, $cookie) = @_;
+ push(@{$panel->{cookies}}, $cookie);
+}
+
sub clear_infos
{
- my $self = shift;
- $self->{infos} = [];
+ my $panel = shift;
+ $panel->{infos} = [];
}
sub welcome
@@ -566,10 +529,10 @@
sub project_info
{
- my $self = shift;
+ my $panel = shift;
- my $vhffs = $self->{vhffs};
- my $group = $self->{group};
+ my $vhffs = $panel->{vhffs};
+ my $group = $panel->{group};
my $temp;
my $object;
my $objects;
@@ -584,8 +547,8 @@
$template->param( MESSAGE => gettext("Group error" ) );
} else {
$template = new HTML::Template( filename => $templatedir."/panel/group/info.tmpl" );
- $self->set_title( sprintf( gettext("Group %s") , $group->get_groupname ) );
- $template->param( THEME => $self->{theme} );
+ $panel->set_title( sprintf( gettext("Group %s") , $group->get_groupname ) );
+ $template->param( THEME => $panel->{theme} );
# Quota stuff
$template->param( QUOTA_TEXT => sprintf( gettext("Quota (used/total) : %s/%s") , $group->get_quota_used , $group->get_quota ) );
@@ -608,47 +571,47 @@
if($config->get_service_availability('web')) {
my $webs = Vhffs::Panel::Web::getall_per_group( $vhffs, $gid );
- $services_list .= $self->create_service_index('web', $webs);
+ $services_list .= $panel->create_service_index('web', $webs);
}
if($config->get_service_availability('mysql')) {
my $mysql = Vhffs::Panel::Mysql::getall_per_group( $vhffs, $gid );
- $services_list .= $self->create_service_index('mysql', $mysql);
+ $services_list .= $panel->create_service_index('mysql', $mysql);
}
if($config->get_service_availability('pgsql')) {
my $pg = Vhffs::Panel::Pgsql::getall_per_group( $vhffs, $gid );
- $services_list .= $self->create_service_index('pgsql', $pg);
+ $services_list .= $panel->create_service_index('pgsql', $pg);
}
if($config->get_service_availability('cvs')) {
my $cvs = Vhffs::Panel::Cvs::getall_per_group( $vhffs, $gid );
- $services_list .= $self->create_service_index('cvs', $cvs);
+ $services_list .= $panel->create_service_index('cvs', $cvs);
}
if($config->get_service_availability('svn')) {
my $svn = Vhffs::Panel::Svn::getall_per_group( $vhffs, $gid );
- $services_list .= $self->create_service_index('svn', $svn);
+ $services_list .= $panel->create_service_index('svn', $svn);
}
if($config->get_service_availability('mailinglist')) {
my $ml = Vhffs::Panel::MailingList::getall_per_group( $vhffs, $gid );
- $services_list .= $self->create_service_index('mailinglist', $ml);
+ $services_list .= $panel->create_service_index('mailinglist', $ml);
}
if($config->get_service_availability('mail')) {
my $mail = Vhffs::Panel::Mail::getall_per_group( $vhffs, $gid );
- $services_list .= $self->create_service_index('mail', $mail);
+ $services_list .= $panel->create_service_index('mail', $mail);
}
if($config->get_service_availability('repository')) {
my $repos = Vhffs::Panel::Repository::getall_per_group( $vhffs, $gid );
- $services_list .= $self->create_service_index('repository', $repos);
+ $services_list .= $panel->create_service_index('repository', $repos);
}
if($config->get_service_availability('dns')) {
my $dns = Vhffs::Panel::DNS::getall_per_group( $vhffs, $gid );
- $services_list .= $self->create_service_index('dns', $dns);
+ $services_list .= $panel->create_service_index('dns', $dns);
}
$template->param( SERVICES => $services_list );
}
@@ -660,167 +623,114 @@
{
my ( $class , $panel , $url , $time ) = @_;
- my $maintemplate = $panel->{'template'};
+ my $template = $panel->{'template'};
$time = 3 if( $time == 0 );
- $maintemplate->param( HEADERS_SUP => "<meta http-equiv=\"refresh\" content=\"$time; url=$url\">" );
+ $template->param( HEADERS_SUP => "<meta http-equiv=\"refresh\" content=\"$time; url=$url\">" );
return;
}
-sub display
+sub build
{
- my ( $class , $panel , $content, $cookie ) = @_;
+ my $panel = shift;
+ my $template = shift;
+ my $cgi = $panel->{cgi};
+ my $theme = $panel->{theme};
+ my $templatedir = $panel->{templatedir};
- # WTF !?!?
- if( ref( $class ) )
- {
- $cookie = $content;
- $content = $panel;
- $panel = $class;
- }
+ my $content = $template->output;
- my $maintemplate = $panel->{'template'};
- my $cgi = $panel->{cgi};
- my $theme = $panel->{theme};
- my $config = $panel->{config};
+ $panel->add_info( $cgi->param('msg') ) if(defined $cgi->param('msg'));
- $maintemplate->param( PANEL_TITLE => sprintf( gettext( "%s's Panel" ), $config->get_host_name ) );
- $maintemplate->param( THEME => $theme );
+ $template = new HTML::Template( filename => $templatedir.'/panel/main/panel.tmpl' );
+ $template->param( THEME => $theme );
+ $template->param( TITLE => $panel->{title} );
+ $template->param( HEADER => $panel->generate_header );
- # Allows each theme to have its own Jscripts
+ if( @{$panel->{errors}} > 0 ) {
+ my $tmplerrors = new HTML::Template( filename => $templatedir.'/panel/misc/errors.tmpl' );
+ $tmplerrors->param( ERRORS => $panel->{errors} );
+ $template->param( ERRORS => $tmplerrors->output );
+ }
- my $jsglob = File::Spec->catfile($config->get_panel->{'themesdir'}, $theme, '/js/*.js');
- my $jswebpath = "/themes/$theme/js/";
- my @jscripts;
- # Common scripts
- push @jscripts, {SCRIPT => '/js/prototype.js'};
- push @jscripts, {SCRIPT => '/js/commons.js'};
- push @jscripts, {SCRIPT => '/js/tooltip.js'};
- while(glob($jsglob)) {
- use File::Basename;
- push @jscripts, {SCRIPT => $jswebpath.basename( $_ )};
- }
- $maintemplate->param( JSCRIPTS => \@jscripts );
- $maintemplate->param( TEXT_HELP => gettext('Help') );
- $maintemplate->param( TEXT_HELP_CONTENT => gettext('Stay over an icon to see its description.') );
- $panel->add_info( $cgi->param('msg') ) if(defined $cgi->param('msg'));
- $maintemplate->param( HEADER => $panel->generate_header );
+ if( @{$panel->{infos}} > 0 ) {
+ my $tmplinfos = new HTML::Template( filename => $templatedir.'/panel/misc/infos.tmpl' );
+ $tmplinfos->param( INFOS => $panel->{infos} );
+ $template->param( INFOS => $tmplinfos->output );
+ }
+ $template->param( TEXT_HELP => gettext('Help') );
+ $template->param( TEXT_HELP_CONTENT => gettext('Stay over an icon to see its description.') );
- $maintemplate->param( CENTRE => $content );
- if(@{$panel->{errors}} > 0) {
- my $tmplerrors = new HTML::Template( filename => $panel->{templatedir}.'/panel/misc/errors.tmpl' );
- $tmplerrors->param( ERRORS => $panel->{errors} );
- $maintemplate->param( ERRORS => $tmplerrors->output );
- }
+ $template->param( CONTENT => $content);
- if(@{$panel->{infos}} > 0) {
- my $tmplinfos = new HTML::Template( filename => $panel->{templatedir}.'/panel/misc/infos.tmpl' );
- $tmplinfos->param( INFOS => $panel->{infos} );
- $maintemplate->param( INFOS => $tmplinfos->output );
- }
-
- my $langcookie = "";
- $langcookie = $panel->{'langcookie'} if ( defined $panel->{'langcookie'} );
- my $themecookie = "";
- $themecookie = $panel->{'themecookie'} if ( defined $panel->{'themecookie'} );
- $cookie = "" if ( ! defined $cookie );
-
- print CGI->header( -cookie=>[$langcookie,$themecookie,$cookie], -type=>"text/html", -charset=>"utf-8" );
-
- print $maintemplate->output;
+ $panel->{content} = $template->output;
return;
}
-sub new_light
+sub light
{
- my $class = ref($_[0]) || $_[0];
- my $cgi = new CGI;
- my $vhffs = init Vhffs::Main;
- if ( ! defined $vhffs ) {
- print CGI->header( -type=>"text/html", -charset=>"utf-8" ), "Unable to open database connection\n";
- exit 1;
- }
+ my $panel = shift;
+ my $template = shift;
+ my $cgi = $panel->{cgi};
+ my $theme = $panel->{theme};
+ my $templatedir = $panel->{templatedir};
- my $config = $vhffs->get_config;
- my $templatedir = $vhffs->get_config->get_templatedir;
- my ( $lang, $langcookie ) = cookie_lang( $vhffs , $cgi );
- my ( $theme, $themecookie ) = cookie_theme( $vhffs , $cgi );
+ $panel->add_info( $cgi->param('msg') ) if(defined $cgi->param('msg'));
- Vhffs::Panel::Main::check( $vhffs );
+ $template->param( THEME => $theme ) if( ($template->query(name => 'THEME') || '') eq 'VAR' );
- my $this = {};
- $this->{vhffs} = $vhffs;
- $this->{templatedir} = $templatedir;
- $this->{cgi} = $cgi;
- $this->{config} = $config;
- $this->{lang} = $lang;
- $this->{langcookie} = $langcookie;
- $this->{theme} = $theme;
- $this->{themecookie} = $themecookie;
- $this->{errors} = [];
- $this->{infos} = [];
- bless($this, $class);
+ if( @{$panel->{errors}} > 0 ) {
+ my $tmplerrors = new HTML::Template( filename => $templatedir.'/panel/misc/errors.tmpl' );
+ $tmplerrors->param( ERRORS => $panel->{errors} );
+ $template->param( ERRORS => $tmplerrors->output );
+ }
- return $this;
+ if( @{$panel->{infos}} > 0 ) {
+ my $tmplinfos = new HTML::Template( filename => $templatedir.'/panel/misc/infos.tmpl' );
+ $tmplinfos->param( INFOS => $panel->{infos} );
+ $template->param( INFOS => $tmplinfos->output );
+ }
+
+ $panel->{content} = $template->output;
+ return;
}
-sub display_light
+sub display
{
- my ( $class, $panel, $template, $cookie ) = @_;
+ my $panel = shift;
+ my $template = $panel->{'template'};
+ my $cgi = $panel->{cgi};
+ my $theme = $panel->{theme};
+ my $config = $panel->{config};
- #FIXME temporary hack
- if(ref($class)) {
- $cookie = $template;
- $template = $panel;
- $panel = $class;
- }
-
- my $langcookie = "";
- $langcookie = $panel->{'langcookie'} if ( defined $panel->{'langcookie'} );
- my $themecookie = "";
- $themecookie = $panel->{'themecookie'} if ( defined $panel->{'themecookie'} );
- $cookie = "" if ( ! defined $cookie );
-
- print CGI->header( -cookie=>[$langcookie,$themecookie,$cookie], -type=>"text/html", -charset=>"utf-8" );
-
- my $theme = get_theme( $panel->{'vhffs'} );
+ $template->param( TITLE => sprintf( gettext( '%s\'s Panel' ), $config->get_host_name ) );
$template->param( THEME => $theme );
- # Allows each theme to have its own Jscripts
+ # Allow each theme to have its own Jscripts
+ my $jsglob = File::Spec->catfile($config->get_panel->{'themesdir'}, $theme, '/js/*.js');
+ my $jswebpath = '/themes/'.$theme.'/js/';
+ my @jscripts;
+ # Common scripts
+ push @jscripts, {SCRIPT => '/js/prototype.js'};
+ push @jscripts, {SCRIPT => '/js/commons.js'};
+ push @jscripts, {SCRIPT => '/js/tooltip.js'};
+ while( glob($jsglob) ) {
+ use File::Basename;
+ push @jscripts, {SCRIPT => $jswebpath.basename( $_ )};
+ }
+ $template->param( JSCRIPTS => \@jscripts );
- my $jsglob = File::Spec->catfile($panel->{config}->get_panel->{'themesdir'}, $theme, '/js/*.js');
- my $jswebpath = "/themes/$theme/js/";
- my @jscripts;
- # Common scripts
- push @jscripts, {SCRIPT => '/js/prototype.js'};
- push @jscripts, {SCRIPT => '/js/commons.js'};
- push @jscripts, {SCRIPT => '/js/tooltip.js'};
- while(glob($jsglob)) {
- use File::Basename;
- push @jscripts, {SCRIPT => $jswebpath.basename( $_ )};
- }
- $template->param( JSCRIPTS => \@jscripts );
+ $template->param( CONTENT => $panel->{content} );
-
- if(@{$panel->{errors}} > 0) {
- my $tmplerrors = new HTML::Template( filename => $panel->{templatedir}."/panel/misc/errors.tmpl" );
- $tmplerrors->param( ERRORS => $panel->{errors} );
- $template->param( ERRORS => $tmplerrors->output );
- }
-
- if(@{$panel->{infos}} > 0) {
- my $tmplinfos = new HTML::Template( filename => $panel->{templatedir}.'/panel/misc/infos.tmpl' );
- $tmplinfos->param( INFOS => $panel->{infos} );
- $template->param( INFOS => $tmplinfos->output );
- }
-
- print $template->output;
- return;
+ print CGI->header( -cookie=>[ @{$panel->{cookies}} ], -type=>'text/html', -charset=>'utf-8' );
+ print $template->output;
+ return;
}
+
=pod
=head2 redirect
@@ -839,7 +749,7 @@
=cut
sub redirect {
- my ($self, $dest, $cookies) = @_;
+ my ($panel, $dest, $cookies) = @_;
if(defined $cookies) {
if(ref($cookies)) {
foreach(@$cookies) {
@@ -866,7 +776,7 @@
=cut
sub create_service_index($$$) {
- my ($self, $service, $services) = @_;
+ my ($panel, $service, $services) = @_;
my %service_labels = (
cvs => 'CVS repositories',
dns => 'Domain names',
@@ -879,9 +789,9 @@
web => 'Webareas',
);
- my $vhffs = $self->{vhffs};
- my $group = $self->{group};
- my $templatedir = $self->{templatedir};
+ my $vhffs = $panel->{vhffs};
+ my $group = $panel->{group};
+ my $templatedir = $panel->{templatedir};
my $svclabel = $service_labels{$service};
my $template = new HTML::Template( filename => $templatedir.'/panel/misc/service_index.tmpl', global_vars => 1 );
Modified: trunk/vhffs-panel/ajax/help.pl
===================================================================
--- trunk/vhffs-panel/ajax/help.pl 2007-09-04 17:34:02 UTC (rev 864)
+++ trunk/vhffs-panel/ajax/help.pl 2007-09-06 03:41:55 UTC (rev 865)
@@ -41,13 +41,13 @@
my $vhffs = init Vhffs::Main;
my $topic = $cgi->param('topic');
-print CGI->header( -type=>"text/html", -charset=>"utf-8" );
+print CGI->header( -type=>'text/html', -charset=>'utf-8' );
if(!$vhffs) {
print gettext('Database error');
exit(1);
}
-my ( $lang, $langcookie ) = Vhffs::Panel::Main::cookie_lang( $vhffs , $cgi );
+my $lang = Vhffs::Panel::Main::get_lang;
my $msg;
if(! defined $topic ) {
Modified: trunk/vhffs-panel/auth.pl
===================================================================
--- trunk/vhffs-panel/auth.pl 2007-09-04 17:34:02 UTC (rev 864)
+++ trunk/vhffs-panel/auth.pl 2007-09-06 03:41:55 UTC (rev 865)
@@ -43,7 +43,7 @@
use Vhffs::Panel::Commons;
use Vhffs::Constants;
-my $panel = new_light Vhffs::Panel::Main();
+my $panel = new Vhffs::Panel::Main();
my $vhffs = $panel->{'vhffs'};
my $templatedir = $panel->{'templatedir'};
my $cgi = $panel->{cgi};
Modified: trunk/vhffs-panel/lost.pl
===================================================================
--- trunk/vhffs-panel/lost.pl 2007-09-04 17:34:02 UTC (rev 864)
+++ trunk/vhffs-panel/lost.pl 2007-09-06 03:41:55 UTC (rev 865)
@@ -41,18 +41,19 @@
use Vhffs::Panel::Main;
-my $panel = new_light Vhffs::Panel::Main();
+my $panel = new Vhffs::Panel::Main();
my $vhffs = $panel->{'vhffs'};
my $templatedir = $panel->{'templatedir'};
my $cgi = $panel->{'cgi'};
-my $tmpl = new HTML::Template( filename => $templatedir."/panel/main/lost.tmpl", associate => $cgi );
+my $template = new HTML::Template( filename => $templatedir.'/panel/main/lost.tmpl', associate => $cgi );
-#$tmpl->param( TITLE => gettext("VHFFS Password Lost") );
-$tmpl->param( TEXT_LOSTPASS => gettext("You lost your password? You're a bad guy!") );
-$tmpl->param( TEXT_BLABLA => gettext("But fortunately we're smart, so just type your login here<br/>and a new password will be sent to you by email!") );
-$tmpl->param( TEXT_USERNAME => gettext("Username") );
-$tmpl->param( TEXT_BUTTON => gettext("Give me a new password") );
-$tmpl->param( TEXT_BACK => gettext("Back to login page") );
+#$template->param( TITLE => gettext('VHFFS Password Lost') );
+$template->param( TEXT_LOSTPASS => gettext('You lost your password? You\'re a bad guy!') );
+$template->param( TEXT_BLABLA => gettext('But fortunately we\'re smart, so just type your login here<br/>and a new password will be sent to you by email!') );
+$template->param( TEXT_USERNAME => gettext('Username') );
+$template->param( TEXT_BUTTON => gettext('Give me a new password') );
+$template->param( TEXT_BACK => gettext('Back to login page') );
-display_light Vhffs::Panel::Main( $panel , $tmpl );
+$panel->light( $template );
+$panel->display;
Modified: trunk/vhffs-panel/lost_ack.pl
===================================================================
--- trunk/vhffs-panel/lost_ack.pl 2007-09-04 17:34:02 UTC (rev 864)
+++ trunk/vhffs-panel/lost_ack.pl 2007-09-06 03:41:55 UTC (rev 865)
@@ -44,14 +44,11 @@
use Vhffs::Panel::Main;
use Vhffs::Services::MailUser;
-my $panel = new_light Vhffs::Panel::Main();
+my $panel = new Vhffs::Panel::Main();
my $vhffs = $panel->{'vhffs'};
my $templatedir = $panel->{'templatedir'};
-
-
-# recuperation des donnees des champs du form de login
my $cgi = $panel->{'cgi'};
-my $username = $cgi->param("username");
+my $username = $cgi->param('username');
my $user = Vhffs::User::get_by_username( $vhffs, $username );
my $template;
@@ -71,20 +68,18 @@
$template = new HTML::Template( filename => $templatedir."/panel/main/lost_ok.tmpl" );
- $template->param( TITLE => gettext("VHFFS Password Lost OK") );
$template->param( TEXT_WAITPASS => sprintf( gettext("Please wait %s, a new password will be sent to you in a few minutes..."), $username ) );
$template->param( TEXT_LOGIN => gettext("Login") );
-
- display_light Vhffs::Panel::Main( $panel , $template );
}
else
{
#if user is not know by VHFFS, we return an error
$template = new HTML::Template( filename => $templatedir."/panel/main/lost_failed.tmpl" );
- $template->param( TITLE => gettext("VHFFS Password Lost failed") );
$template->param( TEXT_FAILED => gettext("Password recovery failed!") );
$template->param( TEXT_LOGIN => gettext("Login") );
-
- display_light Vhffs::Panel::Main( $panel , $template );
}
+
+
+$panel->light( $template );
+$panel->display;
Modified: trunk/vhffs-panel/panel.pl
===================================================================
--- trunk/vhffs-panel/panel.pl 2007-09-04 17:34:02 UTC (rev 864)
+++ trunk/vhffs-panel/panel.pl 2007-09-06 03:41:55 UTC (rev 865)
@@ -45,20 +45,18 @@
use Vhffs::Panel::Menu;
my $panel = new Vhffs::Panel::Main();
-if(!$panel) {
- exit 0;
-}
+exit 0 unless defined $panel;
+my $session = $panel->get_session;
my $vhffs = $panel->{'vhffs'};
-my $session = $panel->{'session'};
my $maintemplate = $panel->{'template'};
my $user = $panel->{'user'};
my $cgi = $panel->{'cgi'};
+my $groupname = $panel->{'groupname'};
my $su_user = $cgi->param('su_user');
my $message;
my $template;
-my $projectname = $cgi->param("project");
my $templatedir = $vhffs->get_config->get_templatedir;
#We try to know if an admin want to su
@@ -69,7 +67,6 @@
my $user_bis = Vhffs::User::get_by_username( $vhffs , $su_user );
if( defined( $user_bis ) )
{
- $user = undef;
$user = $user_bis;
$session->clear("username");
$session->clear("uid");
@@ -99,7 +96,7 @@
}
else
{
- if( defined $projectname )
+ if( defined $groupname )
{
$template = $panel->project_info;
}
@@ -109,4 +106,5 @@
}
}
-display Vhffs::Panel::Main($panel, $template->output);
+$panel->build( $template );
+$panel->display;
Modified: trunk/vhffs-panel/subscribe.pl
===================================================================
--- trunk/vhffs-panel/subscribe.pl 2007-09-04 17:34:02 UTC (rev 864)
+++ trunk/vhffs-panel/subscribe.pl 2007-09-06 03:41:55 UTC (rev 865)
@@ -52,13 +52,13 @@
use Vhffs::Constants;
use Vhffs::Panel::Main;
-my $panel = new_light Vhffs::Panel::Main();
+my $panel = new Vhffs::Panel::Main();
my $vhffs = $panel->{'vhffs'};
my $templatedir = $panel->{'templatedir'};
my $cgi = $panel->{'cgi'};
my $uid;
-my $submitted = $cgi->param( "CREATE_SUBMIT" );
+my $submitted = $cgi->param( 'CREATE_SUBMIT' );
my $mail;
my $username;
my $firstname;
@@ -223,7 +223,6 @@
$template->param( ADDRESS_TEXT => gettext("Address") );
$template->param( SEND => gettext("Subscribe") );
$template->param( BACK => gettext("Back to Login") );
- $template->param( HOME_TEXT => gettext('Home') );
my $md5 = $captcha->generate_code( 6 );
@@ -236,6 +235,6 @@
$template->param( USERNAME_TIP_TEXT => gettext('Your username. It must contains only alphanumeric characters in lowercase, its length must be between 3 and 12 chars') );
$template->param( EMAIL_TIP_TEXT => gettext('Your email address. It will be used to contact you when needed and as a destination address if you use our email forwarding service') );
}
-$template->param( TITLE => gettext("Subscribe") );
-display_light Vhffs::Panel::Main( $panel , $template );
+$panel->light( $template );
+$panel->display;
Modified: trunk/vhffs-panel/templates/Makefile.am
===================================================================
--- trunk/vhffs-panel/templates/Makefile.am 2007-09-04 17:34:02 UTC (rev 864)
+++ trunk/vhffs-panel/templates/Makefile.am 2007-09-06 03:41:55 UTC (rev 865)
@@ -114,6 +114,7 @@
main/lost_ok.tmpl \
main/lost.tmpl \
main/panel.tmpl \
+ main/main.tmpl \
menu/main.tmpl \
menu/user.tmpl \
misc/alert.tmpl \
Modified: trunk/vhffs-panel/templates/main/auth.tmpl
===================================================================
--- trunk/vhffs-panel/templates/main/auth.tmpl 2007-09-04 17:34:02 UTC (rev 864)
+++ trunk/vhffs-panel/templates/main/auth.tmpl 2007-09-06 03:41:55 UTC (rev 865)
@@ -1,18 +1,3 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
- <head>
-
- <title><tmpl_var name="TITLE"></title>
-
- <link rel="stylesheet" type="text/css" href="/themes/<tmpl_var name="THEME">/main.css" />
- <meta http-equiv="Pragma" content="no-cache" />
- <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
- <tmpl_var name="HEADERS_SUP">
- <tmpl_loop name="JSCRIPTS">
- <script language="javascript" type="text/javascript" charset="utf-8" src="<tmpl_var name="SCRIPT">"></script>
- </tmpl_loop>
- </head>
- <body>
<div id="chooselang">
<tmpl_var name="LANGS">
</div>
@@ -74,5 +59,3 @@
<div id="footer">
<a href="http://www.vhffs.org"><tmpl_var name="VHFFS_INFO"></a>
</div>
- </body>
-</html>
Modified: trunk/vhffs-panel/templates/main/close.tmpl
===================================================================
--- trunk/vhffs-panel/templates/main/close.tmpl 2007-09-04 17:34:02 UTC (rev 864)
+++ trunk/vhffs-panel/templates/main/close.tmpl 2007-09-06 03:41:55 UTC (rev 865)
@@ -1,18 +1,3 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
- <head>
-
- <title><tmpl_var name="TITLE"></title>
-
- <link rel="stylesheet" type="text/css" href="/themes/<tmpl_var name="THEME">/main.css" />
- <meta http-equiv="Pragma" content="no-cache" />
- <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
- <tmpl_var name="HEADERS_SUP">
- <tmpl_loop name="JSCRIPTS">
- <script language="javascript" type="text/javascript" charset="utf-8" src="<tmpl_var name="SCRIPT">"></script>
- </tmpl_loop>
- </head>
- <body>
<div id="chooselang">
<tmpl_var name="LANGS">
</div>
@@ -29,7 +14,3 @@
<tmpl_var name="TEXT_EXPLAIN">
</div>
-
-
- </body>
-</html>
Modified: trunk/vhffs-panel/templates/main/lost.tmpl
===================================================================
--- trunk/vhffs-panel/templates/main/lost.tmpl 2007-09-04 17:34:02 UTC (rev 864)
+++ trunk/vhffs-panel/templates/main/lost.tmpl 2007-09-06 03:41:55 UTC (rev 865)
@@ -1,44 +1,25 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
- <head>
+<div class="logo">
+</div>
- <title><tmpl_var name="TITLE"></title>
-
- <link rel="stylesheet" type="text/css" href="/themes/<tmpl_var name="THEME">/main.css" />
- <meta http-equiv="Pragma" content="no-cache" />
- <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
- <tmpl_var name="HEADERS_SUP">
- <tmpl_loop name="JSCRIPTS">
- <script language="javascript" type="text/javascript" charset="utf-8" src="<tmpl_var name="SCRIPT">"></script>
- </tmpl_loop>
- </head>
- <body>
-
- <div class="logo">
- </div>
+<div class="misc" id="misc">
- <div class="misc" id="misc">
-
- <h1><tmpl_var name="TEXT_LOSTPASS"></h1>
-
-
- <form action="/lost_ack.pl" method="post">
- <h2><tmpl_var name="TEXT_BLABLA"></h2>
- <p>
- <label for="username">
- <tmpl_var name="TEXT_USERNAME">
- </label>
- <input type="text" name="username" id="username" maxlength="32"/>
- </p>
- <p class="button">
- <input type="submit" value="<tmpl_var name="TEXT_BUTTON">" />
- </p>
- </form>
+<h1><tmpl_var name="TEXT_LOSTPASS"></h1>
- <p>
- <a href="/auth.pl"><TMPL_VAR NAME="TEXT_BACK"></a>
- </p>
+<form action="/lost_ack.pl" method="post">
+<h2><tmpl_var name="TEXT_BLABLA"></h2>
+<p>
+ <label for="username">
+ <tmpl_var name="TEXT_USERNAME">
+ </label>
+ <input type="text" name="username" id="username" maxlength="32"/>
+</p>
+<p class="button">
+ <input type="submit" value="<tmpl_var name="TEXT_BUTTON">" />
+</p>
+</form>
- </div>
- </body>
-</html>
+<p>
+ <a href="/auth.pl"><TMPL_VAR NAME="TEXT_BACK"></a>
+</p>
+
+</div>
Modified: trunk/vhffs-panel/templates/main/lost_failed.tmpl
===================================================================
--- trunk/vhffs-panel/templates/main/lost_failed.tmpl 2007-09-04 17:34:02 UTC (rev 864)
+++ trunk/vhffs-panel/templates/main/lost_failed.tmpl 2007-09-06 03:41:55 UTC (rev 865)
@@ -1,27 +1,5 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
- <head>
-
- <title><tmpl_var name="TITLE"></title>
-
- <link rel="stylesheet" type="text/css" href="/themes/<tmpl_var name="THEME">/main.css" />
- <meta http-equiv="Pragma" content="no-cache" />
- <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
- <meta http-equiv="refresh" content="3; url=/auth.pl">
- <tmpl_var name="HEADERS_SUP">
- <tmpl_loop name="JSCRIPTS">
- <script language="javascript" type="text/javascript" charset="utf-8" src="<tmpl_var name="SCRIPT">"></script>
- </tmpl_loop>
- </head>
-
- <body>
-
- <div class="logo"></div>
- <div class="misc" id="misc">
- <h1><tmpl_var name="TEXT_FAILED"></h1>
-
- <p class="button"><a href="/auth.pl"><tmpl_var name="TEXT_LOGIN"></a></p>
- </div>
-
- </body>
-</html>
+<div class="logo"></div>
+<div class="misc" id="misc">
+<h1><tmpl_var name="TEXT_FAILED"></h1>
+<p class="button"><a href="/auth.pl"><tmpl_var name="TEXT_LOGIN"></a></p>
+</div>
Modified: trunk/vhffs-panel/templates/main/lost_ok.tmpl
===================================================================
--- trunk/vhffs-panel/templates/main/lost_ok.tmpl 2007-09-04 17:34:02 UTC (rev 864)
+++ trunk/vhffs-panel/templates/main/lost_ok.tmpl 2007-09-06 03:41:55 UTC (rev 865)
@@ -1,26 +1,5 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
- <head>
-
- <title><tmpl_var name="TITLE"></title>
-
- <link rel="stylesheet" type="text/css" href="/themes/<tmpl_var name="THEME">/main.css" />
- <meta http-equiv="Pragma" content="no-cache" />
- <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
- <meta http-equiv="refresh" content="3; url=/auth.pl">
- <tmpl_var name="HEADERS_SUP">
- <tmpl_loop name="JSCRIPTS">
- <script language="javascript" type="text/javascript" charset="utf-8" src="<tmpl_var name="SCRIPT">"></script>
- </tmpl_loop>
- </head>
-
- <body>
-
- <div class="logo"></div>
- <div class="misc" id="misc">
- <h1><tmpl_var name="TEXT_WAITPASS"></h1>
-
- <p class="button"><a href="/auth.pl"><tmpl_var name="TEXT_LOGIN"></a></p>
- </div>
- </body>
-</html>
+<div class="logo"></div>
+<div class="misc" id="misc">
+<h1><tmpl_var name="TEXT_WAITPASS"></h1>
+<p class="button"><a href="/auth.pl"><tmpl_var name="TEXT_LOGIN"></a></p>
+</div>
Added: trunk/vhffs-panel/templates/main/main.tmpl
===================================================================
--- trunk/vhffs-panel/templates/main/main.tmpl (rev 0)
+++ trunk/vhffs-panel/templates/main/main.tmpl 2007-09-06 03:41:55 UTC (rev 865)
@@ -0,0 +1,16 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+ <title><tmpl_var name="TITLE"></title>
+ <link rel="stylesheet" type="text/css" href="/themes/<tmpl_var name="THEME">/main.css"/>
+ <meta http-equiv="Pragma" content="no-cache"/>
+ <meta http-equiv="Content-type" content="text/html; charset=utf-8"/>
+ <tmpl_var name="HEADERS_SUP">
+ <tmpl_loop name="JSCRIPTS">
+ <script language="javascript" type="text/javascript" charset="utf-8" src="<tmpl_var name="SCRIPT">"></script>
+ </tmpl_loop>
+</head>
+<body>
+<tmpl_var name="CONTENT">
+</body>
+</html>
Modified: trunk/vhffs-panel/templates/main/panel.tmpl
===================================================================
--- trunk/vhffs-panel/templates/main/panel.tmpl 2007-09-04 17:34:02 UTC (rev 864)
+++ trunk/vhffs-panel/templates/main/panel.tmpl 2007-09-06 03:41:55 UTC (rev 865)
@@ -1,18 +1,3 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
- <head>
-
- <title><tmpl_var name="PANEL_TITLE"></title>
- <link rel="stylesheet" type="text/css" href="/themes/<tmpl_var name="THEME">/main.css"/>
- <meta http-equiv="Pragma" content="no-cache"/>
- <meta http-equiv="Content-type" content="text/html; charset=utf-8"/>
- <tmpl_var name="HEADERS_SUP">
- <tmpl_loop name="JSCRIPTS">
- <script language="javascript" type="text/javascript" charset="utf-8" src="<tmpl_var name="SCRIPT">"></script>
- </tmpl_loop>
- </head>
- <body>
-
<!-- Header Part-->
<tmpl_var name="HEADER">
@@ -20,16 +5,14 @@
<!-- Page Content -->
<div class="main" id="main">
- <h1><tmpl_var name="TEXT_TITLE"></h1>
- <tmpl_var name="errors">
- <tmpl_var name="infos">
- <tmpl_var name="CENTRE">
+ <h1><tmpl_var name="TITLE"></h1>
+ <tmpl_var name="ERRORS">
+ <tmpl_var name="INFOS">
+ <tmpl_var name="CONTENT">
</div>
<div id="help">
- <h1><img src="/themes/<tmpl_var name="THEME">/images/help.png" alt="aide"/><tmpl_var name="TEXT_HELP"></h1>
- <div id="help_content">
- <p><tmpl_var name="TEXT_HELP_CONTENT"></p>
- </div>
+ <h1><img src="/themes/<tmpl_var name="THEME">/images/help.png" alt="help"/><tmpl_var name="TEXT_HELP"></h1>
+ <div id="help_content">
+ <p><tmpl_var name="TEXT_HELP_CONTENT"></p>
+ </div>
</div>
- </body>
-</html>
Modified: trunk/vhffs-panel/templates/misc/simplemsg.tmpl
===================================================================
--- trunk/vhffs-panel/templates/misc/simplemsg.tmpl 2007-09-04 17:34:02 UTC (rev 864)
+++ trunk/vhffs-panel/templates/misc/simplemsg.tmpl 2007-09-06 03:41:55 UTC (rev 865)
@@ -1,2 +1,2 @@
- <h1 class="message"><tmpl_var name="MESSAGE"></h1>
+<h1 class="message"><tmpl_var name="MESSAGE"></h1>
Modified: trunk/vhffs-panel/templates/user/create.tmpl
===================================================================
--- trunk/vhffs-panel/templates/user/create.tmpl 2007-09-04 17:34:02 UTC (rev 864)
+++ trunk/vhffs-panel/templates/user/create.tmpl 2007-09-06 03:41:55 UTC (rev 865)
@@ -1,21 +1,6 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
- <head>
-
- <title><tmpl_var name="TITLE"></title>
-
- <link rel="stylesheet" type="text/css" href="/themes/<tmpl_var name="THEME">/main.css" />
- <meta http-equiv="Pragma" content="no-cache" />
- <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
- <tmpl_var name="HEADERS_SUP">
- <tmpl_loop name="JSCRIPTS">
- <script language="javascript" type="text/javascript" charset="utf-8" src="<tmpl_var name="SCRIPT">"></script>
- </tmpl_loop>
- </head>
- <body class="subscribe">
-
- <a href="/" title="<tmpl_var name="HOME_TEXT">"><img src="/themes/<tmpl_var name="THEME">/images/logo.png" alt="VHFFS" id="logo"/></a>
-
+<div class="logo">
+</div>
+<div id="subscribe">
<div id="content">
<h1><tmpl_var name="TEXT_SUBSCRIBE"></h1>
<p class="info"><tmpl_var name="TEXT_INFOS"></p>
@@ -109,5 +94,4 @@
check('COUNTRY', validString);
check('ZIPCODE', validZip);
</script>
- </body>
-</html>
+</div>
Modified: trunk/vhffs-panel/templates/user/create_complete.tmpl
===================================================================
--- trunk/vhffs-panel/templates/user/create_complete.tmpl 2007-09-04 17:34:02 UTC (rev 864)
+++ trunk/vhffs-panel/templates/user/create_complete.tmpl 2007-09-06 03:41:55 UTC (rev 865)
@@ -1,31 +1,8 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
- <head>
- <title><tmpl_var name="TITLE"></title>
-
- <link rel="stylesheet" type="text/css" href="/themes/<tmpl_var name="THEME">/main.css" />
- <meta http-equiv="Pragma" content="no-cache" />
- <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
- <meta http-equiv="refresh" content="2; url=/auth.pl">
- <tmpl_var name="HEADERS_SUP">
- <tmpl_loop name="JSCRIPTS">
- <script language="javascript" type="text/javascript" charset="utf-8" src="<tmpl_var name="SCRIPT">"></script>
- </tmpl_loop>
- </head>
- <body>
-
-
- <div class="logo"></div>
-
- <div class="login">
- <h1><TMPL_VAR NAME="TITLE"></h1>
-
- <h2><TMPL_VAR NAME="GOOD_NEWS"></h2>
- <h2><TMPL_VAR NAME="GOOD_NEWS2"></h2>
- <h2 class="error"><TMPL_VAR NAME="BAD_NEWS"></h2>
-
- <p class="button"><a href="/auth.pl"><tmpl_var name="TEXT_BACK"></a></p>
- </div>
-
- </body>
-</html>
+<div class="logo"></div>
+<div class="login">
+<h1><TMPL_VAR NAME="TITLE"></h1>
+<h2><TMPL_VAR NAME="GOOD_NEWS"></h2>
+<h2><TMPL_VAR NAME="GOOD_NEWS2"></h2>
+<h2 class="error"><TMPL_VAR NAME="BAD_NEWS"></h2>
+<p class="button"><a href="/auth.pl"><tmpl_var name="TEXT_BACK"></a></p>
+</div>
Modified: trunk/vhffs-panel/themes/vhffs/main.css
===================================================================
--- trunk/vhffs-panel/themes/vhffs/main.css 2007-09-04 17:34:02 UTC (rev 864)
+++ trunk/vhffs-panel/themes/vhffs/main.css 2007-09-06 03:41:55 UTC (rev 865)
@@ -596,18 +596,18 @@
content:url('images/error.png');
}
-body.subscribe div#content {
+div#subscribe div#content {
width:600px;
margin-left:auto;
margin-right:auto;
}
-body.subscribe h1 {
+div#subscribe h1 {
font-size: 3em;
text-align: center;
}
-body.subscribe img#logo {
+div#subscribe img#logo {
position:absolute;
left:50%;
top:0px;
Modified: trunk/vhffs-panel/user/prefs.pl
===================================================================
--- trunk/vhffs-panel/user/prefs.pl 2007-09-04 17:34:02 UTC (rev 864)
+++ trunk/vhffs-panel/user/prefs.pl 2007-09-06 03:41:55 UTC (rev 865)
@@ -47,9 +47,9 @@
use Vhffs::Services::MailUser;
my $panel = new Vhffs::Panel::Main();
+my $session = $panel->get_session;
my $cgi = $panel->{cgi};
my $vhffs = $panel->{vhffs};
-my $session = $panel->{session};
my $maintemplate = $panel->{template};
my $user = $panel->{user};
@@ -406,4 +406,5 @@
}
-display Vhffs::Panel::Main($panel, $template->output);
+$panel->build( $template );
+$panel->display;
Modified: trunk/vhffs-panel/user/projects.pl
===================================================================
--- trunk/vhffs-panel/user/projects.pl 2007-09-04 17:34:02 UTC (rev 864)
+++ trunk/vhffs-panel/user/projects.pl 2007-09-06 03:41:55 UTC (rev 865)
@@ -41,6 +41,8 @@
use Vhffs::Panel::User;
my $panel = new Vhffs::Panel::Main();
+$panel->get_session;
+
my $cgi = $panel->{cgi};
my $vhffs = $panel->{vhffs};
my $user = $panel->{user};
@@ -57,4 +59,5 @@
$template->param( CONTRIBUTED_PROJECTS_TEXT => gettext('Projects you contribute to') );
$template->param( NEW_PROJECT_TEXT => gettext('Create new project') );
-$panel->display($template->output);
+$panel->build( $template );
+$panel->display;
Modified: trunk/vhffs-public/allgroups.pl
===================================================================
--- trunk/vhffs-public/allgroups.pl 2007-09-04 17:34:02 UTC (rev 864)
+++ trunk/vhffs-public/allgroups.pl 2007-09-06 03:41:55 UTC (rev 865)
@@ -44,7 +44,7 @@
use Vhffs::Constants;
use CGI;
-my $panel = new_light Vhffs::Panel::Main();
+my $panel = new Vhffs::Panel::Main();
my $vhffs = $panel->{'vhffs'};
my $cgi = $panel->{'cgi'};
my $templatedir = $panel->{'templatedir'};
@@ -62,8 +62,6 @@
my $hostname = $vhffs->get_config->get_host_name;
-
-$maintemplate->param( THEME => Vhffs::Panel::Main::get_theme( $vhffs ) );
$maintemplate->param( TEXT_TITLE => sprintf( gettext("All groups on %s") , $hostname ) );
$maintemplate->param( LETTERS => [ { letter => '0' }, { letter => '1' }, { letter => '2' }, { letter => '3' }, { letter => '4' }, { letter => '5' }, { letter => '6' }, { letter => '7' }, { letter => '8' }, { letter => '9' }, { letter => 'a' }, { letter => 'b' }, { letter => 'c' }, { letter => 'd' }, { letter => 'e' }, { letter => 'f' }, { letter => 'g' }, { letter => 'h' }, { letter => 'i' }, { letter => 'j' }, { letter => 'k' }, { letter => 'l' }, { letter => 'm' }, { letter => 'n' }, { letter => 'o' }, { letter => 'p' }, { letter => 'q' }, { letter => 'r' }, { letter => 's' }, { letter => 't' }, { letter => 'u' }, { letter => 'v' }, { letter => 'w' }, { letter => 'x' }, { letter => 'y' }, { letter => 'z' } ]);
$maintemplate->param( ALL => gettext('All') );
@@ -120,5 +118,5 @@
$maintemplate->param( VALUES => $output_final );
-
-display_light Vhffs::Panel::Main( $panel , $maintemplate );
+$panel->light( $maintemplate );
+$panel->display;
Modified: trunk/vhffs-public/allwebsites.pl
===================================================================
--- trunk/vhffs-public/allwebsites.pl 2007-09-04 17:34:02 UTC (rev 864)
+++ trunk/vhffs-public/allwebsites.pl 2007-09-06 03:41:55 UTC (rev 865)
@@ -46,7 +46,7 @@
use Vhffs::Panel::Main;
use Vhffs::Services::Web;
-my $panel = new_light Vhffs::Panel::Main();
+my $panel = new Vhffs::Panel::Main();
my $vhffs = $panel->{'vhffs'};
my $cgi = $panel->{'cgi'};
my $templatedir = $panel->{'templatedir'};
@@ -67,7 +67,6 @@
$maintemplate = new HTML::Template( filename => $templatedir."/public/allwebsites.tmpl" );
-$maintemplate->param( THEME => Vhffs::Panel::Main::get_theme( $vhffs ) );
$maintemplate->param( TEXT_TITLE => sprintf( gettext("All websites on %s") , $hostname ) );
$maintemplate->param( LETTERS => $letters );
$maintemplate->param( ALL => gettext('All') );
@@ -107,5 +106,5 @@
$maintemplate->param( BANNER => $subtemplate->output );
-
-display_light Vhffs::Panel::Main( $panel , $maintemplate );
+$panel->light( $maintemplate );
+$panel->display;
Modified: trunk/vhffs-public/group.pl
===================================================================
--- trunk/vhffs-public/group.pl 2007-09-04 17:34:02 UTC (rev 864)
+++ trunk/vhffs-public/group.pl 2007-09-06 03:41:55 UTC (rev 865)
@@ -47,7 +47,7 @@
use Vhffs::Panel::Main;
use Vhffs::Functions;
-my $panel = new_light Vhffs::Panel::Main();
+my $panel = new Vhffs::Panel::Main();
my $vhffs = $panel->{'vhffs'};
my $cgi = $panel->{'cgi'};
my $templatedir = $panel->{'templatedir'};
@@ -84,7 +84,6 @@
{
$name = Vhffs::Functions::check_arg( $name );
$template = new HTML::Template( filename => $templatedir."/public/group.tmpl" );
- $template->param( THEME => Vhffs::Panel::Main::get_theme( $vhffs ) );
$template->param( TEXT_TITLE => $group->get_groupname );
$template->param( TEXT_GROUPNAME => gettext("Groupname") );
@@ -245,4 +244,5 @@
return Vhffs::Functions::obfuscate_email($vhffs, $_[0]);
}
-display_light Vhffs::Panel::Main( $panel , $template );
+$panel->light( $template );
+$panel->display;
Modified: trunk/vhffs-public/index.pl
===================================================================
--- trunk/vhffs-public/index.pl 2007-09-04 17:34:02 UTC (rev 864)
+++ trunk/vhffs-public/index.pl 2007-09-06 03:41:55 UTC (rev 865)
@@ -45,7 +45,7 @@
use Vhffs::Constants;
use Vhffs::Panel::Main;
-my $panel = new_light Vhffs::Panel::Main();
+my $panel = new Vhffs::Panel::Main();
my $vhffs = $panel->{'vhffs'};
my $templatedir = $panel->{'templatedir'};
my $cgi = $panel->{'cgi'};
@@ -57,7 +57,6 @@
my $subtemplate;
$template = new HTML::Template( filename => $templatedir."/public/index.tmpl" );
-$template->param( THEME => Vhffs::Panel::Main::get_theme( $vhffs ) );
$template->param( TEXT_TITLE => sprintf( gettext("%s public area") , $vhffs->get_config->get_host_name) );
@@ -86,9 +85,7 @@
$subtemplate->param( LAST_USERS => gettext( "Last users" ) );
$subtemplate->param( SEARCH => gettext( "Search:" ) );
-
-
$template->param( BANNER => $subtemplate->output );
-
-display_light Vhffs::Panel::Main( $panel , $template );
+$panel->light( $template );
+$panel->display;
Modified: trunk/vhffs-public/lastgroups.pl
===================================================================
--- trunk/vhffs-public/lastgroups.pl 2007-09-04 17:34:02 UTC (rev 864)
+++ trunk/vhffs-public/lastgroups.pl 2007-09-06 03:41:55 UTC (rev 865)
@@ -43,7 +43,7 @@
use Vhffs::Panel::Main;
use CGI;
-my $panel = new_light Vhffs::Panel::Main();
+my $panel = new Vhffs::Panel::Main();
my $vhffs = $panel->{'vhffs'};
my $templatedir = $panel->{'templatedir'};
my $cgi = $panel->{'cgi'};
@@ -59,8 +59,6 @@
my $hostname = $vhffs->get_config->get_host_name;
-
-$maintemplate->param( THEME => Vhffs::Panel::Main::get_theme( $vhffs ) );
$maintemplate->param( TEXT_TITLE => sprintf( gettext("Last groups on %s") , $hostname ) );
@@ -113,4 +111,5 @@
$maintemplate->param( VALUES => $output_final );
-display_light Vhffs::Panel::Main( $panel , $maintemplate );
+$panel->light( $maintemplate );
+$panel->display;
Modified: trunk/vhffs-public/lastusers.pl
===================================================================
--- trunk/vhffs-public/lastusers.pl 2007-09-04 17:34:02 UTC (rev 864)
+++ trunk/vhffs-public/lastusers.pl 2007-09-06 03:41:55 UTC (rev 865)
@@ -46,7 +46,7 @@
use Vhffs::Panel::Main;
use Vhffs::Conf;
-my $panel = new_light Vhffs::Panel::Main();
+my $panel = new Vhffs::Panel::Main();
my $vhffs = $panel->{'vhffs'};
my $templatedir = $panel->{'templatedir'};
my $cgi = $panel->{'cgi'};
@@ -64,10 +64,8 @@
$maintemplate = new HTML::Template( filename => $templatedir."/public/lastusers.tmpl" );
-
-
-$maintemplate->param( THEME => Vhffs::Panel::Main::get_theme( $vhffs ) );
$maintemplate->param( TEXT_TITLE => sprintf( gettext("Last users on %s") , $hostname ) );
+
foreach $user (@{$users})
{
@@ -120,4 +118,5 @@
$maintemplate->param( VALUES => $output_final );
$maintemplate->param( BANNER => $subtemplate->output );
-display_light Vhffs::Panel::Main( $panel , $maintemplate );
+$panel->light( $maintemplate );
+$panel->display;
Modified: trunk/vhffs-public/templates/allwebsites.tmpl
===================================================================
--- trunk/vhffs-public/templates/allwebsites.tmpl 2007-09-04 17:34:02 UTC (rev 864)
+++ trunk/vhffs-public/templates/allwebsites.tmpl 2007-09-06 03:41:55 UTC (rev 865)
@@ -1,17 +1,3 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
- <head>
-
- <title><tmpl_var name="TITLE"></title>
-
- <link rel="stylesheet" type="text/css" href="/themes/<tmpl_var name="THEME">/main.css" />
- <meta http-equiv="Pragma" content="no-cache" />
- <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
- <tmpl_loop name="JSCRIPTS">
- <script language="javascript" type="text/javascript" charset="utf-8" src="<tmpl_var name="SCRIPT">"></script>
- </tmpl_loop>
- </head>
- <body>
<tmpl_var name="BANNER">
<div id="public">
@@ -31,5 +17,3 @@
<tmpl_var name="VALUES">
</ul>
</div>
-</body>
-</html>
Modified: trunk/vhffs-public/templates/group.tmpl
===================================================================
--- trunk/vhffs-public/templates/group.tmpl 2007-09-04 17:34:02 UTC (rev 864)
+++ trunk/vhffs-public/templates/group.tmpl 2007-09-06 03:41:55 UTC (rev 865)
@@ -1,17 +1,3 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
- <head>
-
- <title><tmpl_var name="TITLE"></title>
-
- <link rel="stylesheet" type="text/css" href="/themes/<tmpl_var name="THEME">/main.css" />
- <meta http-equiv="Pragma" content="no-cache" />
- <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
- <tmpl_loop name="JSCRIPTS">
- <script language="javascript" type="text/javascript" charset="utf-8" src="<tmpl_var name="SCRIPT">"></script>
- </tmpl_loop>
- </head>
- <body>
<tmpl_var name="BANNER">
<h1><tmpl_var name="TEXT_TITLE"></h1>
@@ -53,6 +39,3 @@
<tmpl_var name="LISTS_VALUE">
</ul>
</p>
-
-</body>
-</html>
Modified: trunk/vhffs-public/templates/index.tmpl
===================================================================
--- trunk/vhffs-public/templates/index.tmpl 2007-09-04 17:34:02 UTC (rev 864)
+++ trunk/vhffs-public/templates/index.tmpl 2007-09-06 03:41:55 UTC (rev 865)
@@ -1,19 +1,3 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
- <head>
-
- <title><tmpl_var name="TITLE"></title>
-
- <link rel="stylesheet" type="text/css" href="/themes/<tmpl_var name="THEME">/main.css" />
- <link rel="alternate" type="application/rss+xml" title="Lastusers" href="rss/lastusers.pl" />
- <link rel="alternate" type="application/rss+xml" title="Lastgroups" href="rss/lastgroups.pl" />
- <meta http-equiv="Pragma" content="no-cache" />
- <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
- <tmpl_loop name="JSCRIPTS">
- <script language="javascript" type="text/javascript" charset="utf-8" src="<tmpl_var name="SCRIPT">"></script>
- </tmpl_loop>
- </head>
- <body>
<tmpl_var name="BANNER">
<div id="public">
@@ -79,6 +63,3 @@
</div>
</div>
-
-</body>
-</html>
Modified: trunk/vhffs-public/templates/lastgroups.tmpl
===================================================================
--- trunk/vhffs-public/templates/lastgroups.tmpl 2007-09-04 17:34:02 UTC (rev 864)
+++ trunk/vhffs-public/templates/lastgroups.tmpl 2007-09-06 03:41:55 UTC (rev 865)
@@ -1,17 +1,3 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
- <head>
-
- <title><tmpl_var name="TITLE"></title>
-
- <link rel="stylesheet" type="text/css" href="/themes/<tmpl_var name="THEME">/main.css" />
- <meta http-equiv="Pragma" content="no-cache" />
- <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
- <tmpl_loop name="JSCRIPTS">
- <script language="javascript" type="text/javascript" charset="utf-8" src="<tmpl_var name="SCRIPT">"></script>
- </tmpl_loop>
- </head>
- <body>
<tmpl_var name="BANNER">
<div id="public">
@@ -29,5 +15,3 @@
</tmpl_if>
<tmpl_var name="VALUES">
</div>
-</body>
-</html>
Modified: trunk/vhffs-public/templates/lastusers.tmpl
===================================================================
--- trunk/vhffs-public/templates/lastusers.tmpl 2007-09-04 17:34:02 UTC (rev 864)
+++ trunk/vhffs-public/templates/lastusers.tmpl 2007-09-06 03:41:55 UTC (rev 865)
@@ -1,17 +1,3 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
- <head>
-
- <title><tmpl_var name="TITLE"></title>
-
- <link rel="stylesheet" type="text/css" href="/themes/<tmpl_var name="THEME">/main.css" />
- <meta http-equiv="Pragma" content="no-cache" />
- <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
- <tmpl_loop name="JSCRIPTS">
- <script language="javascript" type="text/javascript" charset="utf-8" src="<tmpl_var name="SCRIPT">"></script>
- </tmpl_loop>
- </head>
- <body>
<tmpl_var name="BANNER">
<div id="public">
@@ -21,5 +7,3 @@
<tmpl_var name="VALUES">
</p>
</div>
-</body>
-</html>
Modified: trunk/vhffs-public/templates/simplemsg.tmpl
===================================================================
--- trunk/vhffs-public/templates/simplemsg.tmpl 2007-09-04 17:34:02 UTC (rev 864)
+++ trunk/vhffs-public/templates/simplemsg.tmpl 2007-09-06 03:41:55 UTC (rev 865)
@@ -1,22 +1,6 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
- <head>
-
- <title><tmpl_var name="TITLE"></title>
-
- <link rel="stylesheet" type="text/css" href="/themes/<tmpl_var name="THEME">/main.css" />
- <meta http-equiv="Pragma" content="no-cache" />
- <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
- <tmpl_loop name="JSCRIPTS">
- <script language="javascript" type="text/javascript" charset="utf-8" src="<tmpl_var name="SCRIPT">"></script>
- </tmpl_loop>
- </head>
- <body>
<div class="logo">
</div>
<div class="misc" id="misc">
<h1 class="message"><tmpl_var name="MESSAGE"></h1>
</div>
- </body>
-</html>
Modified: trunk/vhffs-public/templates/user.tmpl
===================================================================
--- trunk/vhffs-public/templates/user.tmpl 2007-09-04 17:34:02 UTC (rev 864)
+++ trunk/vhffs-public/templates/user.tmpl 2007-09-06 03:41:55 UTC (rev 865)
@@ -1,17 +1,3 @@
-<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
-<html xmlns="http://www.w3.org/1999/xhtml">
- <head>
-
- <title><tmpl_var name="TITLE"></title>
-
- <link rel="stylesheet" type="text/css" href="/themes/<tmpl_var name="THEME">/main.css" />
- <meta http-equiv="Pragma" content="no-cache" />
- <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
- <tmpl_loop name="JSCRIPTS">
- <script language="javascript" type="text/javascript" charset="utf-8" src="<tmpl_var name="SCRIPT">"></script>
- </tmpl_loop>
- </head>
- <body>
<tmpl_var name="BANNER">
<div class="public_user">
@@ -30,5 +16,3 @@
<tmpl_var name="VALUES">
</p>
</div>
-</body>
-</html>
Modified: trunk/vhffs-public/user.pl
===================================================================
--- trunk/vhffs-public/user.pl 2007-09-04 17:34:02 UTC (rev 864)
+++ trunk/vhffs-public/user.pl 2007-09-06 03:41:55 UTC (rev 865)
@@ -47,7 +47,7 @@
use Vhffs::Panel::Main;
use Vhffs::Functions;
-my $panel = new_light Vhffs::Panel::Main();
+my $panel = new Vhffs::Panel::Main();
my $vhffs = $panel->{'vhffs'};
my $templatedir = $panel->{'templatedir'};
my $cgi = $panel->{'cgi'};
@@ -79,7 +79,6 @@
else
{
$template = new HTML::Template( filename => $templatedir."/public/user.tmpl" );
- $template->param( THEME => Vhffs::Panel::Main::get_theme( $vhffs ) );
$template->param( TEXT_USERNAME => gettext("Username") );
$template->param( VALUE_USERNAME => $user->get_username );
$template->param( TEXT_FIRSTNAME => gettext("Firstname") );
@@ -124,4 +123,5 @@
}
-display_light Vhffs::Panel::Main( $panel , $template );
+$panel->light( $template );
+$panel->display;
Modified: trunk/vhffs-public/websearch.pl
===================================================================
--- trunk/vhffs-public/websearch.pl 2007-09-04 17:34:02 UTC (rev 864)
+++ trunk/vhffs-public/websearch.pl 2007-09-06 03:41:55 UTC (rev 865)
@@ -47,7 +47,7 @@
use Vhffs::Services::Web;
use Vhffs::Functions;
-my $panel = new_light Vhffs::Panel::Main();
+my $panel = new Vhffs::Panel::Main();
my $vhffs = $panel->{'vhffs'};
my $templatedir = $panel->{'templatedir'};
my $cgi = $panel->{'cgi'};
@@ -72,7 +72,6 @@
bindtextdomain("vhffs", $vhffs->get_config->get_intldir);
textdomain("vhffs");
-$maintemplate->param( THEME => Vhffs::Panel::Main::get_theme( $vhffs ) );
$maintemplate->param( TEXT_TITLE => sprintf( gettext("All websites on %s") , $hostname ) );
my $output = "";
@@ -93,4 +92,5 @@
$maintemplate->param( VALUES => $output );
-display_light Vhffs::Panel::Main( $panel , $maintemplate );
+$panel->light( $maintemplate );
+$panel->display;