[vhffs-dev] [1116] Line feed in groups descriptions are now taken in account.

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


Revision: 1116
Author:   beuss
Date:     2008-01-07 17:34:18 +0000 (Mon, 07 Jan 2008)

Log Message:
-----------
Line feed in groups descriptions are now taken in account.

Modified Paths:
--------------
    trunk/vhffs-api/src/Vhffs/Panel/Group.pm
    trunk/vhffs-api/src/Vhffs/Panel/Main.pm
    trunk/vhffs-public/group.pl
    trunk/vhffs-public/templates/group.tmpl
    trunk/vhffs-public/templates/misc/groupinfo.tmpl


Modified: trunk/vhffs-api/src/Vhffs/Panel/Group.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Panel/Group.pm	2008-01-07 07:09:58 UTC (rev 1115)
+++ trunk/vhffs-api/src/Vhffs/Panel/Group.pm	2008-01-07 17:34:18 UTC (rev 1116)
@@ -214,6 +214,7 @@
     $sth->execute(@params);
     while(my $row = $sth->fetchrow_hashref) {
         $ssth->execute($row->{gid});
+        $row->{description} = Vhffs::Panel::Main::format_description($row->{description});
         $row->{users} = $ssth->fetchall_arrayref({});
         push @groups, $row;
     }

Modified: trunk/vhffs-api/src/Vhffs/Panel/Main.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Panel/Main.pm	2008-01-07 07:09:58 UTC (rev 1115)
+++ trunk/vhffs-api/src/Vhffs/Panel/Main.pm	2008-01-07 17:34:18 UTC (rev 1116)
@@ -843,4 +843,12 @@
     return $template;
 }
 
+sub format_description($) {
+    use CGI qw{escapeHTML};
+    my $description = shift;
+    $description = escapeHTML($description);
+    $description =~ s!\n!<br/>!g;
+    return $description;
+}
+
 1;

Modified: trunk/vhffs-public/group.pl
===================================================================
--- trunk/vhffs-public/group.pl	2008-01-07 07:09:58 UTC (rev 1115)
+++ trunk/vhffs-public/group.pl	2008-01-07 17:34:18 UTC (rev 1116)
@@ -91,7 +91,7 @@
     $template->param( URL_PANEL => $vhffs->get_config->get_panel->{'url'} );
     $template->param( VALUE_REALNAME => $group->get_realname );
     $template->param( VALUE_GROUPNAME => $group->get_groupname );
-    $template->param( VALUE_DESCRIPTION => $group->get_description );
+    $template->param( VALUE_DESCRIPTION => Vhffs::Panel::Main::format_description($group->get_description));
     $template->param( USERS => $group->get_users );
 
     if( $vhffs->get_config->get_service_availability('web') == 1 ) {

Modified: trunk/vhffs-public/templates/group.tmpl
===================================================================
--- trunk/vhffs-public/templates/group.tmpl	2008-01-07 07:09:58 UTC (rev 1115)
+++ trunk/vhffs-public/templates/group.tmpl	2008-01-07 17:34:18 UTC (rev 1116)
@@ -6,7 +6,7 @@
     <li><TMPL_INCLUDE NAME="user_part.tmpl"></li>
 </ul>
 <fieldset><legend><TMPL_I18N KEY="Description"></legend>
-<TMPL_VAR ESCAPE=1 NAME="VALUE_DESCRIPTION">
+<TMPL_VAR NAME="VALUE_DESCRIPTION">
 </fieldset>
 
 <TMPL_IF NAME="WEBSITES">

Modified: trunk/vhffs-public/templates/misc/groupinfo.tmpl
===================================================================
--- trunk/vhffs-public/templates/misc/groupinfo.tmpl	2008-01-07 07:09:58 UTC (rev 1115)
+++ trunk/vhffs-public/templates/misc/groupinfo.tmpl	2008-01-07 17:34:18 UTC (rev 1116)
@@ -2,5 +2,5 @@
 <ul>
 <li><TMPL_I18N KEY="Groupname">: <TMPL_VAR ESCAPE=1 NAME="GROUPNAME"></li>
 <li><TMPL_I18N KEY="Users">: <TMPL_INCLUDE NAME="../user_part.tmpl"></li>
-<li><TMPL_I18N KEY="Description">: <TMPL_VAR ESCAPE=1 NAME="DESCRIPTION"></li>
+<li><TMPL_I18N KEY="Description">: <TMPL_VAR NAME="DESCRIPTION"></li>
 </ul>


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