[pLog-svn] r6603 - plog/branches/lifetype-1.2/class/action/admin
mark at devel.lifetype.net
mark at devel.lifetype.net
Fri Jun 20 14:48:54 EDT 2008
Author: mark
Date: 2008-06-20 14:48:54 -0400 (Fri, 20 Jun 2008)
New Revision: 6603
Modified:
plog/branches/lifetype-1.2/class/action/admin/adminaddcustomfieldaction.class.php
Log:
Add validator to fieldValues and remove un-used fieldId
Modified: plog/branches/lifetype-1.2/class/action/admin/adminaddcustomfieldaction.class.php
===================================================================
--- plog/branches/lifetype-1.2/class/action/admin/adminaddcustomfieldaction.class.php 2008-06-20 18:39:49 UTC (rev 6602)
+++ plog/branches/lifetype-1.2/class/action/admin/adminaddcustomfieldaction.class.php 2008-06-20 18:48:54 UTC (rev 6603)
@@ -3,7 +3,8 @@
lt_include( PLOG_CLASS_PATH."class/action/admin/adminaction.class.php" );
lt_include( PLOG_CLASS_PATH."class/data/validator/stringvalidator.class.php" );
lt_include( PLOG_CLASS_PATH."class/dao/customfields/customfields.class.php" );
- lt_include( PLOG_CLASS_PATH."class/data/validator/integervalidator.class.php" );
+ lt_include( PLOG_CLASS_PATH."class/data/validator/integervalidator.class.php" );
+ lt_include( PLOG_CLASS_PATH."class/data/validator/arrayvalidator.class.php" );
lt_include( PLOG_CLASS_PATH."class/data/validator/stringvalidator.class.php" );
lt_include( PLOG_CLASS_PATH."class/view/admin/admintemplatedview.class.php" );
lt_include( PLOG_CLASS_PATH."class/view/admin/admincustomfieldslistview.class.php" );
@@ -31,12 +32,9 @@
$this->registerFieldValidator( "fieldName", new StringValidator());
$this->registerFieldValidator( "fieldDescription", new StringValidator());
$this->registerFieldValidator( "fieldType", new IntegerValidator());
- $this->registerFieldValidator( "fieldSearchable", new IntegerValidator() );
- $this->registerFieldValidator( "fieldHidden", new IntegerValidator());
- // TODO: not used? Validate if it is
- $this->_form->registerField( "fieldId" );
- // TODO: validate this - maybe with ArrayValidator and third parameter set to true?
- $this->_form->registerField( "fieldValues" );
+ $this->registerFieldValidator( "fieldSearchable", new IntegerValidator(), true );
+ $this->registerFieldValidator( "fieldHidden", new IntegerValidator(), true );
+ $this->registerFieldValidator( "fieldValues", new ArrayValidator( new StringValidator() ), true );
$view = new AdminTemplatedView( $this->_blogInfo, "newcustomfield" );
$view->setErrorMessage( $this->_locale->tr("error_adding_custom_field"));
$this->setValidationErrorView( $view );
More information about the pLog-svn
mailing list