[vhffs-dev] [871] all index.pl are now using the new Panel API |
[ Thread Index |
Date Index
| More vhffs.org/vhffs-dev Archives
]
Revision: 871
Author: gradator
Date: 2007-09-07 00:34:22 +0000 (Fri, 07 Sep 2007)
Log Message:
-----------
all index.pl are now using the new Panel API
Modified Paths:
--------------
trunk/vhffs-api/src/Vhffs/Panel/Main.pm
trunk/vhffs-panel/admin/cvs/index.pl
trunk/vhffs-panel/admin/dns/index.pl
trunk/vhffs-panel/admin/group/index.pl
trunk/vhffs-panel/admin/mail/index.pl
trunk/vhffs-panel/admin/mailing/index.pl
trunk/vhffs-panel/admin/mysql/index.pl
trunk/vhffs-panel/admin/pgsql/index.pl
trunk/vhffs-panel/admin/repository/index.pl
trunk/vhffs-panel/admin/svn/index.pl
trunk/vhffs-panel/admin/user/index.pl
trunk/vhffs-panel/admin/web/index.pl
trunk/vhffs-panel/cvs/index.pl
trunk/vhffs-panel/dns/index.pl
trunk/vhffs-panel/mail/index.pl
trunk/vhffs-panel/mailinglist/index.pl
trunk/vhffs-panel/mysql/index.pl
trunk/vhffs-panel/pgsql/index.pl
trunk/vhffs-panel/repository/index.pl
trunk/vhffs-panel/svn/index.pl
trunk/vhffs-panel/web/index.pl
Modified: trunk/vhffs-api/src/Vhffs/Panel/Main.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Panel/Main.pm 2007-09-06 23:08:47 UTC (rev 870)
+++ trunk/vhffs-api/src/Vhffs/Panel/Main.pm 2007-09-07 00:34:22 UTC (rev 871)
@@ -181,8 +181,9 @@
unless($user->is_moderator || $user->is_admin) {
$panel->set_title( gettext('Access denied') );
$panel->add_error( gettext('You are not granted to access this page') );
- $panel->display( '' );
- exit( 0 );
+ $panel->build;
+ $panel->display;
+ exit 0;
}
}
@@ -201,8 +202,9 @@
unless($user->is_admin) {
$panel->set_title( gettext('Access denied') );
$panel->add_error( gettext('You are not granted to access this page') );
- $panel->display( '' );
- exit( 0 );
+ $panel->build;
+ $panel->display;
+ exit 0;
}
}
@@ -565,47 +567,47 @@
if($config->get_service_availability('web')) {
my $webs = Vhffs::Panel::Web::getall_per_group( $vhffs, $gid );
- $services_list .= $panel->create_service_index('web', $webs);
+ $services_list .= $panel->create_service_index('web', $webs)->output;
}
if($config->get_service_availability('mysql')) {
my $mysql = Vhffs::Panel::Mysql::getall_per_group( $vhffs, $gid );
- $services_list .= $panel->create_service_index('mysql', $mysql);
+ $services_list .= $panel->create_service_index('mysql', $mysql)->output;
}
if($config->get_service_availability('pgsql')) {
my $pg = Vhffs::Panel::Pgsql::getall_per_group( $vhffs, $gid );
- $services_list .= $panel->create_service_index('pgsql', $pg);
+ $services_list .= $panel->create_service_index('pgsql', $pg)->output;
}
if($config->get_service_availability('cvs')) {
my $cvs = Vhffs::Panel::Cvs::getall_per_group( $vhffs, $gid );
- $services_list .= $panel->create_service_index('cvs', $cvs);
+ $services_list .= $panel->create_service_index('cvs', $cvs)->output;
}
if($config->get_service_availability('svn')) {
my $svn = Vhffs::Panel::Svn::getall_per_group( $vhffs, $gid );
- $services_list .= $panel->create_service_index('svn', $svn);
+ $services_list .= $panel->create_service_index('svn', $svn)->output;
}
if($config->get_service_availability('mailinglist')) {
my $ml = Vhffs::Panel::MailingList::getall_per_group( $vhffs, $gid );
- $services_list .= $panel->create_service_index('mailinglist', $ml);
+ $services_list .= $panel->create_service_index('mailinglist', $ml)->output;
}
if($config->get_service_availability('mail')) {
my $mail = Vhffs::Panel::Mail::getall_per_group( $vhffs, $gid );
- $services_list .= $panel->create_service_index('mail', $mail);
+ $services_list .= $panel->create_service_index('mail', $mail)->output;
}
if($config->get_service_availability('repository')) {
my $repos = Vhffs::Panel::Repository::getall_per_group( $vhffs, $gid );
- $services_list .= $panel->create_service_index('repository', $repos);
+ $services_list .= $panel->create_service_index('repository', $repos)->output;
}
if($config->get_service_availability('dns')) {
my $dns = Vhffs::Panel::DNS::getall_per_group( $vhffs, $gid );
- $services_list .= $panel->create_service_index('dns', $dns);
+ $services_list .= $panel->create_service_index('dns', $dns)->output;
}
$template->param( SERVICES => $services_list );
}
@@ -634,33 +636,31 @@
my $theme = $panel->{theme};
my $templatedir = $panel->{templatedir};
- my $content = $template->output;
-
$panel->add_info( $cgi->param('msg') ) if(defined $cgi->param('msg'));
- $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 );
+ my $paneltemplate = new HTML::Template( filename => $templatedir.'/panel/main/panel.tmpl' );
+ $paneltemplate->param( THEME => $theme );
+ $paneltemplate->param( TITLE => $panel->{title} );
+ $paneltemplate->param( HEADER => $panel->generate_header );
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 );
+ $paneltemplate->param( ERRORS => $tmplerrors->output );
}
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 );
+ $paneltemplate->param( INFOS => $tmplinfos->output );
}
- $template->param( TEXT_HELP => gettext('Help') );
- $template->param( TEXT_HELP_CONTENT => gettext('Stay over an icon to see its description.') );
+ $paneltemplate->param( TEXT_HELP => gettext('Help') );
+ $paneltemplate->param( TEXT_HELP_CONTENT => gettext('Stay over an icon to see its description.') );
- $template->param( CONTENT => $content);
+ $paneltemplate->param( CONTENT => $template->output ) if( defined $template );
- $panel->{content} = $template->output;
+ $panel->{content} = $paneltemplate->output;
return;
}
@@ -734,7 +734,7 @@
$panel->redirect($page, $cookies);
Issues a redirection header sending to $page
-(you can specify additional cookies to be send).
+(you can specify additional cookies to be sent).
This function never returns.
@@ -764,8 +764,8 @@
=head2 create_service_index
my $webs = Vhffs::Panel::Web::get_per_group($main, $gid);
- my $output = $panel->create_service_index('web', $webs);
- print $output;
+ my $template = $panel->create_service_index('web', $webs);
+ print $template->output;
Generates summary information for a given service using service_index.tmpl.
@@ -807,7 +807,7 @@
$template->param( HELP_URL => $url );
}
- return $template->output;
+ return $template;
}
1;
Modified: trunk/vhffs-panel/admin/cvs/index.pl
===================================================================
--- trunk/vhffs-panel/admin/cvs/index.pl 2007-09-06 23:08:47 UTC (rev 870)
+++ trunk/vhffs-panel/admin/cvs/index.pl 2007-09-07 00:34:22 UTC (rev 871)
@@ -56,4 +56,5 @@
$template->param( CATEGORIES => [ Vhffs::Panel::Admin::get_cvs_category ] );
-$panel->display($template->output);
+$panel->build( $template );
+$panel->display;
Modified: trunk/vhffs-panel/admin/dns/index.pl
===================================================================
--- trunk/vhffs-panel/admin/dns/index.pl 2007-09-06 23:08:47 UTC (rev 870)
+++ trunk/vhffs-panel/admin/dns/index.pl 2007-09-07 00:34:22 UTC (rev 871)
@@ -56,4 +56,5 @@
$template->param( CATEGORIES => [ Vhffs::Panel::Admin::get_dns_category ] );
-$panel->display($template->output);
+$panel->build( $template );
+$panel->display;
Modified: trunk/vhffs-panel/admin/group/index.pl
===================================================================
--- trunk/vhffs-panel/admin/group/index.pl 2007-09-06 23:08:47 UTC (rev 870)
+++ trunk/vhffs-panel/admin/group/index.pl 2007-09-07 00:34:22 UTC (rev 871)
@@ -56,4 +56,5 @@
$template->param( CATEGORIES => [ Vhffs::Panel::Admin::get_group_category ] );
-$panel->display($template->output);
+$panel->build( $template );
+$panel->display;
Modified: trunk/vhffs-panel/admin/mail/index.pl
===================================================================
--- trunk/vhffs-panel/admin/mail/index.pl 2007-09-06 23:08:47 UTC (rev 870)
+++ trunk/vhffs-panel/admin/mail/index.pl 2007-09-07 00:34:22 UTC (rev 871)
@@ -56,4 +56,5 @@
$template->param( CATEGORIES => [ Vhffs::Panel::Admin::get_mail_category ] );
-$panel->display($template->output);
+$panel->build( $template );
+$panel->display;
Modified: trunk/vhffs-panel/admin/mailing/index.pl
===================================================================
--- trunk/vhffs-panel/admin/mailing/index.pl 2007-09-06 23:08:47 UTC (rev 870)
+++ trunk/vhffs-panel/admin/mailing/index.pl 2007-09-07 00:34:22 UTC (rev 871)
@@ -56,4 +56,5 @@
$template->param( CATEGORIES => [ Vhffs::Panel::Admin::get_mailing_category ] );
-$panel->display($template->output);
+$panel->build( $template );
+$panel->display;
Modified: trunk/vhffs-panel/admin/mysql/index.pl
===================================================================
--- trunk/vhffs-panel/admin/mysql/index.pl 2007-09-06 23:08:47 UTC (rev 870)
+++ trunk/vhffs-panel/admin/mysql/index.pl 2007-09-07 00:34:22 UTC (rev 871)
@@ -56,4 +56,5 @@
$template->param( CATEGORIES => [ Vhffs::Panel::Admin::get_mysql_category ] );
-$panel->display($template->output);
+$panel->build( $template );
+$panel->display;
Modified: trunk/vhffs-panel/admin/pgsql/index.pl
===================================================================
--- trunk/vhffs-panel/admin/pgsql/index.pl 2007-09-06 23:08:47 UTC (rev 870)
+++ trunk/vhffs-panel/admin/pgsql/index.pl 2007-09-07 00:34:22 UTC (rev 871)
@@ -56,4 +56,5 @@
$template->param( CATEGORIES => [ Vhffs::Panel::Admin::get_pgsql_category ] );
-$panel->display($template->output);
+$panel->build( $template );
+$panel->display;
Modified: trunk/vhffs-panel/admin/repository/index.pl
===================================================================
--- trunk/vhffs-panel/admin/repository/index.pl 2007-09-06 23:08:47 UTC (rev 870)
+++ trunk/vhffs-panel/admin/repository/index.pl 2007-09-07 00:34:22 UTC (rev 871)
@@ -56,4 +56,5 @@
$template->param( CATEGORIES => [ Vhffs::Panel::Admin::get_repo_category ] );
-$panel->display($template->output);
+$panel->build( $template );
+$panel->display;
Modified: trunk/vhffs-panel/admin/svn/index.pl
===================================================================
--- trunk/vhffs-panel/admin/svn/index.pl 2007-09-06 23:08:47 UTC (rev 870)
+++ trunk/vhffs-panel/admin/svn/index.pl 2007-09-07 00:34:22 UTC (rev 871)
@@ -56,4 +56,5 @@
$template->param( CATEGORIES => [ Vhffs::Panel::Admin::get_svn_category ] );
-$panel->display($template->output);
+$panel->build( $template );
+$panel->display;
Modified: trunk/vhffs-panel/admin/user/index.pl
===================================================================
--- trunk/vhffs-panel/admin/user/index.pl 2007-09-06 23:08:47 UTC (rev 870)
+++ trunk/vhffs-panel/admin/user/index.pl 2007-09-07 00:34:22 UTC (rev 871)
@@ -56,4 +56,5 @@
$template->param( CATEGORIES => [ Vhffs::Panel::Admin::get_user_category ] );
-$panel->display($template->output);
+$panel->build( $template );
+$panel->display;
Modified: trunk/vhffs-panel/admin/web/index.pl
===================================================================
--- trunk/vhffs-panel/admin/web/index.pl 2007-09-06 23:08:47 UTC (rev 870)
+++ trunk/vhffs-panel/admin/web/index.pl 2007-09-07 00:34:22 UTC (rev 871)
@@ -56,4 +56,5 @@
$template->param( CATEGORIES => [ Vhffs::Panel::Admin::get_web_category ] );
-$panel->display($template->output);
+$panel->build( $template );
+$panel->display;
Modified: trunk/vhffs-panel/cvs/index.pl
===================================================================
--- trunk/vhffs-panel/cvs/index.pl 2007-09-06 23:08:47 UTC (rev 870)
+++ trunk/vhffs-panel/cvs/index.pl 2007-09-07 00:34:22 UTC (rev 871)
@@ -51,6 +51,7 @@
if( ! defined($group) ) {
$panel->set_title( gettext('Error') );
$panel->add_error( gettext('You have to select a group first') );
+ $panel->build;
$panel->display;
} else {
# Group is in session => access is granted for user and group is activated
@@ -59,8 +60,11 @@
my $cvs = Vhffs::Panel::Cvs::getall_per_group( $vhffs, $group->get_gid );
if($cvs < 0) {
$panel->add_error( gettext('Unable to get CVS repositories') );
+ $panel->build;
+ $panel->display;
} else {
- $panel->display($panel->create_service_index('cvs', $cvs));
+ $panel->build( $panel->create_service_index('cvs', $cvs ) );
+ $panel->display;
}
}
Modified: trunk/vhffs-panel/dns/index.pl
===================================================================
--- trunk/vhffs-panel/dns/index.pl 2007-09-06 23:08:47 UTC (rev 870)
+++ trunk/vhffs-panel/dns/index.pl 2007-09-07 00:34:22 UTC (rev 871)
@@ -51,6 +51,7 @@
if( ! defined($group) ) {
$panel->set_title( gettext('Error') );
$panel->add_error( gettext('You have to select a group first') );
+ $panel->build;
$panel->display;
} else {
# Group is in session => access is granted for user and group is activated
@@ -59,8 +60,11 @@
my $dns = Vhffs::Panel::DNS::getall_per_group( $vhffs, $group->get_gid );
if($dns < 0) {
$panel->add_error( gettext('Unable to get DNS') );
+ $panel->build;
+ $panel->display;
} else {
- $panel->display($panel->create_service_index('dns', $dns));
+ $panel->build( $panel->create_service_index('dns', $dns) );
+ $panel->display;
}
}
Modified: trunk/vhffs-panel/mail/index.pl
===================================================================
--- trunk/vhffs-panel/mail/index.pl 2007-09-06 23:08:47 UTC (rev 870)
+++ trunk/vhffs-panel/mail/index.pl 2007-09-07 00:34:22 UTC (rev 871)
@@ -51,6 +51,7 @@
if( ! defined($group) ) {
$panel->set_title( gettext('Error') );
$panel->add_error( gettext('You have to select a group first') );
+ $panel->build;
$panel->display;
} else {
# Group is in session => access is granted for user and group is activated
@@ -59,8 +60,11 @@
my $mails = Vhffs::Panel::Mail::getall_per_group( $vhffs, $group->get_gid );
if($mails < 0) {
$panel->add_error( gettext('Unable to get mail domains') );
+ $panel->build;
+ $panel->display;
} else {
- $panel->display($panel->create_service_index('mail', $mails));
+ $panel->build( $panel->create_service_index('mail', $mails) );
+ $panel->display;
}
}
Modified: trunk/vhffs-panel/mailinglist/index.pl
===================================================================
--- trunk/vhffs-panel/mailinglist/index.pl 2007-09-06 23:08:47 UTC (rev 870)
+++ trunk/vhffs-panel/mailinglist/index.pl 2007-09-07 00:34:22 UTC (rev 871)
@@ -51,6 +51,7 @@
if( ! defined($group) ) {
$panel->set_title( gettext('Error') );
$panel->add_error( gettext('You have to select a group first') );
+ $panel->build;
$panel->display;
} else {
# Group is in session => access is granted for user and group is activated
@@ -59,8 +60,11 @@
my $mls = Vhffs::Panel::MailingList::getall_per_group( $vhffs, $group->get_gid );
if($mls < 0) {
$panel->add_error( gettext('Unable to get mailing lists') );
+ $panel->build;
+ $panel->display;
} else {
- $panel->display($panel->create_service_index('mailinglist', $mls));
+ $panel->build( $panel->create_service_index('mailinglist', $mls) );
+ $panel->display;
}
}
Modified: trunk/vhffs-panel/mysql/index.pl
===================================================================
--- trunk/vhffs-panel/mysql/index.pl 2007-09-06 23:08:47 UTC (rev 870)
+++ trunk/vhffs-panel/mysql/index.pl 2007-09-07 00:34:22 UTC (rev 871)
@@ -51,6 +51,7 @@
if( ! defined($group) ) {
$panel->set_title( gettext('Error') );
$panel->add_error( gettext('You have to select a group first') );
+ $panel->build;
$panel->display;
} else {
# Group is in session => access is granted for user and group is activated
@@ -59,8 +60,11 @@
my $mysql = Vhffs::Panel::Mysql::getall_per_group( $vhffs, $group->get_gid );
if($mysql < 0) {
$panel->add_error( gettext('Unable to get MySQL databases.') );
+ $panel->build;
+ $panel->display;
} else {
- $panel->display($panel->create_service_index('mysql', $mysql));
+ $panel->build( $panel->create_service_index('mysql', $mysql) );
+ $panel->display;
}
}
Modified: trunk/vhffs-panel/pgsql/index.pl
===================================================================
--- trunk/vhffs-panel/pgsql/index.pl 2007-09-06 23:08:47 UTC (rev 870)
+++ trunk/vhffs-panel/pgsql/index.pl 2007-09-07 00:34:22 UTC (rev 871)
@@ -51,6 +51,7 @@
if( ! defined($group) ) {
$panel->set_title( gettext('Error') );
$panel->add_error( gettext('You have to select a group first') );
+ $panel->build;
$panel->display;
} else {
# Group is in session => access is granted for user and group is activated
@@ -59,8 +60,11 @@
my $pgsql = Vhffs::Panel::Pgsql::getall_per_group( $vhffs, $group->get_gid );
if($pgsql < 0) {
$panel->add_error( gettext('Unable to get PgSQL databases') );
+ $panel->build;
+ $panel->display;
} else {
- $panel->display($panel->create_service_index('pgsql', $pgsql));
+ $panel->build( $panel->create_service_index('pgsql', $pgsql) );
+ $panel->display;
}
}
Modified: trunk/vhffs-panel/repository/index.pl
===================================================================
--- trunk/vhffs-panel/repository/index.pl 2007-09-06 23:08:47 UTC (rev 870)
+++ trunk/vhffs-panel/repository/index.pl 2007-09-07 00:34:22 UTC (rev 871)
@@ -51,6 +51,7 @@
if( ! defined($group) ) {
$panel->set_title( gettext('Error') );
$panel->add_error( gettext('You have to select a group first') );
+ $panel->build;
$panel->display;
} else {
# Group is in session => access is granted for user and group is activated
@@ -59,8 +60,11 @@
my $repos = Vhffs::Panel::Repository::getall_per_group( $vhffs, $group->get_gid );
if($repos < 0) {
$panel->add_error( gettext('Unable to get repositories') );
+ $panel->build;
+ $panel->display;
} else {
- $panel->display($panel->create_service_index('repository', $repos));
+ $panel->build( $panel->create_service_index('repository', $repos) );
+ $panel->display;
}
}
Modified: trunk/vhffs-panel/svn/index.pl
===================================================================
--- trunk/vhffs-panel/svn/index.pl 2007-09-06 23:08:47 UTC (rev 870)
+++ trunk/vhffs-panel/svn/index.pl 2007-09-07 00:34:22 UTC (rev 871)
@@ -51,6 +51,7 @@
if( ! defined($group) ) {
$panel->set_title( gettext('Error') );
$panel->add_error( gettext('You have to select a group first') );
+ $panel->build;
$panel->display;
} else {
# Group is in session => access is granted for user and group is activated
@@ -59,8 +60,11 @@
my $svn = Vhffs::Panel::Svn::getall_per_group( $vhffs, $group->get_gid );
if($svn < 0) {
$panel->add_error( gettext('Unable to get SVN repositories') );
+ $panel->build;
+ $panel->display;
} else {
- $panel->display($panel->create_service_index('svn', $svn));
+ $panel->build( $panel->create_service_index('svn', $svn) );
+ $panel->display;
}
}
Modified: trunk/vhffs-panel/web/index.pl
===================================================================
--- trunk/vhffs-panel/web/index.pl 2007-09-06 23:08:47 UTC (rev 870)
+++ trunk/vhffs-panel/web/index.pl 2007-09-07 00:34:22 UTC (rev 871)
@@ -51,6 +51,7 @@
if( ! defined($group) ) {
$panel->set_title( gettext('Error') );
$panel->add_error( gettext('You have to select a group first') );
+ $panel->build;
$panel->display;
} else {
# Group is in session => access is granted for user and group is activated
@@ -59,8 +60,11 @@
my $web = Vhffs::Panel::Web::getall_per_group( $vhffs, $group->get_gid );
if($web < 0) {
$panel->add_error( gettext('Unable to get webareas') );
+ $panel->build;
+ $panel->display;
} else {
- $panel->display($panel->create_service_index('web', $web));
+ $panel->build( $panel->create_service_index('web', $web) );
+ $panel->display;
}
}