r44674 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r44673‎ | r44674 | r44675 >
Date:14:10, 16 December 2008
Author:demon
Status:ok
Tags:
Comment:
And here's the first working example :) Isn't that much nicer?
Modified paths:
  • /trunk/extensions/InterwikiList/InterwikiList_body.php (modified) (history)

Diff [purge]

Index: trunk/extensions/InterwikiList/InterwikiList_body.php
@@ -54,21 +54,16 @@
5555 Xml::closeElement( 'form' );
5656 $text = Xml::fieldSet( wfMsg('interwikilist-filter'), $form );
5757
58 - $text .= Xml::openElement( 'table', array( 'id' => 'sv-software' ) ) .
59 - Xml::openElement( 'tr' ) .
60 - Xml::element( 'th', null, wfMsg( 'interwikilist-linkname' ) ) .
61 - Xml::element( 'th', null, wfMsg( 'interwikilist-target' ) ) .
62 - Xml::closeElement( 'tr' );;
63 -
64 - while ( $row = $dbr->fetchObject( $results ) ) {
65 - $text .= Xml::openElement( 'tr' ) .
66 - Xml::element( 'td', null, $row->iw_prefix ) .
67 - Xml::element( 'td', null, $row->iw_url ) .
68 - Xml::closeElement( 'tr' );
 58+ $interwikiList = array();
 59+ while( $row = $dbr->fetchObject( $results ) ) {
 60+ $interwikiList[ "mw-iwlist-" . $row->iw_prefix ] = array( $row->iw_prefix, $row->iw_url );
6961 }
70 - $text .= Xml::closeElement( 'table' );
7162 $dbr->freeResult( $results );
7263
 64+ $text .= Xml::buildTable( $interwikiList,
 65+ array( 'id' => 'sv-software' ),
 66+ array( wfMsg( 'interwikilist-linkname'),
 67+ wfMsg( 'interwikilist-target' ) ) );
7368 return $text;
7469 }
7570 }

Status & tagging log