Revert r55800 "bug 19646 Localization of img_auth.php - with enhancements"
[lhc/web/wiklou.git] / includes / FileRevertForm.php
index e4401d0..a058d06 100644 (file)
@@ -3,7 +3,7 @@
 /**
  * File reversion user interface
  *
- * @addtogroup Media
+ * @ingroup Media
  * @author Rob Church <robchur@gmail.com>
  */
 class FileRevertForm {
@@ -38,7 +38,7 @@ class FileRevertForm {
                } elseif( !$wgUser->isLoggedIn() ) {
                        $wgOut->showErrorPage( 'uploadnologin', 'uploadnologintext' );
                        return;
-               } elseif( !$this->title->userCan( 'edit' ) ) {
+               } elseif( !$this->title->userCan( 'edit' ) || !$this->title->userCan( 'upload' ) ) {
                        // The standard read-only thing doesn't make a whole lot of sense
                        // here; surely it should show the image or something? -- RC
                        $article = new Article( $this->title );
@@ -57,7 +57,7 @@ class FileRevertForm {
                }
 
                if( !$this->haveOldVersion() ) {
-                       $wgOut->addHtml( wfMsgExt( 'filerevert-badversion', 'parse' ) );
+                       $wgOut->addHTML( wfMsgExt( 'filerevert-badversion', 'parse' ) );
                        $wgOut->returnToMain( false, $this->title );
                        return;
                }
@@ -69,7 +69,7 @@ class FileRevertForm {
                        // TODO: Preserve file properties from database instead of reloading from file
                        $status = $this->file->upload( $source, $comment, $comment );
                        if( $status->isGood() ) {
-                               $wgOut->addHtml( wfMsgExt( 'filerevert-success', 'parse', $this->title->getText(),
+                               $wgOut->addHTML( wfMsgExt( 'filerevert-success', 'parse', $this->title->getText(),
                                        $wgLang->date( $this->getTimestamp(), true ),
                                        $wgLang->time( $this->getTimestamp(), true ),
                                        wfExpandUrl( $this->file->getArchiveUrl( $this->archiveName ) ) ) );
@@ -104,7 +104,7 @@ class FileRevertForm {
                $form .= '</fieldset>';
                $form .= '</form>';
 
-               $wgOut->addHtml( $form );
+               $wgOut->addHTML( $form );
        }
 
        /**
@@ -114,7 +114,16 @@ class FileRevertForm {
                global $wgOut, $wgUser;
                $wgOut->setPageTitle( wfMsg( 'filerevert', $this->title->getText() ) );
                $wgOut->setRobotPolicy( 'noindex,nofollow' );
-               $wgOut->setSubtitle( wfMsg( 'filerevert-backlink', $wgUser->getSkin()->makeKnownLinkObj( $this->title ) ) );
+               $wgOut->setSubtitle( wfMsg(
+                       'filerevert-backlink',
+                       $wgUser->getSkin()->link(
+                               $this->title,
+                               null,
+                               array(),
+                               array(),
+                               array( 'known', 'noclasses' )
+                       )
+               ) );
        }
 
        /**