Merge branch 'Wikidata' of ssh://gerrit.wikimedia.org:29418/mediawiki/core into Wikidata
[lhc/web/wiklou.git] / includes / SkinTemplate.php
index d08b7ef..b74f7c5 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
- * Base class for template-based skins
+ * Base class for template-based skins.
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
  * @file
  */
 
-if ( !defined( 'MEDIAWIKI' ) ) {
-       die( 1 );
-}
-
 /**
  * Wrapper object for MediaWiki's localization functions,
  * to be passed to the template engine.
@@ -581,10 +577,12 @@ class SkinTemplate extends Skin {
                        );
 
                        # We need to do an explicit check for Special:Contributions, as we
-                       # have to match both the title, and the target (which could come
-                       # from request values or be specified in "sub page" form. The plot
+                       # have to match both the title, and the target, which could come
+                       # from request values (Special:Contributions?target=Jimbo_Wales)
+                       # or be specified in "sub page" form
+                       # (Special:Contributions/Jimbo_Wales). The plot
                        # thickens, because the Title object is altered for special pages,
-                       # so doesn't contain the original alias-with-subpage.
+                       # so it doesn't contain the original alias-with-subpage.
                        $origTitle = Title::newFromText( $request->getText( 'title' ) );
                        if( $origTitle instanceof Title && $origTitle->isSpecialPage() ) {
                                list( $spName, $spPar ) = SpecialPageFactory::resolveAlias( $origTitle->getText() );
@@ -646,6 +644,9 @@ class SkinTemplate extends Skin {
                                }
                        }
 
+                       if ( isset( $createaccount_url ) ) {
+                               $personal_urls['createaccount'] = $createaccount_url;
+                       }
 
                        if( $this->showIPinHeader() ) {
                                $href = &$this->userpageUrlDetails['href'];
@@ -667,9 +668,6 @@ class SkinTemplate extends Skin {
                        } else {
                                $personal_urls['login'] = $login_url;
                        }
-                       if ( isset($createaccount_url) ) {
-                               $personal_urls['createaccount'] = $createaccount_url;
-                       }
                }
 
                wfRunHooks( 'PersonalUrls', array( &$personal_urls, &$title ) );
@@ -1188,12 +1186,10 @@ class SkinTemplate extends Skin {
                                'href' => self::makeSpecialUrlSubpage( 'Contributions', $rootUser )
                        );
 
-                       if ( $user->isLoggedIn() ) {
-                               $logPage = SpecialPage::getTitleFor( 'Log' );
-                               $nav_urls['log'] = array(
-                                       'href' => $logPage->getLocalUrl( array( 'user' => $rootUser ) )
-                               );
-                       }
+                       $logPage = SpecialPage::getTitleFor( 'Log' );
+                       $nav_urls['log'] = array(
+                               'href' => $logPage->getLocalUrl( array( 'user' => $rootUser ) )
+                       );
 
                        if ( $this->getUser()->isAllowed( 'block' ) ) {
                                $nav_urls['blockip'] = array(