X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fpage%2FImageHistoryList.php;h=e488b6c1f78da0d90f68e36ff7079d3f65331d87;hb=3c4be2f2a8f9104d539c15440a6a3e5fd5f3a85c;hp=0a07c6884ff8fea9b806c1a3f797b6d849101493;hpb=b53f299af26aa0b14b3cd3cc37ec1126a61cdc62;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/page/ImageHistoryList.php b/includes/page/ImageHistoryList.php index 0a07c6884f..e488b6c1f7 100644 --- a/includes/page/ImageHistoryList.php +++ b/includes/page/ImageHistoryList.php @@ -54,13 +54,14 @@ class ImageHistoryList extends ContextSource { * @param ImagePage $imagePage */ public function __construct( $imagePage ) { - global $wgShowArchiveThumbnails; + $context = $imagePage->getContext(); $this->current = $imagePage->getPage()->getFile(); $this->img = $imagePage->getDisplayedFile(); $this->title = $imagePage->getTitle(); $this->imagePage = $imagePage; - $this->showThumb = $wgShowArchiveThumbnails && $this->img->canRender(); - $this->setContext( $imagePage->getContext() ); + $this->showThumb = $context->getConfig()->get( 'ShowArchiveThumbnails' ) && + $this->img->canRender(); + $this->setContext( $context ); } /** @@ -193,16 +194,18 @@ class ImageHistoryList extends ContextSource { $row .= ""; if ( !$file->userCan( File::DELETED_FILE, $user ) ) { # Don't link to unviewable files - $row .= '' - . $lang->userTimeAndDate( $timestamp, $user ) . ''; + $row .= Html::element( 'span', [ 'class' => 'history-deleted' ], + $lang->userTimeAndDate( $timestamp, $user ) + ); } elseif ( $file->isDeleted( File::DELETED_FILE ) ) { + $timeAndDate = htmlspecialchars( $lang->userTimeAndDate( $timestamp, $user ) ); if ( $local ) { $this->preventClickjacking(); $revdel = SpecialPage::getTitleFor( 'Revisiondelete' ); # Make a link to review the image $url = Linker::linkKnown( $revdel, - $lang->userTimeAndDate( $timestamp, $user ), + $timeAndDate, [], [ 'target' => $this->title->getPrefixedText(), @@ -211,12 +214,13 @@ class ImageHistoryList extends ContextSource { ] ); } else { - $url = $lang->userTimeAndDate( $timestamp, $user ); + $url = $timeAndDate; } $row .= '' . $url . ''; } elseif ( !$file->exists() ) { - $row .= '' - . $lang->userTimeAndDate( $timestamp, $user ) . ''; + $row .= Html::element( 'span', [ 'class' => 'mw-file-missing' ], + $lang->userTimeAndDate( $timestamp, $user ) + ); } else { $url = $iscur ? $this->current->getUrl() : $this->current->getArchiveUrl( $img ); $row .= Xml::element( @@ -264,9 +268,12 @@ class ImageHistoryList extends ContextSource { $row .= '' . $this->msg( 'rev-deleted-comment' )->escaped() . ''; } else { - $row .= - '' . Linker::formatComment( $description, $this->title ) . ''; + $contLang = MediaWikiServices::getInstance()->getContentLanguage(); + $row .= Html::rawElement( + 'td', + [ 'dir' => $contLang->getDir() ], + Linker::formatComment( $description, $this->title ) + ); } $rowClass = null;