Merge "Add DROP INDEX support to DatabaseSqlite::replaceVars method"
[lhc/web/wiklou.git] / includes / SkinTemplate.php
index d968d79..1e7ce13 100644 (file)
@@ -1280,12 +1280,14 @@ 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 )
-                               );
+                       if ( !$user->isAnon() ) {
+                               $sur = new UserrightsPage;
+                               $sur->setContext( $this->getContext() );
+                               if ( $sur->userCanExecute( $this->getUser() ) ) {
+                                       $nav_urls['userrights'] = array(
+                                               'href' => self::makeSpecialUrlSubpage( 'Userrights', $rootUser )
+                                       );
+                               }
                        }
                }
 
@@ -1715,6 +1717,10 @@ abstract class BaseTemplate extends QuickTemplate {
         * on the link) is present it will be used to generate a tooltip and
         * accesskey for the link.
         *
+        * The keys "context" and "primary" are ignored; these keys are used
+        * internally by skins and are not supposed to be included in the HTML
+        * output.
+        *
         * If you don't want an accesskey, set $item['tooltiponly'] = true;
         *
         * @param array $options can be used to affect the output of a link.
@@ -1755,7 +1761,7 @@ abstract class BaseTemplate extends QuickTemplate {
 
                if ( isset( $item['href'] ) || isset( $options['link-fallback'] ) ) {
                        $attrs = $item;
-                       foreach ( array( 'single-id', 'text', 'msg', 'tooltiponly' ) as $k ) {
+                       foreach ( array( 'single-id', 'text', 'msg', 'tooltiponly', 'context', 'primary' ) as $k ) {
                                unset( $attrs[$k] );
                        }
 
@@ -1992,9 +1998,10 @@ abstract class BaseTemplate extends QuickTemplate {
         * body and html tags.
         */
        function printTrail() { ?>
+<?php echo MWDebug::getDebugHTML( $this->getSkin()->getContext() ); ?>
 <?php $this->html( 'bottomscripts' ); /* JS call to runBodyOnloadHook */ ?>
 <?php $this->html( 'reporttime' ) ?>
-<?php echo MWDebug::getDebugHTML( $this->getSkin()->getContext() );
+<?php
        }
 
 }