Index: trunk/phase3/includes/SpecialUpload.php |
— | — | @@ -29,6 +29,12 @@ |
30 | 30 | var $mUploadCopyStatus, $mUploadSource, $mReUpload, $mAction, $mUpload; |
31 | 31 | var $mOname, $mSessionKey, $mStashed, $mDestFile, $mRemoveTempFile, $mSourceType; |
32 | 32 | var $mUploadTempFileSize = 0; |
| 33 | + |
| 34 | + # Placeholders for text injection by hooks (must be HTML) |
| 35 | + # extensions should take care to _append_ to the present value |
| 36 | + var $uploadFormTextTop; |
| 37 | + var $uploadFormTextAfterSummary; |
| 38 | + |
33 | 39 | /**#@-*/ |
34 | 40 | |
35 | 41 | /** |
— | — | @@ -45,6 +51,10 @@ |
46 | 52 | return; |
47 | 53 | } |
48 | 54 | |
| 55 | + # Placeholders for text injection by hooks (empty per default) |
| 56 | + $this->uploadFormTextTop = ""; |
| 57 | + $this->uploadFormTextAfterSummary = ""; |
| 58 | + |
49 | 59 | $this->mIgnoreWarning = $request->getCheck( 'wpIgnoreWarning' ); |
50 | 60 | $this->mReUpload = $request->getCheck( 'wpReUpload' ); |
51 | 61 | $this->mUpload = $request->getCheck( 'wpUpload' ); |
— | — | @@ -691,6 +701,12 @@ |
692 | 702 | global $wgUseCopyrightUpload; |
693 | 703 | global $wgRequest, $wgAllowCopyUploads; |
694 | 704 | |
| 705 | + if( !wfRunHooks( 'UploadForm:initial', array( &$this ) ) ) |
| 706 | + { |
| 707 | + wfDebug( "Hook 'UploadForm:initial' broke output of the upload form" ); |
| 708 | + return false; |
| 709 | + } |
| 710 | + |
695 | 711 | $cols = intval($wgUser->getOption( 'cols' )); |
696 | 712 | $ew = $wgUser->getOption( 'editwidth' ); |
697 | 713 | if ( $ew ) $ew = " style=\"width:100%\""; |
— | — | @@ -751,6 +767,7 @@ |
752 | 768 | <form id='upload' method='post' enctype='multipart/form-data' action=\"$action\"> |
753 | 769 | <table border='0'> |
754 | 770 | <tr> |
| 771 | + {$this->uploadFormTextTop} |
755 | 772 | <td align='right' valign='top'><label for='wpUploadFile'>{$sourcefilename}:</label></td> |
756 | 773 | <td align='left'> |
757 | 774 | {$filename_form} |
— | — | @@ -766,6 +783,7 @@ |
767 | 784 | <td align='right'><label for='wpUploadDescription'>{$summary}</label></td> |
768 | 785 | <td align='left'> |
769 | 786 | <textarea tabindex='3' name='wpUploadDescription' id='wpUploadDescription' rows='6' cols='{$cols}'{$ew}>" . htmlspecialchars( $this->mUploadDescription ) . "</textarea> |
| 787 | + {$this->uploadFormTextAfterSummary} |
770 | 788 | </td> |
771 | 789 | </tr> |
772 | 790 | <tr>" ); |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -217,8 +217,9 @@ |
218 | 218 | * Installer support for experimental MySQL 4.1/5.0 binary-safe schema |
219 | 219 | * Use INSERT IGNORE for db-based BagOStuff add/insert, for more memcache-like |
220 | 220 | behavior when keys already exist on add (instead of dying with an error...) |
| 221 | +* Add a hook 'UploadForm:initial' before the upload form is generated, and two |
| 222 | + member variable for text injection into the form, which can be filled by the hooks. |
221 | 223 | |
222 | | - |
223 | 224 | == Languages updated == |
224 | 225 | |
225 | 226 | * Bishnupriya Manipuri (bpy) |