HTMLForm: Use <button> and allow differing label and value
[lhc/web/wiklou.git] / includes / specials / SpecialUserrights.php
index a6fe1b5..ea22274 100644 (file)
@@ -117,6 +117,11 @@ class UserrightsPage extends SpecialPage {
                $fetchedStatus = $this->fetchUser( $this->mTarget );
                if ( $fetchedStatus->isOk() ) {
                        $this->mFetchedUser = $fetchedStatus->value;
+                       if ( $this->mFetchedUser instanceof User ) {
+                               // Set the 'relevant user' in the skin, so it displays links like Contributions,
+                               // User logs, UserRights, etc.
+                               $this->getSkin()->setRelevantUser( $this->mFetchedUser );
+                       }
                }
 
                if ( !$this->userCanChangeRights( $user, true ) ) {
@@ -458,8 +463,10 @@ class UserrightsPage extends SpecialPage {
                                30,
                                str_replace( '_', ' ', $this->mTarget ),
                                array(
-                                       'autofocus' => '',
                                        'class' => 'mw-autocomplete-user', // used by mediawiki.userSuggest
+                               ) + (
+                                       // Set autofocus on blank input and error input
+                                       $this->mFetchedUser === null ? array( 'autofocus' => '' ) : array()
                                )
                        ) . ' ' .
                        Xml::submitButton( $this->msg( 'editusergroup' )->text() ) .