Index: trunk/extensions/WikimediaIncubator/SpecialSearchWiki.php |
— | — | @@ -29,10 +29,12 @@ |
30 | 30 | $languageQuery = $this->getRequest()->getText( 'searchlanguage', isset( $subpage[1] ) ? $subpage[1] : '' ); |
31 | 31 | |
32 | 32 | # Show form |
| 33 | + $uselang = $this->getRequest()->getVal( 'uselang' ); |
33 | 34 | $this->getOutput()->addHTML( |
34 | 35 | Xml::fieldset( wfMessage( 'wminc-searchwiki' )->plain(), |
35 | 36 | Html::rawElement( 'form', array( 'method' => 'get', 'action' => $wgScript, 'id' => 'wminc-searchwiki-form' ), |
36 | 37 | Html::hidden( 'title', SpecialPage::getTitleFor( 'SearchWiki' ) ) . |
| 38 | + ( $uselang ? Html::hidden( 'uselang', $uselang ) : '' ) . |
37 | 39 | '<p>' . Xml::label( wfMessage( 'wminc-searchwiki-selectproject' )->text(), 'wminc-searchproject' ) . |
38 | 40 | ' ' . $this->makeProjectSelector( $projectQuery ) . '</p>' . |
39 | 41 | '<p>' . Xml::inputLabel( wfMessage( 'wminc-searchwiki-inputlanguage' )->text(), 'searchlanguage', |
— | — | @@ -91,7 +93,7 @@ |
92 | 94 | } |
93 | 95 | |
94 | 96 | if( count( $results ) === 1 ) { |
95 | | - self::gotoWiki( $matchProject, key( $results ) ); |
| 97 | + $this->gotoWiki( $matchProject, key( $results ) ); |
96 | 98 | } elseif( count( $results ) < 1 ) { |
97 | 99 | $noresult = Html::element( 'p', array( 'class' => 'error' ), wfMessage( 'wminc-searchwiki-noresults' )->text() ); |
98 | 100 | return $this->getOutput()->addHTML( $noresult ); |
— | — | @@ -108,8 +110,9 @@ |
109 | 111 | protected function goToWiki( $project, $lang ) { |
110 | 112 | $lang = self::getRootCode( $lang ); |
111 | 113 | $status = IncubatorTest::getDBState( array( 'project' => $project, 'lang' => $lang, 'error' => null ) ); |
| 114 | + $infopageParams = array( 'goto' => 'mainpage', 'uselang' => $this->getRequest()->getVal( 'uselang' ) ); |
112 | 115 | $url = $status == 'existing' ? IncubatorTest::getSubdomain( $lang, $project ) : |
113 | | - Title::newFromText( 'W' . $project . '/' . $lang )->getFullURL( array( 'goto' => 'mainpage' ) ); |
| 116 | + Title::newFromText( 'W' . $project . '/' . $lang )->getFullURL( $infopageParams ); |
114 | 117 | $this->getOutput()->redirect( $url ); |
115 | 118 | } |
116 | 119 | |