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

mark at devel.lifetype.net mark at devel.lifetype.net
Thu Jun 19 02:21:14 EDT 2008


Author: mark
Date: 2008-06-19 02:21:14 -0400 (Thu, 19 Jun 2008)
New Revision: 6584

Modified:
   plog/branches/lifetype-1.2/class/action/admin/admineditglobalarticlecategoriesaction.class.php
Log:
Validate the searchTerms.

Modified: plog/branches/lifetype-1.2/class/action/admin/admineditglobalarticlecategoriesaction.class.php
===================================================================
--- plog/branches/lifetype-1.2/class/action/admin/admineditglobalarticlecategoriesaction.class.php	2008-06-19 06:20:15 UTC (rev 6583)
+++ plog/branches/lifetype-1.2/class/action/admin/admineditglobalarticlecategoriesaction.class.php	2008-06-19 06:21:14 UTC (rev 6584)
@@ -5,7 +5,8 @@
      * Changed from original article category.
      */
 	lt_include( PLOG_CLASS_PATH."class/action/admin/adminaction.class.php" );
-    lt_include( PLOG_CLASS_PATH."class/view/admin/adminglobalarticlecategorieslistview.class.php" );
+    lt_include( PLOG_CLASS_PATH."class/view/admin/adminglobalarticlecategorieslistview.class.php" );
+	lt_include( PLOG_CLASS_PATH."class/data/validator/stringvalidator.class.php" );
 	lt_include( PLOG_CLASS_PATH."class/data/filter/htmlfilter.class.php" );
 
     /**
@@ -25,7 +26,10 @@
         {
         	$this->AdminAction( $actionInfo, $request );
 			
-			$this->_searchTerms = $this->_request->getFilteredValue( "searchTerms", new HtmlFilter());
+			$this->registerFieldValidator( "searchTerms", new StringValidator(), true);
+			$this->setValidationErrorView( new AdminGlobalArticleCategoriesListView( $this->_blogInfo, 
+                                                                                     Array( "searchTerms" => "" ) 
+                                                                                   ) );
 			
 			$this->requireAdminPermission( "view_global_categories" );
         }
@@ -35,12 +39,13 @@
          */
         function perform()
         {
+        	$searchTerms = $this->_request->getFilteredValue( "searchTerms", new HtmlFilter() );
         	// create the view, which will take care of fetching the right data
-        	$this->_view = new AdminGlobalArticleCategoriesListView( $this->_blogInfo, Array( "searchTerms" => $this->_searchTerms ));
+        	$this->_view = new AdminGlobalArticleCategoriesListView( $this->_blogInfo, Array( "searchTerms" => $searchTerms ));
             $this->setCommonData();
 
             // better to return true if everything fine
             return true;
         }
     }
-?>
+?>
\ No newline at end of file



More information about the pLog-svn mailing list