(part of bug 6100) Set the directionality based on user language instead of content...
[lhc/web/wiklou.git] / includes / SkinLegacy.php
index 22d658a..29c4450 100644 (file)
@@ -9,6 +9,7 @@ if ( !defined( 'MEDIAWIKI' ) ) {
 
 class SkinLegacy extends SkinTemplate {
        var $useHeadElement = true;
+       protected $mWatchLinkNum = 0; // Appended to end of watch link id's
 
        /**
         * Add skin specific stylesheets
@@ -67,6 +68,10 @@ class LegacyTemplate extends BaseTemplate {
                $this->html( 'headelement' );
                echo $this->beforeContent();
                $this->html( 'bodytext' );
+               echo '<div class="printfooter">';
+               $this->html( 'printfooter' );
+               echo '</div>';
+               $this->html( 'debughtml' );
                echo "\n";
                echo $this->afterContent();
                $this->html( 'dataAfterContent' );
@@ -667,22 +672,31 @@ class LegacyTemplate extends BaseTemplate {
        }
 
        function watchThisPage() {
-               global $wgOut;
+               global $wgOut, $wgUser;
                ++$this->mWatchLinkNum;
 
+               // Cache
+               $title = $this->getSkin()->getTitle();
+
                if ( $wgOut->isArticleRelated() ) {
-                       if ( $this->getSkin()->getTitle()->userIsWatching() ) {
+                       if ( $title->userIsWatching() ) {
                                $text = wfMsg( 'unwatchthispage' );
-                               $query = array( 'action' => 'unwatch' );
+                               $query = array(
+                                       'action' => 'unwatch',
+                                       'token' => UnwatchAction::getUnwatchToken( $title, $wgUser ),
+                               );
                                $id = 'mw-unwatch-link' . $this->mWatchLinkNum;
                        } else {
                                $text = wfMsg( 'watchthispage' );
-                               $query = array( 'action' => 'watch' );
+                               $query = array(
+                                       'action' => 'watch',
+                                       'token' => WatchAction::getWatchToken( $title, $wgUser ),
+                               );
                                $id = 'mw-watch-link' . $this->mWatchLinkNum;
                        }
 
                        $s = $this->getSkin()->link(
-                               $this->getSkin()->getTitle(),
+                               $title,
                                $text,
                                array( 'id' => $id ),
                                $query,