r87864 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r87863‎ | r87864 | r87865 >
Date:01:03, 11 May 2011
Author:neilk
Status:ok
Tags:
Comment:
followup to r87863; use Html::rawElement() for HTML, and instanceof instead of get_class()
Modified paths:
  • /trunk/extensions/UploadWizard/SpecialUploadWizard.php (modified) (history)

Diff [purge]

Index: trunk/extensions/UploadWizard/SpecialUploadWizard.php
@@ -188,17 +188,20 @@
189189
190190 $linkHtml = '';
191191 $altUploadForm = Title::newFromText( $wgUploadWizardConfig[ 'altUploadForm' ] );
192 - if ( get_class( $altUploadForm ) == 'Title' ) {
193 - $linkHtml = '<p style="text-align: center;"><a href="' . $altUploadForm->getLocalURL() . '">'
194 - . $wgUploadWizardConfig['altUploadForm']
195 - .'</a></p>';
 192+ if ( $altUploadForm instanceof Title ) {
 193+ $linkHtml = Html::rawElement( 'p', array( 'style' => 'text-align: center;' ),
 194+ Html::rawElement( 'a', array( 'href' => $altUploadForm->getLocalURL() ),
 195+ $wgUploadWizardConfig['altUploadForm']
 196+ )
 197+ );
196198 }
197199
198200 return
199 - '<div id="upload-wizard" class="upload-section">'
200 - . '<p style="text-align: center;">' . wfMsg( 'mwe-upwiz-extension-disabled' ) . '</p>'
201 - . $linkHtml
202 - . '</div>';
 201+ Html::rawElement( 'div', array( 'id' => 'upload-wizard', 'class' => 'upload-section' ),
 202+ Html::rawElement( 'p', array( 'style' => 'text-align: center' ), wfMsg( 'mwe-upwiz-extension-disabled' ) )
 203+ . $linkHtml
 204+ );
 205+
203206 }
204207
205208 $tutorialHtml = '';

Follow-up revisions

RevisionCommit summaryAuthorDate
r87865MFT r87863, r87864demon01:09, 11 May 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r87863fallback to alternate upload form when configured to do soneilk00:39, 11 May 2011

Status & tagging log