r60280 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r60279‎ | r60280 | r60281 >
Date:21:30, 21 December 2009
Author:btongminh
Status:ok
Tags:
Comment:
Follow up to r60277: Restore the uploadFormTextTop and uploadFormTextAfterSummary text injection points.
Modified paths:
  • /trunk/phase3/includes/specials/SpecialUpload.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/specials/SpecialUpload.php
@@ -45,6 +45,11 @@
4646 protected $mForReUpload; // The user followed an "overwrite this file" link
4747 protected $mCancelUpload; // The user clicked "Cancel and return to upload form" button
4848 protected $mTokenOk;
 49+
 50+ /** Text injection points for hooks not using HTMLForm **/
 51+ public $uploadFormTextTop;
 52+ public $uploadFormTextAfterSummary;
 53+
4954
5055 /**
5156 * Initialize instance variables from request and create an Upload handler
@@ -91,6 +96,9 @@
9297 } else {
9398 $this->mTokenOk = $wgUser->matchEditToken( $token );
9499 }
 100+
 101+ $this->uploadFormTextTop = '';
 102+ $this->uploadFormTextAfterSummary = '';
95103 }
96104
97105 /**
@@ -204,6 +212,9 @@
205213 'sessionkey' => $sessionKey,
206214 'hideignorewarning' => $hideIgnoreWarning,
207215 'destwarningack' => (bool)$this->mDestWarningAck,
 216+
 217+ 'texttop' => $this->uploadFormTextTop,
 218+ 'textaftersummary' => $this->uploadFormTextAfterSummary,
208219 ) );
209220 $form->setTitle( $this->getTitle() );
210221
@@ -687,6 +698,9 @@
688699 protected $mHideIgnoreWarning;
689700 protected $mDestWarningAck;
690701
 702+ protected $mTextTop;
 703+ protected $mTextAfterSummary;
 704+
691705 protected $mSourceIds;
692706
693707 public function __construct( $options = array() ) {
@@ -698,6 +712,9 @@
699713 ? $options['sessionkey'] : '';
700714 $this->mHideIgnoreWarning = !empty( $options['hideignorewarning'] );
701715 $this->mDestWarningAck = !empty( $options['destwarningack'] );
 716+
 717+ $this->mTextTop = $options['texttop'];
 718+ $this->mTextAfterSummary = $options['textaftersummary'];
702719
703720 $sourceDescriptor = $this->getSourceSection();
704721 $descriptor = $sourceDescriptor
@@ -749,6 +766,15 @@
750767 $selectedSourceType = strtolower( $wgRequest->getText( 'wpSourceType', 'File' ) );
751768
752769 $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+
753779 $descriptor['UploadFile'] = array(
754780 'class' => 'UploadSourceField',
755781 'section' => 'source',
@@ -860,7 +886,18 @@
861887 : 'fileuploadsummary',
862888 'cols' => $cols,
863889 '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(
865902 'EditTools' => array(
866903 'type' => 'edittools',
867904 'section' => 'description',

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r60277Restore hooks UploadForm:initial and UploadForm:BeforeProcessing removed in r...btongminh19:57, 21 December 2009

Status & tagging log