From 7e94d8e2935b78e8df27d2d09903e43d7540ef36 Mon Sep 17 00:00:00 2001 From: Bryan Tong Minh Date: Fri, 14 Mar 2008 19:21:38 +0000 Subject: [PATCH] Some tweaks to the search form. --- includes/SpecialSearch.php | 15 +++++++++++---- languages/messages/MessagesEn.php | 1 + 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/includes/SpecialSearch.php b/includes/SpecialSearch.php index e20d8389c2..98852c4506 100644 --- a/includes/SpecialSearch.php +++ b/includes/SpecialSearch.php @@ -173,6 +173,8 @@ class SpecialSearch { } $textMatches = $search->searchText( $term ); + $wgOut->addHTML( '
' ); + $num = ( $titleMatches ? $titleMatches->numRows() : 0 ) + ( $textMatches ? $textMatches->numRows() : 0); if ( $num > 0 ) { @@ -193,6 +195,8 @@ class SpecialSearch { ($num < $this->limit) ); $wgOut->addHTML( "

{$prevnext}

\n" ); } + + $wgOut->addHTML( "
\n" ); if( $titleMatches ) { if( $titleMatches->numRows() ) { @@ -483,7 +487,7 @@ class SpecialSearch { $out = Xml::openElement( 'form', array( 'id' => 'powersearch', 'method' => 'get', 'action' => $wgScript ) ) . Xml::openElement( 'fieldset' ) . - Xml::element( 'legend', array( ), wfMsg( 'powersearch' ) ) . + Xml::element( 'legend', array( ), wfMsg( 'searchbutton' ) ) . Xml::hidden( 'title', 'Special:Search' ) . wfMsgExt( 'powersearchtext', array( 'parse', 'replaceafter' ), $namespaces, $redirect, $searchField, @@ -504,14 +508,17 @@ class SpecialSearch { function shortDialog($term) { global $wgScript; + $form = Xml::hidden( 'title', 'Special:Search' ); + $form .= Xml::input( 'search', 50, $term, + array( 'id' => 'searchBox' ) ).' '; + $form .= Xml::submitButton( wfMsg( 'searchbutton' ), array( 'name' => 'fulltext' ) ); + $out = Xml::openElement( 'form', array( 'id' => 'search', 'method' => 'get', 'action' => $wgScript )); - $out .= Xml::hidden( 'title', 'Special:Search' ); - $out .= Xml::input( 'search', 50, $term ) . ' '; - $out .= Xml::submitButton( wfMsg( 'searchbutton' ), array( 'name' => 'fulltext' ) ); + $out .= wfMsgExt( 'searchtext', array( 'parse', 'replaceafter' ), $form ); $out .= Xml::closeElement( 'form' ); return $out; diff --git a/languages/messages/MessagesEn.php b/languages/messages/MessagesEn.php index 0da6748ceb..0e5086de6c 100644 --- a/languages/messages/MessagesEn.php +++ b/languages/messages/MessagesEn.php @@ -1206,6 +1206,7 @@ Make sure that this change will maintain historical page continuity. 'diff-multi' => '({{PLURAL:$1|One intermediate revision|$1 intermediate revisions}} not shown.)', # Search results +'searchtext' => '$1', 'searchresults' => 'Search results', 'searchresulttext' => 'For more information about searching {{SITENAME}}, see [[{{MediaWiki:Helppage}}|{{int:help}}]].', 'searchsubtitle' => "You searched for '''[[:$1]]'''", -- 2.20.1