From: jenkins-bot Date: Wed, 23 Mar 2016 21:20:56 +0000 (+0000) Subject: Merge "SpecialUploadStash: Add links to view a thumb of each uploaded file" X-Git-Tag: 1.31.0-rc.0~7538 X-Git-Url: http://git.cyclocoop.org/%22%20.%20generer_url_ecrire%28%22messagerie%22%29%20.%20%22?a=commitdiff_plain;h=d7bad7704f67dc887a77e4de7581931b7915d04b;p=lhc%2Fweb%2Fwiklou.git Merge "SpecialUploadStash: Add links to view a thumb of each uploaded file" --- d7bad7704f67dc887a77e4de7581931b7915d04b diff --cc includes/specials/SpecialUploadStash.php index b20844bb93,5d24e7b37a..555fe5ce14 --- a/includes/specials/SpecialUploadStash.php +++ b/includes/specials/SpecialUploadStash.php @@@ -392,17 -392,27 +392,27 @@@ class SpecialUploadStash extends Unlist sort( $files ); $fileListItemsHtml = ''; foreach ( $files as $file ) { - // TODO: Use Linker::link or even construct the list in plain wikitext - $fileListItemsHtml .= Html::rawElement( 'li', [], - Html::element( 'a', [ 'href' => - $this->getPageTitle( "file/$file" )->getLocalURL() ], $file ) - ); + $itemHtml = Linker::linkKnown( $this->getPageTitle( "file/$file" ), htmlspecialchars( $file ) ); + try { + $fileObj = $this->stash->getFile( $file ); + $thumb = $fileObj->generateThumbName( $file, [ 'width' => 220 ] ); + $itemHtml .= + $this->msg( 'word-separator' )->escaped() . + $this->msg( 'parentheses' )->rawParams( + Linker::linkKnown( + $this->getPageTitle( "thumb/$file/$thumb" ), + $this->msg( 'uploadstash-thumbnail' )->escaped() + ) + )->escaped(); + } catch ( Exception $e ) { + } + $fileListItemsHtml .= Html::rawElement( 'li', [], $itemHtml ); } - $this->getOutput()->addHtml( Html::rawElement( 'ul', [], $fileListItemsHtml ) ); + $this->getOutput()->addHTML( Html::rawElement( 'ul', [], $fileListItemsHtml ) ); $form->displayForm( $formResult ); - $this->getOutput()->addHtml( Html::rawElement( 'p', [], $refreshHtml ) ); + $this->getOutput()->addHTML( Html::rawElement( 'p', [], $refreshHtml ) ); } else { - $this->getOutput()->addHtml( Html::rawElement( 'p', [], + $this->getOutput()->addHTML( Html::rawElement( 'p', [], Html::element( 'span', [], $this->msg( 'uploadstash-nofiles' )->text() ) . ' ' . $refreshHtml