- Use Html class instead of Xml where possible
- Use Html class for <fieldset> generation, for consistency
- Add line breaks to the output for better readability
- Don't use $GLOBALS to access $wgScript
Change-Id: Ib11aa8ba3e3ef0e1ca07e0e3ac9605daa33f08a4
}
function execute( $par ) {
}
function execute( $par ) {
- global $wgUrlProtocols, $wgMiserMode;
+ global $wgUrlProtocols, $wgMiserMode, $wgScript;
$this->setHeaders();
$this->outputHeader();
$this->setHeaders();
$this->outputHeader();
'<nowiki>' . $this->getLanguage()->commaList( $protocols_list ) . '</nowiki>',
count( $protocols_list )
);
'<nowiki>' . $this->getLanguage()->commaList( $protocols_list ) . '</nowiki>',
count( $protocols_list )
);
- $s = Xml::openElement( 'form', array( 'id' => 'mw-linksearch-form', 'method' => 'get', 'action' => $GLOBALS['wgScript'] ) ) .
- Html::hidden( 'title', $this->getTitle()->getPrefixedDBkey() ) .
- '<fieldset>' .
- 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(
if ( !$wgMiserMode ) {
$s .= Html::namespaceSelector(
array(
- $s .= Xml::submitButton( $this->msg( 'linksearch-ok' )->text() ) .
- '</fieldset>' .
- 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 != '' ) {
$out->addHTML( $s );
if( $target != '' ) {