http://www.mediawiki.org/wiki/Special:Code/MediaWiki/72403

Revision: 72403
Author:   ialex
Date:     2010-09-05 09:22:33 +0000 (Sun, 05 Sep 2010)

Log Message:
-----------
Per Nikerabbit, fix for r70720: make Translate compatible with 1.16

Modified Paths:
--------------
    trunk/extensions/Translate/tag/PageTranslationHooks.php
    trunk/extensions/Translate/tag/SpecialPageTranslationMovePage.php

Modified: trunk/extensions/Translate/tag/PageTranslationHooks.php
===================================================================
--- trunk/extensions/Translate/tag/PageTranslationHooks.php     2010-09-05 
09:09:52 UTC (rev 72402)
+++ trunk/extensions/Translate/tag/PageTranslationHooks.php     2010-09-05 
09:22:33 UTC (rev 72403)
@@ -532,7 +532,8 @@
        }
 
        public static function replaceMovePage( &$list ) {
-               $list['Movepage'] = 'SpecialPageTranslationMovePage';
+               $old = is_array( $list['Movepage'] );
+               $list['Movepage'] = array( 'SpecialPageTranslationMovePage', 
$old );
                return true;
        }
 

Modified: trunk/extensions/Translate/tag/SpecialPageTranslationMovePage.php
===================================================================
--- trunk/extensions/Translate/tag/SpecialPageTranslationMovePage.php   
2010-09-05 09:09:52 UTC (rev 72402)
+++ trunk/extensions/Translate/tag/SpecialPageTranslationMovePage.php   
2010-09-05 09:22:33 UTC (rev 72403)
@@ -46,8 +46,14 @@
         */
        protected $user;
 
-       public function __construct() {
+       /**
+        * Whether MovePageForm extends SpecialPage
+        */
+       protected $old;
+
+       public function __construct( $old ) {
                parent::__construct( 'Movepage' );
+               $this->old = $old;
        }
 
        /*
@@ -118,7 +124,11 @@
 
                } else {
                        // Delegate... don't want to reimplement this
-                       $this->doNormalMovePage( $par );
+                       if ( $this->old ) {
+                               $this->doOldNormalMovePage();
+                       } else {
+                               $this->doNormalMovePage( $par );
+                       }
                }
        }
 
@@ -160,6 +170,16 @@
                $sp->execute( $par );
        }
 
+       protected function doOldNormalMovePage() {
+               global $wgRequest;
+               $form = new MovePageForm( $this->oldTitle, $this->newTitle );
+               if ( 'submit' == $wgRequest->getVal( 'action' ) && 
$this->checkToken() && $wgRequest->wasPosted() ) {
+                       $form->doSubmit();
+               } else {
+                       $form->showForm( '' );
+               }
+       }
+
        /**
         * Checks token. Use before real actions happen. Have to use wpEditToken
         * for compatibility for SpecialMovepage.php.



_______________________________________________
MediaWiki-CVS mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-cvs

Reply via email to