[pLog-svn] r6606 - in plog/branches/lifetype-1.2: class/action/admin templates/admin

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


Author: mark
Date: 2008-06-20 15:15:45 -0400 (Fri, 20 Jun 2008)
New Revision: 6606

Modified:
   plog/branches/lifetype-1.2/class/action/admin/adminaddarticlecategoryaction.class.php
   plog/branches/lifetype-1.2/templates/admin/newpostcategory.template
Log:
We don't need categoryUrl and properties here. Just assigned a default value for them.

Modified: plog/branches/lifetype-1.2/class/action/admin/adminaddarticlecategoryaction.class.php
===================================================================
--- plog/branches/lifetype-1.2/class/action/admin/adminaddarticlecategoryaction.class.php	2008-06-20 18:56:20 UTC (rev 6605)
+++ plog/branches/lifetype-1.2/class/action/admin/adminaddarticlecategoryaction.class.php	2008-06-20 19:15:45 UTC (rev 6606)
@@ -3,8 +3,8 @@
 	lt_include( PLOG_CLASS_PATH."class/action/admin/adminaction.class.php" );
     lt_include( PLOG_CLASS_PATH."class/dao/articlecategories.class.php" );
     lt_include( PLOG_CLASS_PATH."class/dao/articlecategory.class.php" );
-    lt_include( PLOG_CLASS_PATH."class/data/validator/stringvalidator.class.php" );
-    lt_include( PLOG_CLASS_PATH."class/data/validator/emptyvalidator.class.php" );
+    lt_include( PLOG_CLASS_PATH."class/data/validator/stringvalidator.class.php" );
+    lt_include( PLOG_CLASS_PATH."class/data/validator/integervalidator.class.php" );
 	lt_include( PLOG_CLASS_PATH."class/data/textfilter.class.php" );	
 	lt_include( PLOG_CLASS_PATH."class/view/admin/adminarticlecategorieslistview.class.php" );
 
@@ -18,9 +18,8 @@
 	{
 
     	var $_categoryName;
-        var $_categoryUrl;
-		var $_properties;
-		var $_categoryDescription;
+		var $_categoryDescription;
+		var $_categoryInMainPage;
 
     	/**
          * Constructor. If nothing else, it also has to call the constructor of the parent
@@ -33,11 +32,9 @@
 			// register two validators
 			$this->registerFieldValidator( "categoryName", new StringValidator());
 			$this->registerFieldValidator( "categoryDescription", new StringValidator());
-			$this->registerFieldValidator( "categoryInMainPage", new IntegerValidator());
-
-                // TODO: validate properties and categoryUrl
- 
-                // and the view we should show in case there is a validation error
+			$this->registerFieldValidator( "categoryInMainPage", new IntegerValidator(), true );
+
+			// and the view we should show in case there is a validation error
 			$errorView = new AdminTemplatedView( $this->_blogInfo, "newpostcategory" );
 			$errorView->setErrorMessage( $this->_locale->tr("error_adding_article_category" ));			
 			$this->setValidationErrorView( $errorView );
@@ -53,20 +50,18 @@
         {
 			// fetch the data, we already know it's valid and that we can trust it!
         	$this->_categoryName     = Textfilter::filterAllHTML($this->_request->getValue( "categoryName" ));
-            $this->_categoryUrl      = $this->_request->getValue( "categoryUrl" );
             $this->_categoryInMainPage = Textfilter::checkboxToBoolean($this->_request->getValue( "categoryInMainPage" ));
 			$this->_categoryDescription = Textfilter::filterAllHTML($this->_request->getValue( "categoryDescription" ));
-			$this->_properties = $this->_request->getValue( "properties" );		
 		
 			// create the object...
             $categories = new ArticleCategories();
             $category   = new ArticleCategory( $this->_categoryName,
-                                               $this->_categoryUrl,
+                                               "",
                                                $this->_blogInfo->getId(),
                                                $this->_categoryInMainPage,
 											   $this->_categoryDescription,
 											   0,
-											   $this->_properties );
+											   Array() );
 											   
 			// fire the pre event...
 			$this->notifyEvent( EVENT_PRE_CATEGORY_ADD, Array( "category" => &$category ));

Modified: plog/branches/lifetype-1.2/templates/admin/newpostcategory.template
===================================================================
--- plog/branches/lifetype-1.2/templates/admin/newpostcategory.template	2008-06-20 18:56:20 UTC (rev 6605)
+++ plog/branches/lifetype-1.2/templates/admin/newpostcategory.template	2008-06-20 19:15:45 UTC (rev 6606)
@@ -31,7 +31,6 @@
    </div>   
   </fieldset>
   <div class="buttons">
-   <input type="hidden" value="" name="categoryUrl" />
    <input type="hidden" name="op" value="addArticleCategory" />
    <input type="reset" name="Reset" value="{$locale->tr("reset")}" />
    <input type="submit" name="Add" value="{$locale->tr("add")}" />



More information about the pLog-svn mailing list