[Pieforms-commit] SF.net SVN: pieforms: [109] pieforms-php5/trunk/src/pieform/rules/required. php
Status: Alpha
Brought to you by:
oracleshinoda
From: <ora...@us...> - 2006-12-23 03:47:07
|
Revision: 109 http://svn.sourceforge.net/pieforms/?rev=109&view=rev Author: oracleshinoda Date: 2006-12-22 19:47:04 -0800 (Fri, 22 Dec 2006) Log Message: ----------- Use new i18n API for required rule Modified Paths: -------------- pieforms-php5/trunk/src/pieform/rules/required.php Modified: pieforms-php5/trunk/src/pieform/rules/required.php =================================================================== --- pieforms-php5/trunk/src/pieform/rules/required.php 2006-12-23 03:46:16 UTC (rev 108) +++ pieforms-php5/trunk/src/pieform/rules/required.php 2006-12-23 03:47:04 UTC (rev 109) @@ -28,7 +28,7 @@ * Checks whether the field has been specified. * * @param Pieform $form The form the rule is being applied to - * @param string $field The field to check + * @param string $value The value of the field * @param array $element The element to check * @param string $check Whether to check the element * @return string The error message, if the value is invalid. @@ -38,15 +38,23 @@ $function = 'form_is_empty_' . $element['type']; if (function_exists($function)) { if ($function($value, $element)) { - return $form->i18n('required'); + return $form->i18n('rule', 'required', 'required', $element); } return; } if ($value == '') { - return $form->i18n('required'); + return $form->i18n('rule', 'required', 'required', $element); } } } +function pieform_rule_required_i18n() { + return array( + 'en.utf8' => array( + 'required' => 'This field is required' + ) + ); +} + ?> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |