From 29c36db9162e847077aafd133ad4e28e269d7dfe Mon Sep 17 00:00:00 2001 From: Raimond Spekking Date: Fri, 14 Mar 2008 07:52:01 +0000 Subject: [PATCH] * Do not wrap checkbox and namespace name * some XML tweaks --- includes/SpecialSearch.php | 48 ++++++++++++++++---------------------- 1 file changed, 20 insertions(+), 28 deletions(-) diff --git a/includes/SpecialSearch.php b/includes/SpecialSearch.php index d010ddd4e6..f040c07270 100644 --- a/includes/SpecialSearch.php +++ b/includes/SpecialSearch.php @@ -458,6 +458,11 @@ class SpecialSearch { return $extract; } + /** + * Generates the power search box at bottom of [[Special:Search]] + * @param $term string: search term + * @return $out string: HTML form + */ function powerSearchBox( $term ) { global $wgScript; @@ -467,42 +472,29 @@ class SpecialSearch { if( '' == $name ) { $name = wfMsg( 'blanknamespace' ); } - $encName = htmlspecialchars( $name ); - $namespaces .= ' "; + $namespaces .= Xml::openElement( 'span', array( 'style' => 'white-space: nowrap' ) ) . + Xml::checkLabel( $name, "ns{$ns}", $name, in_array( $ns, $this->namespaces ) ) . + Xml::closeElement( 'span' ) . "\n"; } - $redirect = Xml::check( 'redirs', $this->searchRedirects, - array( 'value' => '1' ) ); - - $searchField = Xml::input( 'search', 50, $term, array( - 'type' => 'text', 'id' => 'powerSearchText' ) ); - - $searchButton = Xml::element( 'input', array( - 'type' => 'submit', - 'name' => 'searchx', - 'value' => wfMsg('powersearch') - ) ) . "\n"; + $redirect = Xml::check( 'redirs', $this->searchRedirects, array( 'value' => '1' ) ); + $searchField = Xml::input( 'search', 50, $term, array( 'type' => 'text', 'id' => 'powerSearchText' ) ); + $searchButton = Xml::submitButton( wfMsg( 'powersearch' ), array( 'name' => 'searchx' ) ) . "\n"; - $out = Xml::openElement( 'form', array( - 'id' => 'powersearch', - 'method' => 'get', - 'action' => $wgScript ) ); - $out .= Xml::openElement( 'fieldset' ); - $out .= Xml::element( 'legend', array( ), wfMsg( 'powersearch' )); - $out .= Xml::hidden( 'title', 'Special:Search' ); - $out .= wfMsgExt( 'powersearchtext', array( 'parse', 'replaceafter' ), + $out = Xml::openElement( 'form', array( 'id' => 'powersearch', 'method' => 'get', 'action' => $wgScript ) ) . + Xml::openElement( 'fieldset' ) . + Xml::element( 'legend', array( ), wfMsg( 'powersearch' ) ) . + Xml::hidden( 'title', 'Special:Search' ) . + wfMsgExt( 'powersearchtext', array( 'parse', 'replaceafter' ), $namespaces, $redirect, $searchField, '', '', '', '', '', # Dummy placeholders - $searchButton ); - $out .= Xml::closeElement( 'fieldset' ); - $out .= Xml::closeElement( 'form' ); + $searchButton ) . + Xml::closeElement( 'fieldset' ) . + Xml::closeElement( 'form' ); return $out; } - + function powerSearchFocus() { return "