If you request LogEventList to display the combination of 2 log types, and one of
[lhc/web/wiklou.git] / includes / ImagePage.php
index f98466a..e836104 100644 (file)
@@ -103,7 +103,7 @@ class ImagePage extends Article {
                                $wgOut->setPageTitle( $this->getTitle()->getPrefixedText() );
                                $wgOut->addHTML( $this->viewRedirect( Title::makeTitle( NS_FILE, $this->mPage->getFile()->getName() ),
                                        /* $appendSubtitle */ true, /* $forceKnown */ true ) );
-                               $this->mPage->viewUpdates();
+                               $this->mPage->doViewUpdates( $this->getContext()->getUser() );
                                return;
                        }
                }
@@ -140,7 +140,7 @@ class ImagePage extends Article {
                        # Just need to set the right headers
                        $wgOut->setArticleFlag( true );
                        $wgOut->setPageTitle( $this->getTitle()->getPrefixedText() );
-                       $this->mPage->viewUpdates();
+                       $this->mPage->doViewUpdates( $this->getContext()->getUser() );
                }
 
                # Show shared description, if needed
@@ -262,7 +262,7 @@ class ImagePage extends Article {
 
        protected function openShowImage() {
                global $wgOut, $wgUser, $wgImageLimits, $wgRequest,
-                       $wgLang, $wgEnableUploads;
+                       $wgLang, $wgEnableUploads, $wgSend404Code;
 
                $this->loadFile();
 
@@ -332,8 +332,8 @@ class ImagePage extends Article {
                                                rawParams( $this->makeSizeLink( $params, $width, $height ) )->
                                                parse() . ' ' .
                                                Html::rawElement( 'span', array( 'class' => 'mw-filepage-other-resolutions' ),
-                                                       wfMessage( 'show-big-image-other' )->
-                                                       rawParams( $wgLang->pipeList( $otherSizes ), count( $otherSizes ) )->parse()
+                                                       wfMessage( 'show-big-image-other' )->rawParams( $wgLang->pipeList( $otherSizes ) )->
+                                                       params( count( $otherSizes ) )->parse()
                                                );
                                } elseif ( $width == 0 && $height == 0 ){
                                        # Some sort of audio file that doesn't have dimensions
@@ -421,7 +421,7 @@ class ImagePage extends Article {
                                                wfMsgExt( 'imgmultigoto', array( 'parseinline', 'replaceafter' ), $select ) .
                                                Xml::submitButton( wfMsg( 'imgmultigo' ) ) .
                                                Xml::closeElement( 'form' ) .
-                                               "<hr />$thumb1\n$thumb2<br clear=\"all\" /></div></td></tr></table>"
+                                               "<hr />$thumb1\n$thumb2<br style=\"clear: both\" /></div></td></tr></table>"
                                        );
                                }
                        } else {
@@ -481,7 +481,7 @@ EOT
                        // by Article::View().
                        $wgOut->setRobotPolicy( 'noindex,nofollow' );
                        $wgOut->wrapWikiMsg( "<div id='mw-imagepage-nofile' class='plainlinks'>\n$1\n</div>", $nofile );
-                       if ( !$this->getID() ) {
+                       if ( !$this->getID() && $wgSend404Code ) {
                                // If there is no image, no shared image, and no description page,
                                // output a 404, to be consistent with articles.
                                $wgRequest->response()->header( 'HTTP/1.1 404 Not Found' );
@@ -788,20 +788,14 @@ EOT
         * Delete the file, or an earlier version of it
         */
        public function delete() {
-               global $wgUploadMaintenance;
-               if ( $wgUploadMaintenance && $this->getTitle() && $this->getTitle()->getNamespace() == NS_FILE ) {
-                       global $wgOut;
-                       $wgOut->wrapWikiMsg( "<div class='error'>\n$1\n</div>\n", array( 'filedelete-maintenance' ) );
-                       return;
-               }
-
-               $this->loadFile();
-               if ( !$this->mPage->getFile()->exists() || !$this->mPage->getFile()->isLocal() || $this->mPage->getFile()->getRedirected() ) {
+               $file = $this->mPage->getFile();
+               if ( !$file->exists() || !$file->isLocal() || $file->getRedirected() ) {
                        // Standard article deletion
                        parent::delete();
                        return;
                }
-               $deleter = new FileDeleteForm( $this->mPage->getFile() );
+
+               $deleter = new FileDeleteForm( $file );
                $deleter->execute();
        }
 
@@ -992,7 +986,7 @@ class ImageHistoryList {
                                        array(
                                                'action' => 'revert',
                                                'oldimage' => $img,
-                                               'wpEditToken' => $wgUser->editToken( $img )
+                                               'wpEditToken' => $wgUser->getEditToken( $img )
                                        ),
                                        array( 'known', 'noclasses' )
                                );
@@ -1020,7 +1014,7 @@ class ImageHistoryList {
                                        array(
                                                'target' => $this->title->getPrefixedText(),
                                                'file' => $img,
-                                               'token' => $wgUser->editToken( $img )
+                                               'token' => $wgUser->getEditToken( $img )
                                        ),
                                        array( 'known', 'noclasses' )
                                );
@@ -1064,7 +1058,7 @@ class ImageHistoryList {
                if ( $file->isDeleted( File::DELETED_COMMENT ) ) {
                        $row .= '<td><span class="history-deleted">' . wfMsgHtml( 'rev-deleted-comment' ) . '</span></td>';
                } else {
-                       $row .= '<td dir="' . $wgContLang->getDir() . '">' . Linker::commentBlock( $description, $this->title ) . '</td>';
+                       $row .= '<td dir="' . $wgContLang->getDir() . '">' . Linker::formatComment( $description, $this->title ) . '</td>';
                }
 
                $rowClass = null;