Merge "Sort modules in alphabetical order and leave note about this"
[lhc/web/wiklou.git] / includes / specials / SpecialUnblock.php
index 797543f..244b889 100644 (file)
@@ -63,8 +63,10 @@ class SpecialUnblock extends SpecialPage {
 
                if ( $form->show() ) {
                        switch ( $this->type ) {
-                               case Block::TYPE_USER:
                                case Block::TYPE_IP:
+                                       $out->addWikiMsg( 'unblocked-ip', wfEscapeWikiText( $this->target ) );
+                                       break;
+                               case Block::TYPE_USER:
                                        $out->addWikiMsg( 'unblocked', wfEscapeWikiText( $this->target ) );
                                        break;
                                case Block::TYPE_RANGE:
@@ -83,7 +85,7 @@ class SpecialUnblock extends SpecialPage {
                        'Target' => array(
                                'type' => 'text',
                                'label-message' => 'ipaddressorusername',
-                               'tabindex' => '1',
+                               'autofocus' => true,
                                'size' => '45',
                                'required' => true,
                        ),
@@ -111,8 +113,14 @@ class SpecialUnblock extends SpecialPage {
                                $fields['Target']['default'] = $target;
                                $fields['Target']['type'] = 'hidden';
                                switch ( $type ) {
-                                       case Block::TYPE_USER:
                                        case Block::TYPE_IP:
+                                               $fields['Name']['default'] = Linker::linkKnown(
+                                                       SpecialPage::getTitleFor( 'Contributions', $target->getName() ),
+                                                       $target->getName()
+                                               );
+                                               $fields['Name']['raw'] = true;
+                                               break;
+                                       case Block::TYPE_USER:
                                                $fields['Name']['default'] = Linker::link(
                                                        $target->getUserPage(),
                                                        $target->getName()
@@ -131,6 +139,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;