Remove useless method overriding
[lhc/web/wiklou.git] / includes / specials / SpecialUndelete.php
index 0e8cf58..d4aed11 100644 (file)
@@ -271,7 +271,7 @@ class PageArchive {
        /**
         * Get the text from an archive row containing ar_text, ar_flags and ar_text_id
         *
-        * @param Object $row Database row
+        * @param object $row Database row
         * @return string
         */
        function getTextFromRow( $row ) {
@@ -760,7 +760,7 @@ class SpecialUndelete extends SpecialPage {
 
                if ( $this->mTimestamp !== '' ) {
                        $this->showRevision( $this->mTimestamp );
-               } elseif ( $this->mFilename !== null ) {
+               } elseif ( $this->mFilename !== null && $this->mTargetObj->inNamespace( NS_FILE ) ) {
                        $file = new ArchivedFile( $this->mTargetObj, '', $this->mFilename );
                        // Check if user is allowed to see this file
                        if ( !$file->exists() ) {
@@ -792,12 +792,16 @@ class SpecialUndelete extends SpecialPage {
                        Xml::openElement( 'form', array( 'method' => 'get', 'action' => $wgScript ) ) .
                                Xml::fieldset( $this->msg( 'undelete-search-box' )->text() ) .
                                Html::hidden( 'title', $this->getTitle()->getPrefixedDBkey() ) .
-                               Xml::inputLabel(
-                                       $this->msg( 'undelete-search-prefix' )->text(),
-                                       'prefix',
+                               Html::rawElement(
+                                       'label',
+                                       array( 'for' => 'prefix' ),
+                                       $this->msg( 'undelete-search-prefix' )->parse()
+                               ) .
+                               Xml::input(
                                        'prefix',
                                        20,
-                                       $this->mSearchPrefix
+                                       $this->mSearchPrefix,
+                                       array( 'id' => 'prefix', 'autofocus' => true )
                                ) . ' ' .
                                Xml::submitButton( $this->msg( 'undelete-search-submit' )->text() ) .
                                Xml::closeElement( 'fieldset' ) .
@@ -1115,10 +1119,11 @@ class SpecialUndelete extends SpecialPage {
                $out->addHTML(
                        Xml::openElement( 'form', array(
                                        'method' => 'POST',
-                                       'action' => $this->getTitle()->getLocalURL(
-                                               'target=' . urlencode( $this->mTarget ) .
-                                                       '&file=' . urlencode( $key ) .
-                                                       '&token=' . urlencode( $user->getEditToken( $key ) ) )
+                                       'action' => $this->getTitle()->getLocalURL( array(
+                                               'target' => $this->mTarget,
+                                               'file' => $key,
+                                               'token' => $user->getEditToken( $key ),
+                                       ) ),
                                )
                        ) .
                                Xml::submitButton( $this->msg( 'undelete-show-file-submit' )->text() ) .
@@ -1251,7 +1256,7 @@ class SpecialUndelete extends SpecialPage {
                                        Xml::label( $this->msg( 'undeletecomment' )->text(), 'wpComment' ) .
                                        "</td>
                                        <td class='mw-input'>" .
-                                       Xml::input( 'wpComment', 50, $this->mComment, array( 'id' => 'wpComment' ) ) .
+                                       Xml::input( 'wpComment', 50, $this->mComment, array( 'id' => 'wpComment', 'autofocus' => true ) ) .
                                        "</td>
                                </tr>
                                <tr>