Merge "Display "Printable version" links in toolbox on special pages"
[lhc/web/wiklou.git] / includes / SkinTemplate.php
index 739be06..4af6332 100644 (file)
@@ -174,7 +174,7 @@ class SkinTemplate extends Skin {
                global $wgContLang;
                global $wgScript, $wgStylePath;
                global $wgMimeType, $wgJsMimeType;
-               global $wgXhtmlDefaultNamespace, $wgXhtmlNamespaces, $wgHtml5Version;
+               global $wgXhtmlNamespaces, $wgHtml5Version;
                global $wgDisableCounters, $wgSitename, $wgLogo;
                global $wgMaxCredits, $wgShowCreditsIfMax;
                global $wgPageShowWatchingUsers;
@@ -236,7 +236,7 @@ class SkinTemplate extends Skin {
 
                        $tpl->set( 'jsvarurl', false );
 
-                       $tpl->setRef( 'xhtmldefaultnamespace', $wgXhtmlDefaultNamespace );
+                       $tpl->set( 'xhtmldefaultnamespace', 'http://www.w3.org/1999/xhtml' );
                        $tpl->set( 'xhtmlnamespaces', $wgXhtmlNamespaces );
                        $tpl->set( 'html5version', $wgHtml5Version );
                        $tpl->set( 'headlinks', $out->getHeadLinks() );
@@ -613,12 +613,15 @@ class SkinTemplate extends Skin {
                                'href' => $href,
                                'active' => ( $href == $pageurl )
                        );
-                       $href = self::makeSpecialUrl( 'Watchlist' );
-                       $personal_urls['watchlist'] = array(
-                               'text' => $this->msg( 'mywatchlist' )->text(),
-                               'href' => $href,
-                               'active' => ( $href == $pageurl )
-                       );
+
+                       if ( $this->getUser()->isAllowed( 'viewmywatchlist' ) ) {
+                               $href = self::makeSpecialUrl( 'Watchlist' );
+                               $personal_urls['watchlist'] = array(
+                                       'text' => $this->msg( 'mywatchlist' )->text(),
+                                       'href' => $href,
+                                       'active' => ( $href == $pageurl )
+                               );
+                       }
 
                        # We need to do an explicit check for Special:Contributions, as we
                        # have to match both the title, and the target, which could come
@@ -992,7 +995,7 @@ class SkinTemplate extends Skin {
                                wfProfileOut( __METHOD__ . '-live' );
 
                                // Checks if the user is logged in
-                               if ( $this->loggedin ) {
+                               if ( $this->loggedin && $user->isAllowedAll( 'viewmywatchlist', 'editmywatchlist' ) ) {
                                        /**
                                         * The following actions use messages which, if made particular to
                                         * the any specific skins, would break the Ajax code which makes this
@@ -1253,6 +1256,7 @@ class SkinTemplate extends Skin {
                        }
 
                        $sur = new UserrightsPage;
+                       $sur->setContext( $this->getContext() );
                        if ( $sur->userCanExecute( $this->getUser() ) ) {
                                $nav_urls['userrights'] = array(
                                        'href' => self::makeSpecialUrlSubpage( 'Userrights', $rootUser )