un-deprecate WikiPage::getAutoDeleteReason
[lhc/web/wiklou.git] / includes / ImagePage.php
index 3aeb70a..fc172da 100644 (file)
@@ -157,7 +157,9 @@ class ImagePage extends Article {
                        $out->addHTML( Xml::openElement( 'div', array( 'id' => 'mw-imagepage-content',
                                'lang' => $pageLang->getCode(), 'dir' => $pageLang->getDir(),
                                'class' => 'mw-content-'.$pageLang->getDir() ) ) );
+
                        parent::view();
+
                        $out->addHTML( Xml::closeElement( 'div' ) );
                } else {
                        # Just need to set the right headers
@@ -268,20 +270,20 @@ class ImagePage extends Article {
                return $r;
        }
 
-       /**
-        * Overloading Article's getContent method.
-        *
-        * Omit noarticletext if sharedupload; text will be fetched from the
-        * shared upload server if possible.
-        * @return string
-        */
-       public function getContent() {
-               $this->loadFile();
-               if ( $this->mPage->getFile() && !$this->mPage->getFile()->isLocal() && 0 == $this->getID() ) {
-                       return '';
-               }
-               return parent::getContent();
-       }
+    /**
+     * Overloading Article's getContentObject method.
+     *
+     * Omit noarticletext if sharedupload; text will be fetched from the
+     * shared upload server if possible.
+     * @return string
+     */
+    public function getContentObject() {
+        $this->loadFile();
+        if ( $this->mPage->getFile() && !$this->mPage->getFile()->isLocal() && 0 == $this->getID() ) {
+            return null;
+        }
+        return parent::getContentObject();
+    }
 
        protected function openShowImage() {
                global $wgImageLimits, $wgEnableUploads, $wgSend404Code;
@@ -990,7 +992,7 @@ class ImageHistoryList extends ContextSource {
                $img = $iscur ? $file->getName() : $file->getArchiveName();
                $userId = $file->getUser( 'id' );
                $userText = $file->getUser( 'text' );
-               $description = $file->getDescription();
+               $description = $file->getDescription( File::FOR_THIS_USER, $user );
 
                $local = $this->current->isLocal();
                $row = $selected = '';
@@ -1038,7 +1040,9 @@ class ImageHistoryList extends ContextSource {
                $row .= '<td>';
                if ( $iscur ) {
                        $row .= wfMsgHtml( 'filehist-current' );
-               } elseif ( $local && $user->isLoggedIn() && $this->title->userCan( 'edit' ) ) {
+               } elseif ( $local && $this->title->quickUserCan( 'edit' )
+                       && $this->title->quickUserCan( 'upload' )
+               ) {
                        if ( $file->isDeleted( File::DELETED_FILE ) ) {
                                $row .= wfMsgHtml( 'filehist-revert' );
                        } else {
@@ -1099,7 +1103,10 @@ class ImageHistoryList extends ContextSource {
                // Image dimensions + size
                $row .= '<td>';
                $row .= htmlspecialchars( $file->getDimensionsString() );
-               $row .= ' <span style="white-space: nowrap;">(' . Linker::formatSize( $file->getSize() ) . ')</span>';
+               $row .= $this->getContext()->msg( 'word-separator' )->plain();
+               $row .= '<span style="white-space: nowrap;">';
+               $row .= $this->getContext()->msg( 'parentheses' )->rawParams( Linker::formatSize( $file->getSize() ) )->plain();
+               $row .= '</span>';
                $row .= '</td>';
 
                // Uploading user