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

mark at devel.lifetype.net mark at devel.lifetype.net
Fri Jun 20 15:24:11 EDT 2008


Author: mark
Date: 2008-06-20 15:24:10 -0400 (Fri, 20 Jun 2008)
New Revision: 6608

Modified:
   plog/branches/lifetype-1.2/class/action/admin/chooser/adminuserpictureselectaction.class.php
Log:
Validate the albumId

Modified: plog/branches/lifetype-1.2/class/action/admin/chooser/adminuserpictureselectaction.class.php
===================================================================
--- plog/branches/lifetype-1.2/class/action/admin/chooser/adminuserpictureselectaction.class.php	2008-06-20 19:16:40 UTC (rev 6607)
+++ plog/branches/lifetype-1.2/class/action/admin/chooser/adminuserpictureselectaction.class.php	2008-06-20 19:24:10 UTC (rev 6608)
@@ -21,20 +21,14 @@
          */
         function AdminUserPictureSelectAction( $actionInfo, $request )
         {
-        	$this->AdminAction( $actionInfo, $request );
+        	$this->AdminAction( $actionInfo, $request );
+        	$this->registerFieldValue( "albumId", new IntegerValidator(), true );
+
+        	// and the view we should show in case there is a validation error
+			$view = new AdminUserPictureSelectView( $this->_blogInfo );
+			$this->setValidationErrorView( $view );
         }
-		
-		function validate()
-		{
-			// if the album id is not vald, let's start from the top album again
-			$this->_albumId = $this->_request->getValue( "albumId" );
-			$val = new IntegerValidator();
-			if( !$val->validate( $this->_albumId ))
-				$this->_albumId = 0;
-			
-			return true;
-		}
-		
+
         /**
 			* Carries out the specified action
          */



More information about the pLog-svn mailing list