r95967 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r95966‎ | r95967 | r95968 >
Date:12:09, 1 September 2011
Author:siebrand
Status:ok
Tags:
Comment:
Replace some uses of Xml class with Html class.
Modified paths:
  • /trunk/extensions/CentralNotice/special/SpecialBannerAllocation.php (modified) (history)

Diff [purge]

Index: trunk/extensions/CentralNotice/special/SpecialBannerAllocation.php
@@ -47,37 +47,37 @@
4848 CentralNotice::printHeader();
4949
5050 // Begin Banners tab content
51 - $wgOut->addHTML( Xml::openElement( 'div', array( 'id' => 'preferences' ) ) );
 51+ $wgOut->addHTML( Html::openElement( 'div', array( 'id' => 'preferences' ) ) );
5252
5353 $htmlOut = '';
5454
5555 // Begin Allocation selection fieldset
56 - $htmlOut .= Xml::openElement( 'fieldset', array( 'class' => 'prefsection' ) );
 56+ $htmlOut .= Html::openElement( 'fieldset', array( 'class' => 'prefsection' ) );
5757
58 - $htmlOut .= Xml::openElement( 'form', array( 'method' => 'get' ) );
59 - $htmlOut .= Xml::element( 'h2', null, wfMsg( 'centralnotice-view-allocation' ) );
 58+ $htmlOut .= Html::openElement( 'form', array( 'method' => 'get' ) );
 59+ $htmlOut .= Html::element( 'h2', null, wfMsg( 'centralnotice-view-allocation' ) );
6060 $htmlOut .= Xml::tags( 'p', null, wfMsg( 'centralnotice-allocation-instructions' ) );
6161
62 - $htmlOut .= Xml::openElement( 'table', array ( 'id' => 'envpicker', 'cellpadding' => 7 ) );
63 - $htmlOut .= Xml::openElement( 'tr' );
 62+ $htmlOut .= Html::openElement( 'table', array ( 'id' => 'envpicker', 'cellpadding' => 7 ) );
 63+ $htmlOut .= Html::openElement( 'tr' );
6464 $htmlOut .= Xml::tags( 'td',
6565 array( 'style' => 'width: 20%;' ),
6666 wfMsg( 'centralnotice-project-name' ) );
67 - $htmlOut .= Xml::openElement( 'td' );
68 - $htmlOut .= Xml::openElement( 'select', array( 'name' => 'project' ) );
 67+ $htmlOut .= Html::openElement( 'td' );
 68+ $htmlOut .= Html::openElement( 'select', array( 'name' => 'project' ) );
6969
7070 foreach ( $wgNoticeProjects as $value ) {
7171 $htmlOut .= Xml::option( $value, $value, $value === $this->project );
7272 }
7373
74 - $htmlOut .= Xml::closeElement( 'select' );
75 - $htmlOut .= Xml::closeElement( 'td' );
76 - $htmlOut .= Xml::closeElement( 'tr' );
77 - $htmlOut .= Xml::openElement( 'tr' );
 74+ $htmlOut .= Html::closeElement( 'select' );
 75+ $htmlOut .= Html::closeElement( 'td' );
 76+ $htmlOut .= Html::closeElement( 'tr' );
 77+ $htmlOut .= Html::openElement( 'tr' );
7878 $htmlOut .= Xml::tags( 'td',
7979 array( 'valign' => 'top' ),
8080 wfMsg( 'centralnotice-project-lang' ) );
81 - $htmlOut .= Xml::openElement( 'td' );
 81+ $htmlOut .= Html::openElement( 'td' );
8282
8383 // Make sure the site language is in the list; a custom language code
8484 // might not have a defined name...
@@ -87,7 +87,7 @@
8888 }
8989
9090 ksort( $languages );
91 - $htmlOut .= Xml::openElement( 'select', array( 'name' => 'language' ) );
 91+ $htmlOut .= Html::openElement( 'select', array( 'name' => 'language' ) );
9292
9393 foreach( $languages as $code => $name ) {
9494 $htmlOut .= Xml::option(
@@ -95,34 +95,34 @@
9696 $code, $code === $this->language );
9797 }
9898
99 - $htmlOut .= Xml::closeElement( 'select' );
100 - $htmlOut .= Xml::closeElement( 'td' );
101 - $htmlOut .= Xml::closeElement( 'tr' );
102 - $htmlOut .= Xml::openElement( 'tr' );
 99+ $htmlOut .= Html::closeElement( 'select' );
 100+ $htmlOut .= Html::closeElement( 'td' );
 101+ $htmlOut .= Html::closeElement( 'tr' );
 102+ $htmlOut .= Html::openElement( 'tr' );
103103 $htmlOut .= Xml::tags( 'td', array(), wfMsg( 'centralnotice-country' ) );
104 - $htmlOut .= Xml::openElement( 'td' );
 104+ $htmlOut .= Html::openElement( 'td' );
105105
106106 $countries = CentralNoticeDB::getCountriesList();
107107
108 - $htmlOut .= Xml::openElement( 'select', array( 'name' => 'country' ) );
 108+ $htmlOut .= Html::openElement( 'select', array( 'name' => 'country' ) );
109109
110110 foreach( $countries as $code => $name ) {
111111 $htmlOut .= Xml::option( $name, $code, $code === $this->location );
112112 }
113113
114 - $htmlOut .= Xml::closeElement( 'select' );
115 - $htmlOut .= Xml::closeElement( 'td' );
116 - $htmlOut .= Xml::closeElement( 'tr' );
117 - $htmlOut .= Xml::closeElement( 'table' );
 114+ $htmlOut .= Html::closeElement( 'select' );
 115+ $htmlOut .= Html::closeElement( 'td' );
 116+ $htmlOut .= Html::closeElement( 'tr' );
 117+ $htmlOut .= Html::closeElement( 'table' );
118118
119119 $htmlOut .= Xml::tags( 'div',
120120 array( 'class' => 'cn-buttons' ),
121121 Xml::submitButton( wfMsg( 'centralnotice-modify' ) )
122122 );
123 - $htmlOut .= Xml::closeElement( 'form' );
 123+ $htmlOut .= Html::closeElement( 'form' );
124124
125125 // End Allocation selection fieldset
126 - $htmlOut .= Xml::closeElement( 'fieldset' );
 126+ $htmlOut .= Html::closeElement( 'fieldset' );
127127
128128 $wgOut->addHTML( $htmlOut );
129129
@@ -132,7 +132,7 @@
133133 }
134134
135135 // End Banners tab content
136 - $wgOut->addHTML( Xml::closeElement( 'div' ) );
 136+ $wgOut->addHTML( Html::closeElement( 'div' ) );
137137 }
138138
139139 /**
@@ -145,7 +145,7 @@
146146 $htmlOut = '';
147147
148148 // Begin Allocation list fieldset
149 - $htmlOut .= Xml::openElement( 'fieldset', array( 'class' => 'prefsection' ) );
 149+ $htmlOut .= Html::openElement( 'fieldset', array( 'class' => 'prefsection' ) );
150150
151151 $bannerLister = new SpecialBannerListLoader();
152152 $bannerLister->project = $wgRequest->getVal( 'project' );
@@ -193,7 +193,7 @@
194194 }
195195
196196 // End Allocation list fieldset
197 - $htmlOut .= Xml::closeElement( 'fieldset' );
 197+ $htmlOut .= Html::closeElement( 'fieldset' );
198198
199199 $wgOut->addHTML( $htmlOut );
200200 }
@@ -205,27 +205,27 @@
206206 $viewBanner = $this->getTitleFor( 'NoticeTemplate', 'view' );
207207 $viewCampaign = $this->getTitleFor( 'CentralNotice' );
208208
209 - $htmlOut = Xml::openElement( 'table',
 209+ $htmlOut = Html::openElement( 'table',
210210 array ( 'cellpadding' => 9, 'class' => 'wikitable sortable', 'style' => 'margin: 1em;' )
211211 );
212 - $htmlOut .= Xml::element( 'caption', array( 'style' => 'font-size: 1.2em;' ), $type );
213 - $htmlOut .= Xml::openElement( 'tr' );
214 - $htmlOut .= Xml::element( 'th', array( 'width' => '20%' ),
 212+ $htmlOut .= Html::element( 'caption', array( 'style' => 'font-size: 1.2em;' ), $type );
 213+ $htmlOut .= Html::openElement( 'tr' );
 214+ $htmlOut .= Html::element( 'th', array( 'width' => '20%' ),
215215 wfMsg ( 'centralnotice-percentage' ) );
216 - $htmlOut .= Xml::element( 'th', array( 'width' => '30%' ),
 216+ $htmlOut .= Html::element( 'th', array( 'width' => '30%' ),
217217 wfMsg ( 'centralnotice-banner' ) );
218 - $htmlOut .= Xml::element( 'th', array( 'width' => '30%' ),
 218+ $htmlOut .= Html::element( 'th', array( 'width' => '30%' ),
219219 wfMsg ( 'centralnotice-notice' ) );
220 - $htmlOut .= Xml::closeElement( 'tr' );
 220+ $htmlOut .= Html::closeElement( 'tr' );
221221
222222 foreach ( $banners as $banner ) {
223 - $htmlOut .= Xml::openElement( 'tr' );
224 - $htmlOut .= Xml::openElement( 'td' );
 223+ $htmlOut .= Html::openElement( 'tr' );
 224+ $htmlOut .= Html::openElement( 'td' );
225225
226226 $percentage = round( ( $banner['weight'] / $weight ) * 100, 2 );
227227
228228 $htmlOut .= wfMsg ( 'percent', $wgLang->formatNum( $percentage ) );
229 - $htmlOut .= Xml::closeElement( 'td' );
 229+ $htmlOut .= Html::closeElement( 'td' );
230230 $htmlOut .= Xml::tags( 'td', array( 'valign' => 'top' ),
231231
232232 $sk->makeLinkObj( $viewBanner, htmlspecialchars( $banner['name'] ),
@@ -238,10 +238,10 @@
239239 'method=listNoticeDetail&notice=' . urlencode( $banner['campaign'] ) )
240240 );
241241
242 - $htmlOut .= Xml::closeElement( 'tr' );
 242+ $htmlOut .= Html::closeElement( 'tr' );
243243 }
244244
245 - $htmlOut .= Xml::closeElement( 'table' );
 245+ $htmlOut .= Html::closeElement( 'table' );
246246
247247 return $htmlOut;
248248 }

Follow-up revisions

RevisionCommit summaryAuthorDate
r98902MFT r95697, r95912, r95966, r95967, r95969awjrichards20:39, 4 October 2011

Status & tagging log