Index: branches/uploadwizard/extensions/UploadWizard/SpecialUploadWizard.php |
— | — | @@ -11,6 +11,7 @@ |
12 | 12 | |
13 | 13 | class SpecialUploadWizard extends SpecialPage { |
14 | 14 | |
| 15 | + private $simpleForm; |
15 | 16 | |
16 | 17 | // $request is the request (usually wgRequest) |
17 | 18 | // $par is everything in the URL after Special:UploadWizard. Not sure what we can use it for |
— | — | @@ -21,8 +22,13 @@ |
22 | 23 | |
23 | 24 | parent::__construct( 'UploadWizard', 'upload' ); |
24 | 25 | |
| 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. |
25 | 29 | $this->simpleForm = new UploadWizardSimpleForm(); |
26 | | - $this->simpleForm->setTitle( $this->getTitle() ); |
| 30 | + $this->simpleForm->setTitle( |
| 31 | + SpecialPage::getPage( 'Upload' )->getTitle() |
| 32 | + ); |
27 | 33 | } |
28 | 34 | |
29 | 35 | /** |
— | — | @@ -151,12 +157,15 @@ |
152 | 158 | |
153 | 159 | |
154 | 160 | /** |
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. |
159 | 162 | */ |
160 | 163 | 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 | + */ |
161 | 170 | protected function addUploadJS( ) { } |
162 | 171 | |
163 | 172 | } |