]> dev.renevier.net Git - syj.git/blobdiff - application/forms/User.php
add tabinbex attributes to anchors inside label otherwise they're not keyboard access...
[syj.git] / application / forms / User.php
index b74258abd41148369fad6a05306b50ba513a92b2..ad381d7ae3afe7bf25ed87f6b2bb62f23279e006 100644 (file)
@@ -1,5 +1,5 @@
 <?php
-/*  This file is part of Syj, Copyright (c) 2010 Arnaud Renevier,
+/*  This file is part of Syj, Copyright (c) 2010-2011 Arnaud Renevier,
     and is published under the AGPL license. */
 
 class Syj_Form_User extends Syj_Form_TableAbstract
@@ -7,9 +7,11 @@ class Syj_Form_User extends Syj_Form_TableAbstract
     public function init() {
         $translator = $this->getTranslator();
 
+        $desc = $translator->translate("only letters, numbers, underscores or dots");
         $name = array('Text', 'user_pseudo', array(
             'label' => __("user name"),
-            'attribs' => array('maxlength' => '20'),
+            'attribs' => array('maxlength' => '20', 'autocomplete' => 'off'),
+            'description' => $desc,
             'validators' => array(new Zend_Validate_StringLength(0, 20),
                                  new Zend_Validate_Regex('/^[a-zA-Z0-9_\.]+$/')),
             'required' => true
@@ -32,20 +34,23 @@ class Syj_Form_User extends Syj_Form_TableAbstract
 
         $email = array('Text', 'user_email', array(
             'label' => __("email"),
-            'description' => __("After creating your account, you will receive a confirmation email. You have 7 days to confirm otherwise, your account and your routes will all be deleted."),
+            'description' => __("After creating your account, you will receive a confirmation email. You have 7 days to confirm otherwise, your account will be deleted."),
             'required' => true
             ));
 
         $this->setMainElements(array($name, $pass, $pass_confirm, $email));
 
-        $anchor = $this->getView()->Anchor("termsofuse", $translator->translate("terms of use"), array('id' => 'user_termsofuse_anchor'));
+        $anchor = $this->getView()->Anchor("termsofuse?format=raw",
+                                           $translator->translate("terms of use"),
+                                           array('id' => 'user_termsofuse_anchor', 'tabindex' => '0'));
         $text = $translator->translate("I've read and accepted %s");
         $text = vsprintf($text, $anchor);
         $this->addElement('Checkbox', 'user_accept', array("label" => $text,
+                            'helper' => 'SyjFormCheckbox', // similar to FormCheckbox without a hidden input
                             'decorators' => array(
                                   'ViewHelper',
                                   'label',
-                                  array('HtmlTag', array('tag' => 'div'))),
+                                  array('HtmlTag', array('tag' => 'div', 'id' => 'user_accept_container'))),
                             'validators' => array(new Zend_Validate_Identical('1'))));
 
         $decorator = $this->user_accept->getDecorator('Zend_Form_Decorator_Label');