r87863 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r87862‎ | r87863 | r87864 >
Date:00:39, 11 May 2011
Author:neilk
Status:ok
Tags:
Comment:
fallback to alternate upload form when configured to do so
Modified paths:
  • /trunk/extensions/UploadWizard/SpecialUploadWizard.php (modified) (history)
  • /trunk/extensions/UploadWizard/UploadWizard.i18n.php (modified) (history)

Diff [purge]

Index: trunk/extensions/UploadWizard/SpecialUploadWizard.php
@@ -180,7 +180,27 @@
181181 */
182182 function getWizardHtml() {
183183 global $wgUploadWizardConfig, $wgExtensionAssetsPath;
184 -
 184+
 185+ if ( array_key_exists( 'fallbackToAltUploadForm', $wgUploadWizardConfig )
 186+ && array_key_exists( 'altUploadForm', $wgUploadWizardConfig )
 187+ && $wgUploadWizardConfig['altUploadForm'] != ''
 188+ && $wgUploadWizardConfig[ 'fallbackToAltUploadForm' ] ) {
 189+
 190+ $linkHtml = '';
 191+ $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>';
 196+ }
 197+
 198+ 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>';
 203+ }
 204+
185205 $tutorialHtml = '';
186206 // only load the tutorial HTML if we aren't skipping the first step
187207 // TODO should use user preference not a cookie ( so the user does not have to skip it for every browser )
Index: trunk/extensions/UploadWizard/UploadWizard.i18n.php
@@ -15,6 +15,7 @@
1616 'uploadwizard' => 'Upload wizard',
1717 'uploadwizard-desc' => 'Upload wizard, developed for the Multimedia Usability grant',
1818 'mwe-upwiz-js-off' => 'UploadWizard uses JavaScript for an improved interface. Your browser either does not support JavaScript or has JavaScript turned off, so we are showing you a simple upload form.',
 19+ 'mwe-upwiz-extension-disabled' => 'This page has been disabled due to temporary technical problems. In the meantime try the standard upload form.',
1920 'mwe-upwiz-code-unknown' => 'Unknown language',
2021 'mwe-upwiz-step-tutorial' => 'Learn',
2122 'mwe-upwiz-step-file' => 'Upload',

Follow-up revisions

RevisionCommit summaryAuthorDate
r87864followup to r87863; use Html::rawElement() for HTML, and instanceof instead o...neilk01:03, 11 May 2011
r87865MFT r87863, r87864demon01:09, 11 May 2011

Status & tagging log