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

mark at devel.lifetype.net mark at devel.lifetype.net
Mon Jun 9 04:08:04 EDT 2008


Author: mark
Date: 2008-06-09 04:08:04 -0400 (Mon, 09 Jun 2008)
New Revision: 6527

Modified:
   plog/branches/lifetype-1.2/class/action/admin/adminupdatearticlecategoryaction.class.php
Log:
1. We don't need properties since we never use it.
2. Use integervalidator to validate categoryInMainPage with $OnlyIfAvailable = true.

Modified: plog/branches/lifetype-1.2/class/action/admin/adminupdatearticlecategoryaction.class.php
===================================================================
--- plog/branches/lifetype-1.2/class/action/admin/adminupdatearticlecategoryaction.class.php	2008-06-09 08:06:31 UTC (rev 6526)
+++ plog/branches/lifetype-1.2/class/action/admin/adminupdatearticlecategoryaction.class.php	2008-06-09 08:08:04 UTC (rev 6527)
@@ -23,7 +23,6 @@
         var $_categoryId;
 		var $_categoryDescription;
         var $_categoryInMainPage;
-		var $_properties;
 
     	/**
          * Constructor. If nothing else, it also has to call the constructor of the parent
@@ -37,8 +36,7 @@
 			$this->registerFieldValidator( "categoryName", new StringValidator());
 			$this->registerFieldValidator( "categoryId", new IntegerValidator());
 			$this->registerFieldValidator( "categoryDescription", new StringValidator());
-                // TODO: integer?
-			$this->registerFieldValidator( "categoryInMainPage", new IntegerValidator());
+			$this->registerFieldValidator( "categoryInMainPage", new IntegerValidator(), true );
 			$errorView = new AdminTemplatedView( $this->_blogInfo, "editarticlecategory" );
 			$errorView->setErrorMessage( $this->_locale->tr("error_updating_article_category" ));
 			$this->setValidationErrorView( $errorView );
@@ -55,8 +53,7 @@
         	$this->_categoryName = Textfilter::filterAllHTML($this->_request->getValue( "categoryName" ));
             $this->_categoryId   = $this->_request->getValue( "categoryId" );
 			$this->_categoryDescription = Textfilter::filterAllHTML($this->_request->getValue( "categoryDescription" ));
-            $this->_categoryInMainPage = $this->_request->getValue( "categoryInMainPage" );
-			$this->_properties = Array();		
+            $this->_categoryInMainPage = ( $this->_request->getValue( "categoryInMainPage" ) != "" );
 		
         	// fetch the category we're trying to update
             $categories = new ArticleCategories();
@@ -77,7 +74,6 @@
             $category->setMangledName( $this->_categoryName, true );
             $category->setUrl( "" );
             $category->setInMainPage( $this->_categoryInMainPage );
-			$category->setProperties( $this->_properties );
 			$category->setDescription( $this->_categoryDescription );
 			
 			if( $this->userHasPermission( "view_categories" ))



More information about the pLog-svn mailing list