[vhffs-dev] [1727] No more HTML::Template in web/delete.pl

[ Thread Index | Date Index | More vhffs.org/vhffs-dev Archives ]


Revision: 1727
Author:   beuss
Date:     2011-05-14 13:13:29 +0200 (Sat, 14 May 2011)
Log Message:
-----------
No more HTML::Template in web/delete.pl

Modified Paths:
--------------
    trunk/vhffs-panel/web/delete.pl

Modified: trunk/vhffs-panel/web/delete.pl
===================================================================
--- trunk/vhffs-panel/web/delete.pl	2011-05-14 11:13:22 UTC (rev 1726)
+++ trunk/vhffs-panel/web/delete.pl	2011-05-14 11:13:29 UTC (rev 1727)
@@ -32,7 +32,6 @@
 
 use utf8;
 use POSIX qw(locale_h);
-use HTML::Template;
 use locale;
 use Locale::gettext;
 use CGI;
@@ -40,14 +39,10 @@
 use strict;
 
 use lib '%VHFFS_LIB_DIR%';
-use Vhffs::User;
 use Vhffs::Main;
 use Vhffs::Group;
 use Vhffs::Panel::Main;
-use Vhffs::Panel::Menu;
-use Vhffs::Panel::Group;
 use Vhffs::Services::Web;
-use Vhffs::Acl;
 
 my $panel = new Vhffs::Panel::Main();
 exit 0 unless $panel;
@@ -72,39 +67,24 @@
 my $web = Vhffs::Services::Web::get_by_servername( $vhffs , $servername );
 my $group = Vhffs::Group::get_by_gid( $vhffs , $web->{'owner_gid'} );
 
-if( ! defined( $web ) ) 
-{
+if( ! defined( $web ) ) {
     $message = gettext("This web area doesn't exist in VHFFS database");
-}
-elsif( !$user->can_delete( $web ) )
-{
+} elsif( !$user->can_delete( $web ) ) {
 	$message = gettext( 'You\'re not allowed to do this, object is not in active state or you don\'t have enough ACL rights' );
-}
-else
-{
-	if( $delete == 1 )
-	{
+} else {
+	if( $delete == 1 ) {
 		$web->set_status( Vhffs::Constants::TO_DELETE );
-		if( $web->commit < 0 )
-		{
+		if( $web->commit < 0 ) {
 			$message = gettext("An error occured while applying changes. This web area will NOT be deleted");
-		}
-		else
-		{
+		} else {
 			$message = gettext("This object will BE DELETED");
 		}
+	} else {
+		$message = gettext("This object will NOT be DELETED");
 	}
-	else
-	{
-			$message = gettext("This object will NOT be DELETED");
-		
-	}
 }
 
-
-my $template = new HTML::Template( filename => $templatedir."/panel/misc/simplemsg.tmpl" );
-$template->param( MESSAGE => $message );
-
-$panel->set_refresh_url( '/group/view.pl?group='.$group->get_groupname );
-$panel->build( $template );
-$panel->display;
+$panel->render('misc/message.tt', {
+    message => $message,
+    refresh_url => '/group/view.pl?group='.$group->get_groupname
+});


Mail converted by MHonArc 2.6.19+ http://listengine.tuxfamily.org/