r75127 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r75126‎ | r75127 | r75128 >
Date:23:31, 20 October 2010
Author:neilk
Status:deferred
Tags:
Comment:
non-JS fallback to Special:Upload
Modified paths:
  • /branches/uploadwizard/extensions/UploadWizard/SpecialUploadWizard.php (modified) (history)

Diff [purge]

Index: branches/uploadwizard/extensions/UploadWizard/SpecialUploadWizard.php
@@ -11,6 +11,7 @@
1212
1313 class SpecialUploadWizard extends SpecialPage {
1414
 15+ private $simpleForm;
1516
1617 // $request is the request (usually wgRequest)
1718 // $par is everything in the URL after Special:UploadWizard. Not sure what we can use it for
@@ -21,8 +22,13 @@
2223
2324 parent::__construct( 'UploadWizard', 'upload' );
2425
 26+ // create a simple form for non-JS fallback, which targets the old Special:Upload page.
 27+ // at some point, if we completely subsume its functionality, change that to point here again,
 28+ // but then we'll need to process non-JS uploads in the same way Special:Upload does.
2529 $this->simpleForm = new UploadWizardSimpleForm();
26 - $this->simpleForm->setTitle( $this->getTitle() );
 30+ $this->simpleForm->setTitle(
 31+ SpecialPage::getPage( 'Upload' )->getTitle()
 32+ );
2733 }
2834
2935 /**
@@ -151,12 +157,15 @@
152158
153159
154160 /**
155 - * This is a hack on UploadForm.
156 - * Normally, UploadForm adds its own Javascript.
157 - * We wish to prevent this, because we want to control the case where we have Javascript.
158 - * So, we subclass UploadForm, and make the addUploadJS a no-op.
 161+ * This is a hack on UploadForm, to make one that works from UploadWizard when JS is not available.
159162 */
160163 class UploadWizardSimpleForm extends UploadForm {
 164+
 165+ /*
 166+ * Normally, UploadForm adds its own Javascript.
 167+ * We wish to prevent this, because we want to control the case where we have Javascript.
 168+ * So, we make the addUploadJS a no-op.
 169+ */
161170 protected function addUploadJS( ) { }
162171
163172 }

Status & tagging log