From: Alexandre Emsenhuber Date: Wed, 13 Mar 2013 17:08:55 +0000 (+0100) Subject: Fixes to Special:LinkSearch form X-Git-Tag: 1.31.0-rc.0~20356 X-Git-Url: https://git.cyclocoop.org/%7B%24www_url%7Dadmin/compta/exercices/bilan.php?a=commitdiff_plain;h=63ddc8fc5b3cc84b66bd32604420cf9ed38432ed;p=lhc%2Fweb%2Fwiklou.git 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 --- 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 != '' ) {