r80989 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r80988‎ | r80989 | r80990 >
Date:20:59, 25 January 2011
Author:btongminh
Status:ok (Comments)
Tags:
Comment:
Uploads that throw a warning (UploadFromStash) a thumbnail is now shown.
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/specials/SpecialUpload.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/specials/SpecialUpload.php
@@ -938,6 +938,26 @@
939939 protected function getDescriptionSection() {
940940 global $wgUser;
941941
 942+ if ( $this->mSessionKey ) {
 943+ $stash = new UploadStash;
 944+ try {
 945+ $file = $stash->getFile( $this->mSessionKey );
 946+ } catch ( MWException $e ) {
 947+ $file = null;
 948+ }
 949+ if ( $file ) {
 950+ global $wgContLang;
 951+
 952+ $mto = $file->transform( array( 'width' => 120 ) );
 953+ $this->addHeaderText(
 954+ '<div class="thumb t' . $wgContLang->alignEnd() . '">' .
 955+ Html::element( 'img', array(
 956+ 'src' => $mto->getUrl(),
 957+ 'class' => 'thumbimage',
 958+ ) ) . '</div>', 'description' );
 959+ }
 960+ }
 961+
942962 $descriptor = array(
943963 'DestFile' => array(
944964 'type' => 'text',
Index: trunk/phase3/RELEASE-NOTES
@@ -52,6 +52,7 @@
5353 * Alternative to $wgHooks implemented, using the new Hooks class.
5454 * Add width parameter to Special:Filepath to allow getting the file path of a thumbnail.
5555 * (bug 26870) Add size to {{filepath:}}
 56+* Upload warnings now show a thumbnail of the uploaded file
5657
5758 === Bug fixes in 1.18 ===
5859 * (bug 23119) WikiError class and subclasses are now marked as deprecated

Comments

#Comment by Aaron Schulz (talk | contribs)   01:19, 15 June 2011

OK I suppose...not sure I like the exact position but nothing better comes to mind atm.

Status & tagging log