Index: trunk/phase3/docs/hooks.txt |
— | — | @@ -1531,6 +1531,17 @@ |
1532 | 1532 | $user: user that watched |
1533 | 1533 | $article: article object that was watched |
1534 | 1534 | |
| 1535 | +'UploadForm:initial': before the upload form is generated |
| 1536 | +$form: UploadForm object |
| 1537 | +You might set the member-variables $uploadFormTextTop and |
| 1538 | +$uploadFormTextAfterSummary to inject text (HTML) either before |
| 1539 | +or after the editform. |
| 1540 | + |
| 1541 | +'UploadForm:BeforeProcessing': DEPRECATED! at the beginning of processUpload() |
| 1542 | +$form: UploadForm object |
| 1543 | +Lets you poke at member variables like $mUploadDescription before the |
| 1544 | +file is saved. |
| 1545 | + |
1535 | 1546 | 'UploadCreateFromRequest': when UploadBase::createFromRequest has been called |
1536 | 1547 | $type: (string) the requested upload type |
1537 | 1548 | &$className: the class name of the Upload instance to be created |
Index: trunk/phase3/includes/specials/SpecialUpload.php |
— | — | @@ -155,6 +155,13 @@ |
156 | 156 | && ( $this->mUpload && $this->mUploadClicked ) ) { |
157 | 157 | $this->processUpload(); |
158 | 158 | } else { |
| 159 | + # Backwards compatibility hook |
| 160 | + if( !wfRunHooks( 'UploadForm:initial', array( &$this ) ) ) |
| 161 | + { |
| 162 | + wfDebug( "Hook 'UploadForm:initial' broke output of the upload form" ); |
| 163 | + return; |
| 164 | + } |
| 165 | + |
159 | 166 | $this->showUploadForm( $this->getUploadForm() ); |
160 | 167 | } |
161 | 168 | |
— | — | @@ -344,6 +351,14 @@ |
345 | 352 | return; |
346 | 353 | } |
347 | 354 | |
| 355 | + // Deprecated backwards compatibility hook |
| 356 | + if( !wfRunHooks( 'UploadForm:BeforeProcessing', array( &$this ) ) ) |
| 357 | + { |
| 358 | + wfDebug( "Hook 'UploadForm:BeforeProcessing' broke processing the file.\n" ); |
| 359 | + return array( 'status' => UploadBase::BEFORE_PROCESSING ); |
| 360 | + } |
| 361 | + |
| 362 | + |
348 | 363 | // Upload verification |
349 | 364 | $details = $this->mUpload->verifyUpload(); |
350 | 365 | if ( $details['status'] != UploadBase::OK ) { |