[pLog-svn] r6519 - plog/branches/lifetype-1.2/class/action/admin

mark at devel.lifetype.net mark at devel.lifetype.net
Mon Jun 9 01:57:38 EDT 2008


Author: mark
Date: 2008-06-09 01:57:38 -0400 (Mon, 09 Jun 2008)
New Revision: 6519

Modified:
   plog/branches/lifetype-1.2/class/action/admin/adminupdateglobalsettingsaction.class.php
Log:
1. blogId and show are optional.

2. There is no way to validate the config array, we just can make sure it is an array. If we want to validate the array element, then we need to know each element's type and validate them one by one.

Modified: plog/branches/lifetype-1.2/class/action/admin/adminupdateglobalsettingsaction.class.php
===================================================================
--- plog/branches/lifetype-1.2/class/action/admin/adminupdateglobalsettingsaction.class.php	2008-06-09 05:10:18 UTC (rev 6518)
+++ plog/branches/lifetype-1.2/class/action/admin/adminupdateglobalsettingsaction.class.php	2008-06-09 05:57:38 UTC (rev 6519)
@@ -4,6 +4,7 @@
     lt_include( PLOG_CLASS_PATH."class/view/admin/adminglobalsettingslistview.class.php" );
 	lt_include( PLOG_CLASS_PATH."class/data/validator/integervalidator.class.php" );
 	lt_include( PLOG_CLASS_PATH."class/data/validator/stringvalidator.class.php" );
+	lt_include( PLOG_CLASS_PATH."class/data/validator/arrayvalidator.class.php" );
 
     /**
      * \ingroup Action
@@ -22,9 +23,9 @@
 
 			$this->requireAdminPermission( "update_global_settings" );
 
-                // TODO: no validator for "config"?
-			$this->registerFieldValidator( "blogId", new IntegerValidator());
-			$this->registerFieldValidator( "show", new StringValidator());
+			$this->registerFieldValidator( "blogId", new IntegerValidator(), true);
+			$this->registerFieldValidator( "show", new StringValidator(), true);
+			$this->registerFieldValidator( "config", new ArrayValidator() );
         }
 
         function validate()



More information about the pLog-svn mailing list