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 ) );
$form->displayForm( $formResult );
"uploadstash-badtoken": "Performing that action failed. Perhaps because your editing credentials expired. Please try again.",
"uploadstash-errclear": "Clearing the files failed.",
"uploadstash-refresh": "Refresh the list of files",
+ "uploadstash-thumbnail": "view thumbnail",
"invalid-chunk-offset": "Invalid chunk offset",
"img-auth-accessdenied": "Access denied",
"img-auth-nopathinfo": "Missing PATH_INFO.\nYour server is not set up to pass this information.\nIt may be CGI-based and cannot support img_auth.\nSee https://www.mediawiki.org/wiki/Special:MyLanguage/Manual:Image_Authorization.",
"uploadstash-badtoken": "Used as error message in [[Special:UploadStash]].",
"uploadstash-errclear": "Used as error message in [[Special:UploadStash]].",
"uploadstash-refresh": "Used as link text in [[Special:UploadStash]].",
+ "uploadstash-thumbnail": "Used as link text in [[Special:UploadStash]].",
"invalid-chunk-offset": "Error that can happen if chunks get uploaded out of order.\nAs a result of this error, clients can continue from an offset provided or restart the upload.\nUsed on [[Special:UploadWizard]].",
"img-auth-accessdenied": "[[mw:Manual:Image Authorization|Manual:Image Authorization]]: Access Denied\n{{Identical|Access denied}}",
"img-auth-nopathinfo": "[[mw:Manual:Image Authorization|Manual:Image Authorization]]: Missing PATH_INFO - see english description\n{{Doc-important|This is plain text. Do not use any wiki syntax.}}",