Per Platonides on CR r75334, use $article->getParserOutput() to get latest revision...
[lhc/web/wiklou.git] / includes / FileRevertForm.php
index 385d83b..47084aa 100644 (file)
@@ -17,7 +17,7 @@ class FileRevertForm {
        /**
         * Constructor
         *
-        * @param File $file File we're reverting
+        * @param $file File we're reverting
         */
        public function __construct( $file ) {
                $this->title = $file->getTitle();
@@ -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 ) ) ) );
@@ -88,11 +88,11 @@ class FileRevertForm {
         * Show the confirmation form
         */
        protected function showForm() {
-               global $wgOut, $wgUser, $wgRequest, $wgLang, $wgContLang;
+               global $wgOut, $wgUser, $wgLang, $wgContLang;
                $timestamp = $this->getTimestamp();
 
                $form  = Xml::openElement( 'form', array( 'method' => 'post', 'action' => $this->getAction() ) );
-               $form .= Xml::hidden( 'wpEditToken', $wgUser->editToken( $this->archiveName ) );
+               $form .= Html::hidden( 'wpEditToken', $wgUser->editToken( $this->archiveName ) );
                $form .= '<fieldset><legend>' . wfMsgHtml( 'filerevert-legend' ) . '</legend>';
                $form .= wfMsgExt( 'filerevert-intro', 'parse', $this->title->getText(),
                        $wgLang->date( $timestamp, true ), $wgLang->time( $timestamp, true ),
@@ -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' )
+                       )
+               ) );
        }
 
        /**