Index: trunk/phase3/includes/specials/SpecialUpload.php |
— | — | @@ -45,6 +45,11 @@ |
46 | 46 | protected $mForReUpload; // The user followed an "overwrite this file" link |
47 | 47 | protected $mCancelUpload; // The user clicked "Cancel and return to upload form" button |
48 | 48 | protected $mTokenOk; |
| 49 | + |
| 50 | + /** Text injection points for hooks not using HTMLForm **/ |
| 51 | + public $uploadFormTextTop; |
| 52 | + public $uploadFormTextAfterSummary; |
| 53 | + |
49 | 54 | |
50 | 55 | /** |
51 | 56 | * Initialize instance variables from request and create an Upload handler |
— | — | @@ -91,6 +96,9 @@ |
92 | 97 | } else { |
93 | 98 | $this->mTokenOk = $wgUser->matchEditToken( $token ); |
94 | 99 | } |
| 100 | + |
| 101 | + $this->uploadFormTextTop = ''; |
| 102 | + $this->uploadFormTextAfterSummary = ''; |
95 | 103 | } |
96 | 104 | |
97 | 105 | /** |
— | — | @@ -204,6 +212,9 @@ |
205 | 213 | 'sessionkey' => $sessionKey, |
206 | 214 | 'hideignorewarning' => $hideIgnoreWarning, |
207 | 215 | 'destwarningack' => (bool)$this->mDestWarningAck, |
| 216 | + |
| 217 | + 'texttop' => $this->uploadFormTextTop, |
| 218 | + 'textaftersummary' => $this->uploadFormTextAfterSummary, |
208 | 219 | ) ); |
209 | 220 | $form->setTitle( $this->getTitle() ); |
210 | 221 | |
— | — | @@ -687,6 +698,9 @@ |
688 | 699 | protected $mHideIgnoreWarning; |
689 | 700 | protected $mDestWarningAck; |
690 | 701 | |
| 702 | + protected $mTextTop; |
| 703 | + protected $mTextAfterSummary; |
| 704 | + |
691 | 705 | protected $mSourceIds; |
692 | 706 | |
693 | 707 | public function __construct( $options = array() ) { |
— | — | @@ -698,6 +712,9 @@ |
699 | 713 | ? $options['sessionkey'] : ''; |
700 | 714 | $this->mHideIgnoreWarning = !empty( $options['hideignorewarning'] ); |
701 | 715 | $this->mDestWarningAck = !empty( $options['destwarningack'] ); |
| 716 | + |
| 717 | + $this->mTextTop = $options['texttop']; |
| 718 | + $this->mTextAfterSummary = $options['textaftersummary']; |
702 | 719 | |
703 | 720 | $sourceDescriptor = $this->getSourceSection(); |
704 | 721 | $descriptor = $sourceDescriptor |
— | — | @@ -749,6 +766,15 @@ |
750 | 767 | $selectedSourceType = strtolower( $wgRequest->getText( 'wpSourceType', 'File' ) ); |
751 | 768 | |
752 | 769 | $descriptor = array(); |
| 770 | + if ( $this->mTextTop ) { |
| 771 | + $descriptor['UploadFormTextTop'] = array( |
| 772 | + 'type' => 'info', |
| 773 | + 'section' => 'source', |
| 774 | + 'default' => $this->mTextTop, |
| 775 | + 'raw' => true, |
| 776 | + ); |
| 777 | + } |
| 778 | + |
753 | 779 | $descriptor['UploadFile'] = array( |
754 | 780 | 'class' => 'UploadSourceField', |
755 | 781 | 'section' => 'source', |
— | — | @@ -860,7 +886,18 @@ |
861 | 887 | : 'fileuploadsummary', |
862 | 888 | 'cols' => $cols, |
863 | 889 | 'rows' => 8, |
864 | | - ), |
| 890 | + ) |
| 891 | + ); |
| 892 | + if ( $this->mTextAfterSummary ) { |
| 893 | + $descriptor['UploadFormTextAfterSummary'] = array( |
| 894 | + 'type' => 'info', |
| 895 | + 'section' => 'description', |
| 896 | + 'default' => $this->mTextAfterSummary, |
| 897 | + 'raw' => true, |
| 898 | + ); |
| 899 | + } |
| 900 | + |
| 901 | + $descriptor += array( |
865 | 902 | 'EditTools' => array( |
866 | 903 | 'type' => 'edittools', |
867 | 904 | 'section' => 'description', |