Author: jablko
Date: Sat Oct 16 20:05:52 2010
New Revision: 8184
Log:
Move values close to validators
Modified:
trunk/apps/qubit/modules/function/actions/indexAction.class.php
Modified: trunk/apps/qubit/modules/function/actions/indexAction.class.php
==============================================================================
--- trunk/apps/qubit/modules/function/actions/indexAction.class.php Sat Oct
16 19:59:01 2010 (r8183)
+++ trunk/apps/qubit/modules/function/actions/indexAction.class.php Sat Oct
16 20:05:52 2010 (r8184)
@@ -63,22 +63,26 @@
if (QubitAcl::check($this->resource, 'update'))
{
$validatorSchema = new sfValidatorSchema;
+ $values = array();
+
$validatorSchema->type = new sfValidatorString(array(
'required' => true), array(
'required' => $this->context->i18n->__('%1%Type%2% - This is a
%3%mandatory%4% element.', array('%1%' => '<a
href="http://ica-atom.org/doc/RS-4#Type_of_description">', '%2%' => '</a>',
'%3%' => '<a href="http://ica-atom.org/doc/RS-4#Structure_and_use_4.7">', '%4%'
=> '</a>'))));
+ $values['type'] = $resource->type;
+
$validatorSchema->authorizedFormOfName = new sfValidatorString(array(
'required' => true), array(
'required' => $this->context->i18n->__('%1%Authorized form of name%2%
- This is a %3%mandatory%4% element.', array('%1%' => '<a
href="http://ica-atom.org/doc/RS-4#Authorised_name">', '%2%' => '</a>', '%3%'
=> '<a href="http://ica-atom.org/doc/RS-4#Structure_and_use_4.7">', '%4%' =>
'</a>'))));
+ $values['authorizedFormOfName'] =
$this->resource->getAuthorizedFormOfName(array('cultureFallback' => true));
+
$validatorSchema->descriptionIdentifier = new sfValidatorString(array(
'required' => true), array(
'required' => $this->context->i18n->__('%1%Description identifier%2% -
This is a %3%mandatory%4% element.', array('%1%' => '<a
href="http://ica-atom.org/doc/RS-4#Function.2Factivity_description_identifier">',
'%2%' => '</a>', '%3%' => '<a
href="http://ica-atom.org/doc/RS-4#Structure_and_use_4.7">', '%4%' =>
'</a>'))));
+ $values['descriptionIdentifier'] =
$this->resource->descriptionIdentifier;
try
{
- $validatorSchema->clean(array(
- 'type' => $this->resource->type,
- 'authorizedFormOfName' =>
$this->resource->getAuthorizedFormOfName(array('cultureFallback' => true)),
- 'descriptionIdentifier' => $this->resource->descriptionIdentifier));
+ $validatorSchema->clean($values);
}
catch (sfValidatorErrorSchema $e)
{
--
You received this message because you are subscribed to the Google Groups
"Qubit Toolkit Commits" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to
[email protected].
For more options, visit this group at
http://groups.google.com/group/qubit-commits?hl=en.