X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fpage%2FImageHistoryList.php;h=e488b6c1f78da0d90f68e36ff7079d3f65331d87;hb=3fa40cd0bd1b330fac7602bab3ce17de0e18e03d;hp=0a07c6884ff8fea9b806c1a3f797b6d849101493;hpb=58f810a0dceb346b127fd0030be3922e05d8fdee;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;