From 2204974ba7c6c9e73d0d971e6d24c47f7c7e6e46 Mon Sep 17 00:00:00 2001 From: Rotem Liss Date: Fri, 29 Aug 2008 11:54:34 +0000 Subject: [PATCH] Show thumbnails in the file history list. The dimensions are the same as in the default image gallery. Patch by User:Agbad, rewritten by me. --- CREDITS | 1 + RELEASE-NOTES | 1 + includes/ImagePage.php | 16 ++++++++++++++++ languages/messages/MessagesEn.php | 3 +++ languages/messages/MessagesHe.php | 3 +++ maintenance/language/messages.inc | 3 +++ 6 files changed, 27 insertions(+) diff --git a/CREDITS b/CREDITS index 719d4612d5..8882c61588 100644 --- a/CREDITS +++ b/CREDITS @@ -36,6 +36,7 @@ following names for their contribution to the product. * Victor Vasiliev == Patch Contributors == +* Agbad * Daniel Arnold * Danny B. * Jeremy Baron diff --git a/RELEASE-NOTES b/RELEASE-NOTES index 6e7b0f69e2..b2115113b4 100644 --- a/RELEASE-NOTES +++ b/RELEASE-NOTES @@ -101,6 +101,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN * BMP images are now displayed as PNG * (bug 13471) Added NUMBERINGROUP magic word * (bug 11884) Now support Flash EXIF attribute +* Show thumbnails in the file history list === Bug fixes in 1.14 === diff --git a/includes/ImagePage.php b/includes/ImagePage.php index e37070081c..2f1faf88a0 100644 --- a/includes/ImagePage.php +++ b/includes/ImagePage.php @@ -819,6 +819,7 @@ class ImageHistoryList { . '' . ( $this->current->isLocal() && ($wgUser->isAllowed('delete') || $wgUser->isAllowed('deleterevision') ) ? '' : '' ) . '' . wfMsgHtml( 'filehist-datetime' ) . '' + . '' . wfMsgHtml( 'filehist-thumb' ) . '' . '' . wfMsgHtml( 'filehist-dimensions' ) . '' . '' . wfMsgHtml( 'filehist-user' ) . '' . '' . wfMsgHtml( 'filehist-comment' ) . '' @@ -921,6 +922,21 @@ class ImageHistoryList { $row .= Xml::element( 'a', array( 'href' => $url ), $wgLang->timeAndDate( $timestamp, true ) ); } + // Thumbnail + if( $file->allowInlineDisplay() && $file->userCan( File::DELETED_FILE ) && !$file->isDeleted( File::DELETED_FILE ) ) { + $params = array( + 'width' => '120', + 'height' => '120', + ); + $thumbnail = $file->transform( $params ); + $options = array( + 'alt' => wfMsg( 'filehist-thumbtext', $wgLang->timeAndDate( $timestamp, true ) ), + 'file-link' => true, + ); + $row .= '' . $thumbnail->toHtml( $options ); + } else { + $row .= '' . wfMsg( 'filehist-nothumb' ); + } $row .= ""; // Image dimensions diff --git a/languages/messages/MessagesEn.php b/languages/messages/MessagesEn.php index 906bfe2a76..6deb21cf85 100644 --- a/languages/messages/MessagesEn.php +++ b/languages/messages/MessagesEn.php @@ -1821,6 +1821,9 @@ A click on a column header changes the sorting.', 'filehist-revert' => 'revert', 'filehist-current' => 'current', 'filehist-datetime' => 'Date/Time', +'filehist-thumb' => 'Thumbnail', +'filehist-thumbtext' => 'Thumbnail for version as of $1', +'filehist-nothumb' => 'No thumbnail', 'filehist-user' => 'User', 'filehist-dimensions' => 'Dimensions', 'filehist-filesize' => 'File size', diff --git a/languages/messages/MessagesHe.php b/languages/messages/MessagesHe.php index ad50543423..bcb0e09f01 100644 --- a/languages/messages/MessagesHe.php +++ b/languages/messages/MessagesHe.php @@ -1504,6 +1504,9 @@ PICT # שונות 'filehist-revert' => 'שחזור', 'filehist-current' => 'נוכחית', 'filehist-datetime' => 'תאריך/שעה', +'filehist-thumb' => 'תמונה ממוזערת', +'filehist-thumbtext' => 'תמונה ממוזערת לגרסה מתאריך $1', +'filehist-nothumb' => 'אין תמונה ממוזערת', 'filehist-user' => 'משתמש', 'filehist-dimensions' => 'ממדים', 'filehist-filesize' => 'גודל הקובץ', diff --git a/maintenance/language/messages.inc b/maintenance/language/messages.inc index 91c7a347d6..3e894114a3 100644 --- a/maintenance/language/messages.inc +++ b/maintenance/language/messages.inc @@ -1112,6 +1112,9 @@ $wgMessageStructure = array( 'filehist-revert', 'filehist-current', 'filehist-datetime', + 'filehist-thumb', + 'filehist-thumbtext', + 'filehist-nothumb', 'filehist-user', 'filehist-dimensions', 'filehist-filesize', -- 2.20.1