Localisation updates from https://translatewiki.net.
[lhc/web/wiklou.git] / includes / specials / SpecialUploadStash.php
index 199eebd..1412324 100644 (file)
@@ -391,18 +391,32 @@ class SpecialUploadStash extends UnlistedSpecialPage {
                if ( $files && count( $files ) ) {
                        sort( $files );
                        $fileListItemsHtml = '';
+                       $linkRenderer = $this->getLinkRenderer();
                        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 = $linkRenderer->makeKnownLink(
+                                       $this->getPageTitle( "file/$file" ),
+                                       $file
                                );
+                               try {
+                                       $fileObj = $this->stash->getFile( $file );
+                                       $thumb = $fileObj->generateThumbName( $file, [ 'width' => 220 ] );
+                                       $itemHtml .=
+                                               $this->msg( 'word-separator' )->escaped() .
+                                               $this->msg( 'parentheses' )->rawParams(
+                                                       $linkRenderer->makeKnownLink(
+                                                               $this->getPageTitle( "thumb/$file/$thumb" ),
+                                                               $this->msg( 'uploadstash-thumbnail' )->text()
+                                                       )
+                                               )->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