Merge "Remove getFormFields(), onSubmit() and onSuccess() from FormlessAction"
[lhc/web/wiklou.git] / includes / specials / SpecialUnblock.php
index 3a2b0c6..96e4dbf 100644 (file)
@@ -82,14 +82,14 @@ class SpecialUnblock extends SpecialPage {
                $fields = array(
                        'Target' => array(
                                'type' => 'text',
-                               'label-message' => 'ipadressorusername',
-                               'tabindex' => '1',
+                               'label-message' => 'ipaddressorusername',
+                               'autofocus' => true,
                                'size' => '45',
                                'required' => true,
                        ),
                        'Name' => array(
                                'type' => 'info',
-                               'label-message' => 'ipadressorusername',
+                               'label-message' => 'ipaddressorusername',
                        ),
                        'Reason' => array(
                                'type' => 'text',
@@ -131,6 +131,9 @@ class SpecialUnblock extends SpecialPage {
                                                $fields['Target']['default'] = "#{$this->target}";
                                                break;
                                }
+                               // target is hidden, so the reason is the first element
+                               $fields['Target']['autofocus'] = false;
+                               $fields['Reason']['autofocus'] = true;
                        }
                } else {
                        $fields['Target']['default'] = $this->target;
@@ -144,7 +147,7 @@ class SpecialUnblock extends SpecialPage {
         * Submit callback for an HTMLForm object
         * @param array $data
         * @param HTMLForm $form
-        * @return Array( Array(message key, parameters)
+        * @return array|bool Array(message key, parameters)
         */
        public static function processUIUnblock( array $data, HTMLForm $form ) {
                return self::processUnblock( $data, $form->getContext() );
@@ -153,10 +156,10 @@ class SpecialUnblock extends SpecialPage {
        /**
         * Process the form
         *
-        * @param $data Array
-        * @param $context IContextSource
+        * @param array $data
+        * @param IContextSource $context
         * @throws ErrorPageError
-        * @return Array( Array(message key, parameters) ) on failure, True on success
+        * @return array|bool Array(message key, parameters) on failure, True on success
         */
        public static function processUnblock( array $data, IContextSource $context ) {
                $performer = $context->getUser();