Index: trunk/phase3/includes/ImagePage.php |
— | — | @@ -780,9 +780,7 @@ |
781 | 781 | $img = $iscur ? $file->getName() : $file->getArchiveName(); |
782 | 782 | $user = $file->getUser('id'); |
783 | 783 | $usertext = $file->getUser('text'); |
784 | | - $size = $file->getSize(); |
785 | 784 | $description = $file->getDescription(); |
786 | | - $dims = $file->getDimensionsString(); |
787 | 785 | $sha1 = $file->getSha1(); |
788 | 786 | |
789 | 787 | $local = $this->current->isLocal(); |
— | — | @@ -868,35 +866,19 @@ |
869 | 867 | $url = $iscur ? $this->current->getUrl() : $this->current->getArchiveUrl( $img ); |
870 | 868 | $row .= Xml::element( 'a', array( 'href' => $url ), $wgLang->timeAndDate( $timestamp, true ) ); |
871 | 869 | } |
| 870 | + $row .= "</td>"; |
872 | 871 | |
873 | 872 | // Thumbnail |
874 | | - if( $file->isMissing() ) { |
875 | | - $row .= '</td><td><strong class="error">' . wfMsgHtml( 'filehist-missing' ) . '</strong>'; |
876 | | - } elseif( $file->allowInlineDisplay() && $file->userCan( File::DELETED_FILE ) && !$file->isDeleted( File::DELETED_FILE ) ) { |
877 | | - $params = array( |
878 | | - 'width' => '120', |
879 | | - 'height' => '120', |
880 | | - ); |
881 | | - $thumbnail = $file->transform( $params ); |
882 | | - $options = array( |
883 | | - 'alt' => wfMsg( 'filehist-thumbtext', $wgLang->timeAndDate( $timestamp, true ) ), |
884 | | - 'file-link' => true, |
885 | | - ); |
886 | | - $row .= '</td><td>' . ( $thumbnail ? $thumbnail->toHtml( $options ) : |
887 | | - wfMsgHtml( 'filehist-nothumb' ) ); |
888 | | - } else { |
889 | | - $row .= '</td><td>' . wfMsgHtml( 'filehist-nothumb' ); |
890 | | - } |
891 | | - $row .= "</td><td>"; |
| 873 | + $row .= '<td>' . $this->getThumbForLine( $file ) . '</td>'; |
892 | 874 | |
893 | | - // Image dimensions |
894 | | - $row .= htmlspecialchars( $dims ); |
| 875 | + // Image dimensions + size |
| 876 | + $row .= '<td>'; |
| 877 | + $row .= htmlspecialchars( $file->getDimensionsString() ); |
| 878 | + $row .= " <span style='white-space: nowrap;'>(" . $this->skin->formatSize( $file->getSize() ) . ')</span>'; |
| 879 | + $row .= '</td>'; |
895 | 880 | |
896 | | - // File size |
897 | | - $row .= " <span style='white-space: nowrap;'>(" . $this->skin->formatSize( $size ) . ')</span>'; |
898 | | - |
899 | 881 | // Uploading user |
900 | | - $row .= '</td><td>'; |
| 882 | + $row .= '<td>'; |
901 | 883 | if( $local ) { |
902 | 884 | // Hide deleted usernames |
903 | 885 | if( $file->isDeleted(File::DELETED_USER) ) { |
— | — | @@ -923,6 +905,32 @@ |
924 | 906 | |
925 | 907 | return "<tr{$classAttr}>{$row}</tr>\n"; |
926 | 908 | } |
| 909 | + |
| 910 | + protected function getThumbForLine( $file ) { |
| 911 | + global $wgLang; |
| 912 | + |
| 913 | + if( $file->isMissing() ) { |
| 914 | + return '<strong class="error">' . wfMsgHtml( 'filehist-missing' ) . '</strong>'; |
| 915 | + } elseif( $file->allowInlineDisplay() && $file->userCan( File::DELETED_FILE ) && !$file->isDeleted( File::DELETED_FILE ) ) { |
| 916 | + $params = array( |
| 917 | + 'width' => '120', |
| 918 | + 'height' => '120', |
| 919 | + ); |
| 920 | + $timestamp = wfTimestamp(TS_MW, $file->getTimestamp()); |
| 921 | + |
| 922 | + $thumbnail = $file->transform( $params ); |
| 923 | + $options = array( |
| 924 | + 'alt' => wfMsg( 'filehist-thumbtext', $wgLang->timeAndDate( $timestamp, true ) ), |
| 925 | + 'file-link' => true, |
| 926 | + ); |
| 927 | + |
| 928 | + if ( !$thumbnail ) return wfMsgHtml( 'filehist-nothumb' ); |
| 929 | + |
| 930 | + return $thumbnail->toHtml( $options ); |
| 931 | + } else { |
| 932 | + return wfMsgHtml( 'filehist-nothumb' ); |
| 933 | + } |
| 934 | + } |
927 | 935 | } |
928 | 936 | |
929 | 937 | class ImageHistoryPseudoPager extends ReverseChronologicalPager { |
— | — | @@ -958,12 +966,7 @@ |
959 | 967 | if( count($this->mHist) ) { |
960 | 968 | $list = new ImageHistoryList( $this->mImagePage ); |
961 | 969 | # Generate prev/next links |
962 | | - $navLink = ''; |
963 | | - |
964 | | - # Only add navigation links when needed |
965 | | - if ( !$this->mIsFirst && !$this->mIsLast ) { |
966 | | - $navLink = $this->getNavigationBar(); |
967 | | - } |
| 970 | + $navLink = $this->getNavigationBar(); |
968 | 971 | $s = $list->beginImageHistoryList($navLink); |
969 | 972 | // Skip rows there just for paging links |
970 | 973 | for( $i = $this->mRange[0]; $i <= $this->mRange[1]; $i++ ) { |