r57936 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r57935‎ | r57936 | r57937 >
Date:23:56, 19 October 2009
Author:dale
Status:deferred (Comments)
Tags:
Comment:
* close up the </ul> bug 21188
* white space removal
Modified paths:
  • /trunk/phase3/includes/specials/SpecialUpload.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/specials/SpecialUpload.php
@@ -3,9 +3,9 @@
44 * @file
55 * @ingroup SpecialPage
66 * @ingroup Upload
7 - *
 7+ *
88 * Form for handling uploads and special page.
9 - *
 9+ *
1010 */
1111
1212 class SpecialUpload extends SpecialPage {
@@ -16,38 +16,38 @@
1717 */
1818 public function __construct( $request = null ) {
1919 global $wgRequest;
20 -
 20+
2121 parent::__construct( 'Upload', 'upload' );
22 -
 22+
2323 $this->loadRequest( is_null( $request ) ? $wgRequest : $request );
2424 }
25 -
 25+
2626 /** Misc variables **/
2727 protected $mRequest; // The WebRequest or FauxRequest this form is supposed to handle
2828 protected $mSourceType;
2929 protected $mUpload;
3030 protected $mLocalFile;
3131 protected $mUploadClicked;
32 -
 32+
3333 /** User input variables from the "description" section **/
3434 protected $mDesiredDestName; // The requested target file name
3535 protected $mComment;
3636 protected $mLicense;
37 -
 37+
3838 /** User input variables from the root section **/
3939 protected $mIgnoreWarning;
4040 protected $mWatchThis;
4141 protected $mCopyrightStatus;
4242 protected $mCopyrightSource;
43 -
 43+
4444 /** Hidden variables **/
4545 protected $mForReUpload; // The user followed an "overwrite this file" link
4646 protected $mCancelUpload; // The user clicked "Cancel and return to upload form" button
4747 protected $mTokenOk;
48 -
 48+
4949 /**
5050 * Initialize instance variables from request and create an Upload handler
51 - *
 51+ *
5252 * @param WebRequest $request The request to extract variables from
5353 */
5454 protected function loadRequest( $request ) {
@@ -57,22 +57,22 @@
5858 $this->mSourceType = $request->getVal( 'wpSourceType', 'file' );
5959 $this->mUpload = UploadBase::createFromRequest( $request );
6060 $this->mUploadClicked = $request->getCheck( 'wpUpload' ) && $request->wasPosted();
61 -
 61+
6262 // Guess the desired name from the filename if not provided
6363 $this->mDesiredDestName = $request->getText( 'wpDestFile' );
6464 if( !$this->mDesiredDestName )
6565 $this->mDesiredDestName = $request->getText( 'wpUploadFile' );
6666 $this->mComment = $request->getText( 'wpUploadDescription' );
67 - $this->mLicense = $request->getText( 'wpLicense' );
68 -
69 -
 67+ $this->mLicense = $request->getText( 'wpLicense' );
 68+
 69+
7070 $this->mIgnoreWarning = $request->getCheck( 'wpIgnoreWarning' );
7171 $this->mWatchthis = $request->getBool( 'wpWatchthis' );
7272 $this->mCopyrightStatus = $request->getText( 'wpUploadCopyStatus' );
7373 $this->mCopyrightSource = $request->getText( 'wpUploadSource' );
7474
7575
76 - $this->mForReUpload = $request->getBool( 'wpForReUpload' ); // updating a file
 76+ $this->mForReUpload = $request->getBool( 'wpForReUpload' ); // updating a file
7777 $this->mCancelUpload = $request->getCheck( 'wpCancelUpload' )
7878 || $request->getCheck( 'wpReUpload' ); // b/w compat
7979
@@ -87,28 +87,28 @@
8888 $this->mTokenOk = $wgUser->matchEditToken( $token );
8989 }
9090 }
91 -
 91+
9292 /**
9393 * This page can be shown if uploading is enabled.
94 - * Handle permission checking elsewhere in order to be able to show
 94+ * Handle permission checking elsewhere in order to be able to show
9595 * custom error messages.
96 - *
 96+ *
9797 * @param User $user
9898 * @return bool
9999 */
100100 public function userCanExecute( $user ) {
101101 return UploadBase::isEnabled() && parent::userCanExecute( $user );
102102 }
103 -
 103+
104104 /**
105105 * Special page entry point
106106 */
107107 public function execute( $par ) {
108108 global $wgUser, $wgOut, $wgRequest;
109 -
 109+
110110 $this->setHeaders();
111111 $this->outputHeader();
112 -
 112+
113113 # Check uploading enabled
114114 if( !UploadBase::isEnabled() ) {
115115 $wgOut->showErrorPage( 'uploaddisabled', 'uploaddisabledtext' );
@@ -139,31 +139,31 @@
140140 $wgOut->readOnlyPage();
141141 return;
142142 }
143 -
 143+
144144 # Unsave the temporary file in case this was a cancelled upload
145145 if ( $this->mCancelUpload ) {
146146 if ( !$this->unsaveUploadedFile() )
147147 # Something went wrong, so unsaveUploadedFile showed a warning
148148 return;
149149 }
150 -
 150+
151151 # Process upload or show a form
152 - if ( $this->mTokenOk && !$this->mCancelUpload
153 - && ( $this->mUpload && $this->mUploadClicked ) ) {
 152+ if ( $this->mTokenOk && !$this->mCancelUpload
 153+ && ( $this->mUpload && $this->mUploadClicked ) ) {
154154 $this->processUpload();
155155 } else {
156156 $this->showUploadForm( $this->getUploadForm() );
157157 }
158 -
 158+
159159 # Cleanup
160160 if ( $this->mUpload )
161161 $this->mUpload->cleanupTempFile();
162162 }
163 -
 163+
164164 /**
165 - * Show the main upload form and optionally add the session key to the
 165+ * Show the main upload form and optionally add the session key to the
166166 * output. This hides the source selection.
167 - *
 167+ *
168168 * @param string $message HTML message to be shown at top of form
169169 * @param string $sessionKey Session key of the stashed upload
170170 */
@@ -171,13 +171,13 @@
172172 # Add links if file was previously deleted
173173 if ( !$this->mDesiredDestName )
174174 $this->showViewDeletedLinks();
175 -
 175+
176176 $form->show();
177177 }
178 -
 178+
179179 /**
180180 * Get an UploadForm instance with title and text properly set.
181 - *
 181+ *
182182 * @param string $message HTML string to add to the form
183183 * @param string $sessionKey Session key in case this is a stashed upload
184184 * @return UploadForm
@@ -186,26 +186,26 @@
187187 # Initialize form
188188 $form = new UploadForm( $this->watchCheck(), $this->mForReUpload, $sessionKey );
189189 $form->setTitle( $this->getTitle() );
190 -
 190+
191191 # Check the token, but only if necessary
192 - if( !$this->mTokenOk && !$this->mCancelUpload
193 - && ( $this->mUpload && $this->mUploadClicked ) )
 192+ if( !$this->mTokenOk && !$this->mCancelUpload
 193+ && ( $this->mUpload && $this->mUploadClicked ) )
194194 $form->addPreText( wfMsgExt( 'session_fail_preview', 'parseinline' ) );
195195
196196 # Add text to form
197197 $form->addPreText( '<div id="uploadtext">' . wfMsgExt( 'uploadtext', 'parse' ) . '</div>');
198198 # Add upload error message
199 - $form->addPreText( $message );
200 -
201 - return $form;
 199+ $form->addPreText( $message );
 200+
 201+ return $form;
202202 }
203 -
 203+
204204 /**
205205 * TODO: DOCUMENT
206206 */
207207 protected function showViewDeletedLinks() {
208208 global $wgOut, $wgUser;
209 -
 209+
210210 $title = Title::makeTitleSafe( NS_FILE, $this->mDesiredDestName );
211211 // Show a subtitle link to deleted revisions (to sysops et al only)
212212 if( $title instanceof Title && ( $count = $title->isDeleted() ) > 0 && $wgUser->isAllowed( 'deletedhistory' ) ) {
@@ -225,16 +225,16 @@
226226 $this->showDeletionLog( $wgOut, $title->getPrefixedText() );
227227 }
228228 }
229 -
 229+
230230 /**
231231 * Stashes the upload and shows the main upload form.
232 - *
233 - * Note: only errors that can be handled by changing the name or
 232+ *
 233+ * Note: only errors that can be handled by changing the name or
234234 * description should be redirected here. It should be assumed that the
235 - * file itself is sane and has passed UploadBase::verifyFile. This
236 - * essentially means that UploadBase::VERIFICATION_ERROR and
 235+ * file itself is sane and has passed UploadBase::verifyFile. This
 236+ * essentially means that UploadBase::VERIFICATION_ERROR and
237237 * UploadBase::EMPTY_FILE should not be passed here.
238 - *
 238+ *
239239 * @param string $message HTML message to be passed to mainUploadForm
240240 */
241241 protected function recoverableUploadError( $message ) {
@@ -243,19 +243,19 @@
244244 '<div class="error">' . $message . "</div>\n";
245245 $this->showUploadForm( $this->getUploadForm( $message, $sessionKey ) );
246246 }
247 - /**
 247+ /**
248248 * Stashes the upload, shows the main form, but adds an "continue anyway button"
249 - *
 249+ *
250250 * @param array $warnings
251251 */
252252 protected function uploadWarning( $warnings ) {
253253 global $wgUser;
254 -
 254+
255255 $sessionKey = $this->mUpload->stashSession();
256 -
 256+
257257 $sk = $wgUser->getSkin();
258258
259 - $warningHtml = '<h2>' . wfMsgHtml( 'uploadwarning' ) . "</h2>\n"
 259+ $warningHtml = '<h2>' . wfMsgHtml( 'uploadwarning' ) . "</h2>\n"
260260 . '<ul class="warning">';
261261 foreach( $warnings as $warning => $args ) {
262262 $msg = '';
@@ -264,8 +264,8 @@
265265 } elseif( $warning == 'duplicate' ) {
266266 $msg = self::getDupeWarning( $args );
267267 } elseif( $warning == 'duplicate-archive' ) {
268 - $msg = "\t<li>" . wfMsgExt( 'file-deleted-duplicate', 'parseinline',
269 - array( Title::makeTitle( NS_FILE, $args )->getPrefixedText() ) )
 268+ $msg = "\t<li>" . wfMsgExt( 'file-deleted-duplicate', 'parseinline',
 269+ array( Title::makeTitle( NS_FILE, $args )->getPrefixedText() ) )
270270 . "</li>\n";
271271 } else {
272272 if ( is_bool( $args ) )
@@ -276,17 +276,18 @@
277277 }
278278 $warningHtml .= $msg;
279279 }
280 -
 280+ $warningHtml .= '</ul>';
 281+
281282 $form = $this->getUploadForm( $warningHtml, $sessionKey );
282283 $form->setSubmitText( wfMsg( 'ignorewarning' ) );
283284 $form->addButton( 'wpCancelUpload', wfMsg( 'reuploaddesc' ) );
284 -
 285+
285286 $this->showUploadForm( $form );
286287 }
287 -
 288+
288289 /**
289290 * Show the upload form with error message, but do not stash the file.
290 - *
 291+ *
291292 * @param string $message
292293 */
293294 protected function uploadError( $message ) {
@@ -294,14 +295,14 @@
295296 '<div class="error">' . $message . "</div>\n";
296297 $this->showUploadForm( $this->getUploadForm( $message ) );
297298 }
298 -
 299+
299300 /**
300301 * Do the upload.
301302 * Checks are made in SpecialUpload::execute()
302303 */
303304 protected function processUpload() {
304305 global $wgUser, $wgOut;
305 -
 306+
306307 // Verify permissions
307308 $permErrors = $this->mUpload->verifyPermissions( $wgUser );
308309 if( $permErrors !== true )
@@ -311,12 +312,12 @@
312313 $status = $this->mUpload->fetchFile();
313314 if( !$status->isOK() )
314315 return $this->mainUploadForm( $wgOut->parse( $status->getWikiText() ) );
315 -
 316+
316317 // Upload verification
317318 $details = $this->mUpload->verifyUpload();
318319 if ( $details['status'] != UploadBase::OK )
319320 return $this->processVerificationError( $details );
320 -
 321+
321322 $this->mLocalFile = $this->mUpload->getLocalFile();
322323
323324 // Check warnings if necessary
@@ -336,13 +337,13 @@
337338 $status = $this->mUpload->performUpload( $this->mComment, $pageText, $this->mWatchthis, $wgUser );
338339 if ( !$status->isGood() )
339340 return $this->uploadError( $wgOut->parse( $status->getWikiText() ) );
340 -
 341+
341342 // Success, redirect to description page
342343 wfRunHooks( 'SpecialUploadComplete', array( &$this ) );
343344 $wgOut->redirect( $this->mLocalFile->getTitle()->getFullURL() );
344345
345346 }
346 -
 347+
347348 /**
348349 * Get the initial image page text based on a comment and optional file status information
349350 */
@@ -368,7 +369,7 @@
369370 }
370371 return $pageText;
371372 }
372 -
 373+
373374 /**
374375 * See if we should check the 'watch this page' checkbox on the form
375376 * based on the user's preferences and whether we're being asked
@@ -397,16 +398,16 @@
398399 return $wgUser->getOption( 'watchcreations' );
399400 }
400401 }
401 -
402 -
 402+
 403+
403404 /**
404405 * Provides output to the user for a result of UploadBase::verifyUpload
405 - *
 406+ *
406407 * @param array $details Result of UploadBase::verifyUpload
407408 */
408409 protected function processVerificationError( $details ) {
409410 global $wgFileExtensions, $wgLang;
410 -
 411+
411412 switch( $details['status'] ) {
412413
413414 /** Statuses that only require name changing **/
@@ -422,7 +423,7 @@
423424 'parseinline' ) );
424425 break;
425426 case UploadBase::FILETYPE_MISSING:
426 - $this->recoverableUploadError( wfMsgExt( 'filetype-missing',
 427+ $this->recoverableUploadError( wfMsgExt( 'filetype-missing',
427428 'parseinline' ) );
428429 break;
429430
@@ -457,7 +458,7 @@
458459 throw new MWException( __METHOD__ . ": Unknown value `{$details['status']}`" );
459460 }
460461 }
461 -
 462+
462463 /**
463464 * Remove a temporarily kept file stashed by saveTempUploadedFile().
464465 * @access private
@@ -475,20 +476,20 @@
476477 return true;
477478 }
478479 }
479 -
 480+
480481 /*** Functions for formatting warnings ***/
481 -
 482+
482483 /**
483484 * Formats a result of UploadBase::getExistsWarning as HTML
484485 * This check is static and can be done pre-upload via AJAX
485 - *
 486+ *
486487 * @param array $exists The result of UploadBase::getExistsWarning
487 - * @return string Empty string if there is no warning or an HTML fragment
 488+ * @return string Empty string if there is no warning or an HTML fragment
488489 * consisting of one or more <li> elements if there is a warning.
489490 */
490491 public static function getExistsWarning( $exists ) {
491492 global $wgUser, $wgContLang;
492 -
 493+
493494 if ( !$exists )
494495 return '';
495496
@@ -505,11 +506,11 @@
506507 // Page exists but file does not
507508 $warning[] = '<li>' . wfMsgExt( 'filepageexists', 'parseinline', $filename ) . '</li>';
508509 } elseif ( $exists['warning'] == 'exists-normalized' ) {
509 - $warning[] = '<li>' . wfMsgExt( 'fileexists-extension', 'parseinline', $filename,
 510+ $warning[] = '<li>' . wfMsgExt( 'fileexists-extension', 'parseinline', $filename,
510511 $exists['normalizedFile']->getTitle()->getPrefixedText() ) . '</li>';
511512 } elseif ( $exists['warning'] == 'thumb' ) {
512513 // Swapped argument order compared with other messages for backwards compatibility
513 - $warning[] = '<li>' . wfMsgExt( 'fileexists-thumbnail-yes', 'parseinline',
 514+ $warning[] = '<li>' . wfMsgExt( 'fileexists-thumbnail-yes', 'parseinline',
514515 $exists['thumbFile']->getTitle()->getPrefixedText(), $filename ) . '</li>';
515516 } elseif ( $exists['warning'] == 'thumb-name' ) {
516517 // Image w/o '180px-' does not exists, but we do not like these filenames
@@ -532,7 +533,7 @@
533534 );
534535 $warning[] = '<li>' . wfMsgWikiHtml( 'filewasdeleted', $llink ) . '</li>';
535536 }
536 -
 537+
537538 return implode( "\n", $warning );
538539 }
539540
@@ -600,54 +601,54 @@
601602 return '';
602603 }
603604 }
604 -
 605+
605606 }
606607
607608 /**
608 - * Sub class of HTMLForm that provides the form section of SpecialUpload
 609+ * Sub class of HTMLForm that provides the form section of SpecialUpload
609610 */
610611 class UploadForm extends HTMLForm {
611612 protected $mWatch;
612613 protected $mForReUpload;
613614 protected $mSessionKey;
614615 protected $mSourceIds;
615 -
 616+
616617 public function __construct( $watch, $forReUpload = false, $sessionKey = '' ) {
617618 global $wgLang;
618 -
 619+
619620 $this->mWatch = $watch;
620621 $this->mForReUpload = $forReUpload;
621622 $this->mSessionKey = $sessionKey;
622 -
623 - $sourceDescriptor = $this->getSourceSection();
 623+
 624+ $sourceDescriptor = $this->getSourceSection();
624625 $descriptor = $sourceDescriptor
625626 + $this->getDescriptionSection()
626627 + $this->getOptionsSection();
627 -
 628+
628629 wfRunHooks( 'UploadFormInitDescriptor', array( $descriptor ) );
629630 parent::__construct( $descriptor, 'upload' );
630 -
 631+
631632 # Set some form properties
632633 $this->setSubmitText( wfMsg( 'uploadbtn' ) );
633634 $this->setSubmitName( 'wpUpload' );
634635 $this->setSubmitTooltip( 'upload' );
635636 $this->setId( 'mw-upload-form' );
636 -
 637+
637638 # Build a list of IDs for javascript insertion
638639 $this->mSourceIds = array();
639640 foreach ( $sourceDescriptor as $key => $field ) {
640641 if ( !empty( $field['id'] ) )
641642 $this->mSourceIds[] = $field['id'];
642643 }
643 -
 644+
644645 }
645 -
 646+
646647 /**
647 - *
 648+ *
648649 */
649650 protected function getSourceSection() {
650651 global $wgLang, $wgUser, $wgRequest;
651 -
 652+
652653 if ( $this->mSessionKey ) {
653654 return array(
654655 'wpSessionKey' => array(
@@ -660,11 +661,11 @@
661662 ),
662663 );
663664 }
664 -
 665+
665666 $canUploadByUrl = UploadFromUrl::isEnabled() && $wgUser->isAllowed( 'upload_by_url' );
666667 $radio = $canUploadByUrl;
667668 $selectedSourceType = strtolower( $wgRequest->getText( 'wpSourceType', 'File' ) );
668 -
 669+
669670 $descriptor = array();
670671 $descriptor['UploadFile'] = array(
671672 'class' => 'UploadSourceField',
@@ -674,10 +675,10 @@
675676 'label-message' => 'sourcefilename',
676677 'upload-type' => 'File',
677678 'radio' => &$radio,
678 - 'help' => wfMsgExt( 'upload-maxfilesize',
 679+ 'help' => wfMsgExt( 'upload-maxfilesize',
679680 array( 'parseinline', 'escapenoentities' ),
680 - $wgLang->formatSize(
681 - wfShorthandToInteger( ini_get( 'upload_max_filesize' ) )
 681+ $wgLang->formatSize(
 682+ wfShorthandToInteger( ini_get( 'upload_max_filesize' ) )
682683 )
683684 ) . ' ' . wfMsgHtml( 'upload_source_file' ),
684685 'checked' => $selectedSourceType == 'file',
@@ -691,7 +692,7 @@
692693 'label-message' => 'sourceurl',
693694 'upload-type' => 'Url',
694695 'radio' => &$radio,
695 - 'help' => wfMsgExt( 'upload-maxfilesize',
 696+ 'help' => wfMsgExt( 'upload-maxfilesize',
696697 array( 'parseinline', 'escapenoentities' ),
697698 $wgLang->formatSize( $wgMaxUploadSize )
698699 ) . ' ' . wfMsgHtml( 'upload_source_url' ),
@@ -699,18 +700,18 @@
700701 );
701702 }
702703 wfRunHooks( 'UploadFormSourceDescriptors', array( $descriptor, &$radio, $selectedSourceType ) );
703 -
 704+
704705 $descriptor['Extensions'] = array(
705706 'type' => 'info',
706707 'section' => 'source',
707708 'default' => $this->getExtensionsMessage(),
708709 'raw' => true,
709710 );
710 - return $descriptor;
 711+ return $descriptor;
711712 }
712 -
 713+
713714 /**
714 - *
 715+ *
715716 */
716717 protected function getExtensionsMessage() {
717718 # Print a list of allowed file extensions, if so configured. We ignore
@@ -742,18 +743,18 @@
743744 }
744745 return $extensionsList;
745746 }
746 -
 747+
747748 /**
748 - *
 749+ *
749750 */
750751 protected function getDescriptionSection() {
751752 global $wgUser, $wgOut;
752 -
 753+
753754 $cols = intval( $wgUser->getOption( 'cols' ) );
754755 if( $wgUser->getOption( 'editwidth' ) ) {
755756 $wgOut->addInlineStyle( '#mw-htmlform-description { width: 100%; }' );
756757 }
757 -
 758+
758759 $descriptor = array(
759760 'DestFile' => array(
760761 'type' => 'text',
@@ -767,7 +768,7 @@
768769 'section' => 'description',
769770 'id' => 'wpUploadDescription',
770771 'label-message' => $this->mForReUpload
771 - ? 'filereuploadsummary'
 772+ ? 'filereuploadsummary'
772773 : 'fileuploadsummary',
773774 'cols' => $cols,
774775 'rows' => 8,
@@ -782,14 +783,14 @@
783784 );
784785 if ( $this->mForReUpload )
785786 $descriptor['DestFile']['readonly'] = true;
786 -
 787+
787788 global $wgUseAjax, $wgAjaxLicensePreview;
788789 if ( $wgUseAjax && $wgAjaxLicensePreview )
789 - $descriptor['AjaxLicensePreview'] = array(
790 - 'class' => 'UploadAjaxLicensePreview',
791 - 'section' => 'description'
 790+ $descriptor['AjaxLicensePreview'] = array(
 791+ 'class' => 'UploadAjaxLicensePreview',
 792+ 'section' => 'description'
792793 );
793 -
 794+
794795 global $wgUseCopyrightUpload;
795796 if ( $wgUseCopyrightUpload ) {
796797 $descriptor['UploadCopyStatus'] = array(
@@ -805,16 +806,16 @@
806807 'label-message' => 'filesource',
807808 );
808809 }
809 -
 810+
810811 return $descriptor;
811812 }
812 -
 813+
813814 /**
814 - *
 815+ *
815816 */
816817 protected function getOptionsSection() {
817818 global $wgOut;
818 -
 819+
819820 $descriptor = array(
820821 'Watchthis' => array(
821822 'type' => 'check',
@@ -833,7 +834,7 @@
834835 'section' => 'options',
835836 ),
836837 );
837 -
 838+
838839 $uploadFooter = wfMsgNoTrans( 'uploadfooter' );
839840 if ( $uploadFooter != '-' && !wfEmptyMsg( 'uploadfooter', $uploadFooter ) )
840841 $descriptor['UploadFooter'] = array(
@@ -841,30 +842,30 @@
842843 'id' => 'mw-upload-footer-message',
843844 'default' => $wgOut->parse( $uploadFooter ),
844845 );
845 -
 846+
846847 return $descriptor;
847 -
 848+
848849 }
849 -
 850+
850851 /**
851 - *
 852+ *
852853 */
853854 public function show() {
854855 $this->addUploadJS();
855856 parent::show();
856857 }
857 -
 858+
858859 /**
859 - *
 860+ *
860861 */
861862 protected function addUploadJS( $autofill = true ) {
862863 global $wgUseAjax, $wgAjaxUploadDestCheck, $wgAjaxLicensePreview;
863864 global $wgEnableFirefogg, $wgEnableJS2system;
864865 global $wgOut;
865 -
 866+
866867 $useAjaxDestCheck = $wgUseAjax && $wgAjaxUploadDestCheck;
867868 $useAjaxLicensePreview = $wgUseAjax && $wgAjaxLicensePreview;
868 -
 869+
869870 $scriptVars = array(
870871 'wgAjaxUploadDestCheck' => $wgUseAjax && $wgAjaxUploadDestCheck,
871872 'wgAjaxLicensePreview' => $wgUseAjax && $wgAjaxLicensePreview,
@@ -884,7 +885,7 @@
885886 $wgOut->addScriptFile( 'edit.js' ); // For <charinsert> support
886887 }
887888 }
888 -
 889+
889890 function trySubmit() {
890891 return false;
891892 }
@@ -896,11 +897,11 @@
897898 */
898899 class UploadSourceField extends HTMLTextField {
899900 function getLabelHtml() {
900 - $id = "wpSourceType{$this->mParams['upload-type']}";
 901+ $id = "wpSourceType{$this->mParams['upload-type']}";
901902 $label = Html::rawElement( 'label', array( 'for' => $id ), $this->mLabel );
902 -
 903+
903904 if ( !empty( $this->mParams['radio'] ) ) {
904 - $attribs = array(
 905+ $attribs = array(
905906 'name' => 'wpSourceType',
906907 'type' => 'radio',
907908 'id' => $id,
@@ -910,12 +911,12 @@
911912 $attribs['checked'] = 'checked';
912913 $label .= Html::element( 'input', $attribs );
913914 }
914 -
 915+
915916 return Html::rawElement( 'td', array( 'class' => 'mw-label' ), $label );
916917 }
917918 function getSize() {
918 - return isset( $this->mParams['size'] )
919 - ? $this->mParams['size']
 919+ return isset( $this->mParams['size'] )
 920+ ? $this->mParams['size']
920921 : 60;
921922 }
922923 }

Comments

#Comment by Platonides (talk | contribs)   22:39, 20 October 2009

Why is it an issue having blank lines indented at their function level?

#Comment by Mdale (talk | contribs)   23:27, 20 October 2009

not a big issue...but other code looks like that.

Status & tagging log