r44837 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r44836‎ | r44837 | r44838 >
Date:09:03, 20 December 2008
Author:aaron
Status:ok
Tags:
Comment:
Use XML functions
Modified paths:
  • /trunk/extensions/Patroller/Patroller.class.php (modified) (history)

Diff [purge]

Index: trunk/extensions/Patroller/Patroller.class.php
@@ -133,16 +133,16 @@
134134 private function showControls( &$edit ) {
135135 global $wgUser, $wgOut;
136136 $self = Title::makeTitle( NS_SPECIAL, 'Patrol' );
137 - $form = wfOpenElement( 'form', array( 'method' => 'post', 'action' => $self->getLocalUrl() ) );
 137+ $form = Xml::openElement( 'form', array( 'method' => 'post', 'action' => $self->getLocalUrl() ) );
138138 $form .= '<table>';
139 - $form .= '<tr><td align="right">' . wfSubmitButton( wfMsg( 'patrol-endorse' ), array( 'name' => 'wpPatrolEndorse' ) ) . '</td><td></td></tr>';
140 - $form .= '<tr><td align="right">' . wfSubmitButton( wfMsg( 'patrol-revert' ), array( 'name' => 'wpPatrolRevert' ) ) . '</td>';
141 - $form .= '<td>' . wfLabel( wfMsg( 'patrol-revert-reason' ), 'reason' ) . '&nbsp;';
142 - $form .= $this->revertReasonsDropdown() . ' / ' . wfInput( 'wpPatrolRevertReason' ) . '</td></tr>';
143 - $form .= '<tr><td align="right">' . wfSubmitButton( wfMsg( 'patrol-skip' ), array( 'name' => 'wpPatrolSkip' ) ) . '</td></tr></table>';
144 - $form .= '<tr><td>' . wfCheck( 'wpAnother', true ) . '</td><td>' . wfMsgHtml( 'patrol-another' ) . '</td></tr>';
145 - $form .= wfHidden( 'wpRcId', $edit->mAttribs['rc_id'] );
146 - $form .= wfHidden( 'wpToken', $wgUser->editToken() );
 139+ $form .= '<tr><td align="right">' . Xml::submitButton( wfMsg( 'patrol-endorse' ), array( 'name' => 'wpPatrolEndorse' ) ) . '</td><td></td></tr>';
 140+ $form .= '<tr><td align="right">' . Xml::submitButton( wfMsg( 'patrol-revert' ), array( 'name' => 'wpPatrolRevert' ) ) . '</td>';
 141+ $form .= '<td>' . Xml::label( wfMsg( 'patrol-revert-reason' ), 'reason' ) . '&nbsp;';
 142+ $form .= $this->revertReasonsDropdown() . ' / ' . Xml::input( 'wpPatrolRevertReason' ) . '</td></tr>';
 143+ $form .= '<tr><td align="right">' . Xml::submitButton( wfMsg( 'patrol-skip' ), array( 'name' => 'wpPatrolSkip' ) ) . '</td></tr></table>';
 144+ $form .= '<tr><td>' . Xml::check( 'wpAnother', true ) . '</td><td>' . wfMsgHtml( 'patrol-another' ) . '</td></tr>';
 145+ $form .= Xml::hidden( 'wpRcId', $edit->mAttribs['rc_id'] );
 146+ $form .= Xml::hidden( 'wpToken', $wgUser->editToken() );
147147 $form .= '</form>';
148148 $wgOut->addHTML( $form );
149149 }
@@ -280,10 +280,10 @@
281281 $reasons[] = trim( $line, '* ' );
282282 }
283283 if( count( $reasons ) > 0 ) {
284 - $box = wfOpenElement( 'select', array( 'name' => 'wpPatrolRevertReasonCommon' ) );
 284+ $box = Xml::openElement( 'select', array( 'name' => 'wpPatrolRevertReasonCommon' ) );
285285 foreach( $reasons as $reason )
286 - $box .= wfElement( 'option', array( 'value' => $reason ), $reason );
287 - $box .= wfCloseElement( 'select' );
 286+ $box .= Xml::element( 'option', array( 'value' => $reason ), $reason );
 287+ $box .= Xml::closeElement( 'select' );
288288 return $box;
289289 } else {
290290 return '';

Status & tagging log