From ce55535cc2e51ea47a441ee3c972b4a58e1f29cb Mon Sep 17 00:00:00 2001 From: Alexandre Emsenhuber Date: Wed, 10 Apr 2013 10:55:46 +0200 Subject: [PATCH] Fixes to Special:BookSources form - Use Html class instead of Xml or raw strings where possible - Add line breaks to the output for better readability Change-Id: I6934c8124b3becdb0740883ab853b042098440e7 --- includes/specials/SpecialBooksources.php | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/includes/specials/SpecialBooksources.php b/includes/specials/SpecialBooksources.php index 0774c44b85..b3933c517d 100644 --- a/includes/specials/SpecialBooksources.php +++ b/includes/specials/SpecialBooksources.php @@ -116,13 +116,14 @@ class SpecialBookSources extends SpecialPage { private function makeForm() { global $wgScript; - $form = '
' . $this->msg( 'booksources-search-legend' )->escaped() . ''; - $form .= Xml::openElement( 'form', array( 'method' => 'get', 'action' => $wgScript ) ); - $form .= Html::hidden( 'title', $this->getTitle()->getPrefixedText() ); + $form = Html::openElement( 'fieldset' ) . "\n"; + $form .= Html::element( 'legend', array(), $this->msg( 'booksources-search-legend' )->text() ) . "\n"; + $form .= Html::openElement( 'form', array( 'method' => 'get', 'action' => $wgScript ) ) . "\n"; + $form .= Html::hidden( 'title', $this->getTitle()->getPrefixedText() ) . "\n"; $form .= '

' . Xml::inputLabel( $this->msg( 'booksources-isbn' )->text(), 'isbn', 'isbn', 20, $this->isbn ); - $form .= ' ' . Xml::submitButton( $this->msg( 'booksources-go' )->text() ) . '

'; - $form .= Xml::closeElement( 'form' ); - $form .= '
'; + $form .= ' ' . Xml::submitButton( $this->msg( 'booksources-go' )->text() ) . "

\n"; + $form .= Html::closeElement( 'form' ) . "\n"; + $form .= Html::closeElement( 'fieldset' ) . "\n"; return $form; } @@ -177,7 +178,8 @@ class SpecialBookSources extends SpecialPage { */ private function makeListItem( $label, $url ) { $url = str_replace( '$1', $this->isbn, $url ); - return '
  • ' . htmlspecialchars( $label ) . '
  • '; + return Html::rawElement( 'li', array(), + Html::element( 'a', array( 'href' => $url, 'class' => 'external' ), $label ) ); } protected function getGroupName() { -- 2.20.1