Add returntoquery= parameter to Special:Userlogin which adds a query string to the...
[lhc/web/wiklou.git] / includes / ImagePage.php
index 3d815c6..ccfd01d 100644 (file)
@@ -451,9 +451,7 @@ class ImagePage extends Article {
 
                        if($showLink) {
                                $filename = wfEscapeWikiText( $this->displayImg->getName() );
-                               $medialink = $this->displayImg->isMissing() ?
-                                       "'''$filename'''" :
-                                       "[[Media:$filename|$filename]]";
+                               $medialink = "[[Media:$filename|$filename]]";
 
                                if( !$this->displayImg->isSafeFile() ) {
                                        $warning = wfMsgNoTrans( 'mediawarning' );
@@ -484,17 +482,17 @@ EOT
                        if ( $wgEnableUploads && $wgUser->isAllowed( 'upload' ) ) {
                                // Only show an upload link if the user can upload
                                $uploadTitle = SpecialPage::getTitleFor( 'Upload' );
-                               $nofile = wfMsgHtml(
+                               $nofile = array(
                                        'filepage-nofile-link',
                                        $uploadTitle->getFullUrl( array( 'wpDestFile' => $this->img->getName() ) )
                                );
                        }
                        else
                        {
-                               $nofile = wfMsgHtml( 'filepage-nofile' );
+                               $nofile = 'filepage-nofile';
                        }
                        $wgOut->setRobotPolicy( 'noindex,nofollow' );
-                       $wgOut->addHTML( '<div id="mw-imagepage-nofile" class="plainlinks">' . $nofile . '</div>' );
+                       $wgOut->wrapWikiMsg( "<div id='mw-imagepage-nofile' class='plainlinks'>\n$1\n</div>", $nofile );
                }
        }
 
@@ -782,15 +780,16 @@ EOT
  */
 class ImageHistoryList {
 
-       protected $imagePage, $img, $skin, $title, $repo;
+       protected $imagePage, $img, $skin, $title, $repo, $showThumb;
 
        public function __construct( $imagePage ) {
-               global $wgUser;
+               global $wgUser, $wgShowArchiveThumbnails;
                $this->skin = $wgUser->getSkin();
                $this->current = $imagePage->getFile();
                $this->img = $imagePage->getDisplayedFile();
                $this->title = $imagePage->getTitle();
                $this->imagePage = $imagePage;
+               $this->showThumb = $wgShowArchiveThumbnails;
        }
 
        public function getImagePage() {
@@ -811,11 +810,11 @@ class ImageHistoryList {
                        . "<div id=\"mw-imagepage-section-filehistory\">\n"
                        . $wgOut->parse( wfMsgNoTrans( 'filehist-help' ) )
                        . $navLinks . "\n"
-                       . Xml::openElement( 'table', array( 'class' => 'filehistory' ) ) . "\n"
+                       . Xml::openElement( 'table', array( 'class' => 'wikitable filehistory' ) ) . "\n"
                        . '<tr><td></td>'
                        . ( $this->current->isLocal() && ($wgUser->isAllowed('delete') || $wgUser->isAllowed('deleterevision') ) ? '<td></td>' : '' )
                        . '<th>' . wfMsgHtml( 'filehist-datetime' ) . '</th>'
-                       . '<th>' . wfMsgHtml( 'filehist-thumb' ) . '</th>'
+                       . ( $this->showThumb ? '<th>' . wfMsgHtml( 'filehist-thumb' ) . '</th>' : '' )
                        . '<th>' . wfMsgHtml( 'filehist-dimensions' ) . '</th>'
                        . '<th>' . wfMsgHtml( 'filehist-user' ) . '</th>'
                        . '<th>' . wfMsgHtml( 'filehist-comment' ) . '</th>'
@@ -928,9 +927,6 @@ class ImageHistoryList {
                                array( 'known', 'noclasses' )
                        );
                        $row .= '<span class="history-deleted">'.$url.'</span>';
-               } elseif( $file->isMissing() ) {
-                       # Don't link to missing files
-                       $row .= $wgLang->timeAndDate( $timestamp, true );
                } else {
                        $url = $iscur ? $this->current->getUrl() : $this->current->getArchiveUrl( $img );
                        $row .= Xml::element( 'a', array( 'href' => $url ), $wgLang->timeAndDate( $timestamp, true ) );
@@ -938,7 +934,9 @@ class ImageHistoryList {
                $row .= "</td>";
 
                // Thumbnail
-               $row .= '<td>' . $this->getThumbForLine( $file ) . '</td>';
+               if ( $this->showThumb ) {
+                       $row .= '<td>' . $this->getThumbForLine( $file ) . '</td>';
+               }
 
                // Image dimensions + size
                $row .= '<td>';
@@ -978,9 +976,7 @@ class ImageHistoryList {
        protected function getThumbForLine( $file ) {
                global $wgLang;
 
-               if( $file->isMissing() ) {
-                       return '<strong class="error">' . wfMsgHtml( 'filehist-missing' ) . '</strong>';
-               } elseif( $file->allowInlineDisplay() && $file->userCan( File::DELETED_FILE ) && !$file->isDeleted( File::DELETED_FILE ) ) {
+               if( $file->allowInlineDisplay() && $file->userCan( File::DELETED_FILE ) && !$file->isDeleted( File::DELETED_FILE ) ) {
                        $params = array(
                                'width' => '120',
                                'height' => '120',