[vhffs-dev] [1687] alert_submit.pl now uses Template::Toolkit |
[ Thread Index |
Date Index
| More vhffs.org/vhffs-dev Archives
]
Revision: 1687
Author: beuss
Date: 2011-05-01 17:15:12 +0200 (Sun, 01 May 2011)
Log Message:
-----------
alert_submit.pl now uses Template::Toolkit
Modified Paths:
--------------
trunk/vhffs-panel/alert_submit.pl
Modified: trunk/vhffs-panel/alert_submit.pl
===================================================================
--- trunk/vhffs-panel/alert_submit.pl 2011-05-01 15:15:05 UTC (rev 1686)
+++ trunk/vhffs-panel/alert_submit.pl 2011-05-01 15:15:12 UTC (rev 1687)
@@ -32,7 +32,6 @@
use strict;
use utf8;
use POSIX qw(locale_h);
-use HTML::Template;
use locale;
use Locale::gettext;
use CGI;
@@ -53,9 +52,8 @@
my $vhffs = $panel->{'vhffs'};
my $user = $panel->{'user'};
my $cgi = $panel->{'cgi'};
-my $templatedir = $panel->{'templatedir'};
-my $template = new HTML::Template( filename => $templatedir.'/panel/misc/simplemsg.tmpl' );
+my $vars = {};
if( defined $cgi->param('SUBJECT') && defined $cgi->param('MESSAGE') )
{
@@ -65,12 +63,11 @@
my $message = gettext('Message sent by the following account').': '.$user->get_username."\n\n".Encode::decode_utf8( $cgi->param('MESSAGE') );
Vhffs::Functions::send_mail( $vhffs , $from , $to , undef , $subject , $message );
- $template->param( MESSAGE => gettext('Message sent successfully') );
+ $vars->{message} = gettext('Message sent successfully');
}
else
{
- $template->param( MESSAGE => gettext('Cannot send message, CGI error...') );
+ $vars->{message} = gettext('Cannot send message, CGI error...');
}
-$panel->build( $template );
-$panel->display;
+$panel->render('misc/message.tt', $vars);