[vhffs-dev] [1717] Template can access to more constants.

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


Revision: 1717
Author:   beuss
Date:     2011-05-14 10:12:47 +0200 (Sat, 14 May 2011)
Log Message:
-----------
Template can access to more constants.

Also added template filter to get status string from an object status
code.

Modified Paths:
--------------
    trunk/vhffs-api/src/Vhffs/Panel/Main.pm

Modified: trunk/vhffs-api/src/Vhffs/Panel/Main.pm
===================================================================
--- trunk/vhffs-api/src/Vhffs/Panel/Main.pm	2011-05-14 08:11:57 UTC (rev 1716)
+++ trunk/vhffs-api/src/Vhffs/Panel/Main.pm	2011-05-14 08:12:47 UTC (rev 1717)
@@ -20,6 +20,7 @@
 use Vhffs::Main;
 use Vhffs::User;
 use Vhffs::Group;
+use Vhffs::Functions;
 use Vhffs::Panel::Menu;
 use Vhffs::Panel::User;
 use Vhffs::Panel::Commons;
@@ -729,6 +730,11 @@
                 MODIFICATION_ERROR          => Vhffs::Constants::MODIFICATION_ERROR,
                 MODIFICATION_APPLIED        => Vhffs::Constants::MODIFICATION_APPLIED,
                 TO_DELETE                   => Vhffs::Constants::TO_DELETE
+            },
+            user_permissions => {
+                NORMAL                      => Vhffs::Constants::USER_NORMAL,
+                MODERATOR                   => Vhffs::Constants::USER_MODERATOR,
+                ADMIN                       => Vhffs::Constants::USER_ADMIN
             }
         },
 		FILTERS => {
@@ -746,8 +752,12 @@
 					my $format = shift;
 					return sprintf($format, @args);
 				}
-			}, 1]
-		}
+			}, 1],
+            stringify_status => sub {
+                return Vhffs::Functions::status_string_from_status_id( $_[0] );
+            }
+		},
+        PRE_CHOMP => 1
 	};
 	
 	


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