use quickform rule "notcallback" now instead of our own

This commit is contained in:
Christian Weiske 2010-05-26 19:03:36 +02:00
parent 71e665fd9b
commit f4c51ccb4e

View File

@ -30,16 +30,11 @@ if (!$GLOBALS['enableRegistration']) {
require_once 'HTML/QuickForm2.php'; require_once 'HTML/QuickForm2.php';
require_once 'HTML/QuickForm2/Renderer.php'; require_once 'HTML/QuickForm2/Renderer.php';
require_once 'HTML/QuickForm2/Element/BackgroundText.php'; require_once 'HTML/QuickForm2/Element/BackgroundText.php';
require_once 'SemanticScuttle/QuickForm2/Rule/ICallback.php';
HTML_QuickForm2_Factory::registerElement( HTML_QuickForm2_Factory::registerElement(
'backgroundtext', 'backgroundtext',
'HTML_QuickForm2_Element_BackgroundText' 'HTML_QuickForm2_Element_BackgroundText'
); );
HTML_QuickForm2_Factory::registerRule(
'icallback',
'SemanticScuttle_QuickForm2_Rule_ICallback'
);
$form = new HTML_QuickForm2( $form = new HTML_QuickForm2(
'registration', 'post', 'registration', 'post',
@ -66,12 +61,12 @@ $user->addRule(
array($userservice, 'isValidUsername') array($userservice, 'isValidUsername')
); );
$user->addRule( $user->addRule(
'icallback', 'notcallback',
T_('This username has been reserved, please make another choice.'), T_('This username has been reserved, please make another choice.'),
array($userservice, 'isReserved') array($userservice, 'isReserved')
); );
$user->addRule( $user->addRule(
'icallback', 'notcallback',
T_('This username already exists, please make another choice.'), T_('This username already exists, please make another choice.'),
array($userservice, 'existsUserWithUsername') array($userservice, 'existsUserWithUsername')
); );