From 63ddc8fc5b3cc84b66bd32604420cf9ed38432ed Mon Sep 17 00:00:00 2001 From: Alexandre Emsenhuber Date: Wed, 13 Mar 2013 18:08:55 +0100 Subject: [PATCH] Fixes to Special:LinkSearch form - Use Html class instead of Xml where possible - Use Html class for
generation, for consistency - Add line breaks to the output for better readability - Don't use $GLOBALS to access $wgScript Change-Id: Ib11aa8ba3e3ef0e1ca07e0e3ac9605daa33f08a4 --- includes/specials/SpecialLinkSearch.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/includes/specials/SpecialLinkSearch.php b/includes/specials/SpecialLinkSearch.php index 4779af23c6..030416fbef 100644 --- a/includes/specials/SpecialLinkSearch.php +++ b/includes/specials/SpecialLinkSearch.php @@ -42,7 +42,7 @@ class LinkSearchPage extends QueryPage { } function execute( $par ) { - global $wgUrlProtocols, $wgMiserMode; + global $wgUrlProtocols, $wgMiserMode, $wgScript; $this->setHeaders(); $this->outputHeader(); @@ -88,11 +88,11 @@ class LinkSearchPage extends QueryPage { '' . $this->getLanguage()->commaList( $protocols_list ) . '', count( $protocols_list ) ); - $s = Xml::openElement( 'form', array( 'id' => 'mw-linksearch-form', 'method' => 'get', 'action' => $GLOBALS['wgScript'] ) ) . - Html::hidden( 'title', $this->getTitle()->getPrefixedDBkey() ) . - '
' . - Xml::element( 'legend', array(), $this->msg( 'linksearch' )->text() ) . - Xml::inputLabel( $this->msg( 'linksearch-pat' )->text(), 'target', 'target', 50, $target ) . ' '; + $s = Html::openElement( 'form', array( 'id' => 'mw-linksearch-form', 'method' => 'get', 'action' => $wgScript ) ) . "\n" . + Html::hidden( 'title', $this->getTitle()->getPrefixedDBkey() ) . "\n" . + Html::openElement( 'fieldset' ) . "\n" . + Html::element( 'legend', array(), $this->msg( 'linksearch' )->text() ) . "\n" . + Xml::inputLabel( $this->msg( 'linksearch-pat' )->text(), 'target', 'target', 50, $target ) . "\n"; if ( !$wgMiserMode ) { $s .= Html::namespaceSelector( array( @@ -106,9 +106,9 @@ class LinkSearchPage extends QueryPage { ) ); } - $s .= Xml::submitButton( $this->msg( 'linksearch-ok' )->text() ) . - '
' . - Xml::closeElement( 'form' ); + $s .= Xml::submitButton( $this->msg( 'linksearch-ok' )->text() ) . "\n" . + Html::closeElement( 'fieldset' ) . "\n" . + Html::closeElement( 'form' ) . "\n"; $out->addHTML( $s ); if( $target != '' ) { -- 2.20.1