Merge "Improve "selfmove" message's wording"
[lhc/web/wiklou.git] / includes / specials / SpecialUndelete.php
index e6e9400..740207d 100644 (file)
@@ -235,7 +235,7 @@ class SpecialUndelete extends SpecialPage {
        function showSearchForm() {
                $out = $this->getOutput();
                $out->setPageTitle( $this->msg( 'undelete-search-title' ) );
-               $fuzzySearch = $this->getRequest()->getVal( 'fuzzy', false );
+               $fuzzySearch = $this->getRequest()->getVal( 'fuzzy', true );
 
                $out->enableOOUI();
 
@@ -277,7 +277,7 @@ class SpecialUndelete extends SpecialPage {
                        $fieldset,
                        new OOUI\HtmlSnippet(
                                Html::hidden( 'title', $this->getPageTitle()->getPrefixedDBkey() ) .
-                               Html::hidden( 'fuzzy', $this->getRequest()->getVal( 'fuzzy' ) )
+                               Html::hidden( 'fuzzy', $fuzzySearch )
                        )
                );
 
@@ -669,13 +669,7 @@ class SpecialUndelete extends SpecialPage {
 
                $archive = new PageArchive( $this->mTargetObj, $this->getConfig() );
                Hooks::run( 'UndeleteForm::showHistory', [ &$archive, $this->mTargetObj ] );
-               /*
-               $text = $archive->getLastRevisionText();
-               if( is_null( $text ) ) {
-                       $out->addWikiMsg( 'nohistory' );
-                       return;
-               }
-               */
+
                $out->addHTML( '<div class="mw-undelete-history">' );
                if ( $this->mAllowed ) {
                        $out->addWikiMsg( 'undeletehistory' );
@@ -713,6 +707,8 @@ class SpecialUndelete extends SpecialPage {
                }
 
                if ( $this->mAllowed ) {
+                       $out->enableOOUI();
+
                        $action = $this->getPageTitle()->getLocalURL( [ 'action' => 'submit' ] );
                        # Start the form here
                        $form = new OOUI\FormLayout( [
@@ -734,8 +730,6 @@ class SpecialUndelete extends SpecialPage {
                }
 
                if ( $this->mAllowed && ( $haveRevisions || $haveFiles ) ) {
-                       $out->enableOOUI();
-
                        $fields[] = new OOUI\Layout( [
                                'content' => new OOUI\HtmlSnippet( $this->msg( 'undeleteextrahelp' )->parseAsBlock() )
                        ] );
@@ -857,13 +851,13 @@ class SpecialUndelete extends SpecialPage {
                        # Slip in the hidden controls here
                        $misc = Html::hidden( 'target', $this->mTarget );
                        $misc .= Html::hidden( 'wpEditToken', $this->getUser()->getEditToken() );
-                       $misc .= Xml::closeElement( 'form' );
                        $history .= $misc;
-               }
 
-               $form->appendContent( new OOUI\HtmlSnippet( $history ) );
-
-               $out->addHTML( $form );
+                       $form->appendContent( new OOUI\HtmlSnippet( $history ) );
+                       $out->addHTML( $form );
+               } else {
+                       $out->addHTML( $history );
+               }
 
                return true;
        }