* replace use of deprecated makeLinkObj() by link() in core
[lhc/web/wiklou.git] / includes / SkinTemplate.php
index a4e5e2e..dcbedd8 100644 (file)
@@ -142,7 +142,7 @@ class SkinTemplate extends Skin {
                global $wgMaxCredits, $wgShowCreditsIfMax;
                global $wgPageShowWatchingUsers;
                global $wgUseTrackbacks, $wgUseSiteJs;
-               global $wgArticlePath, $wgScriptPath, $wgServer, $wgLang, $wgCanonicalNamespaceNames;
+               global $wgArticlePath, $wgScriptPath, $wgServer, $wgCanonicalNamespaceNames;
 
                wfProfileIn( __METHOD__ );
 
@@ -276,6 +276,7 @@ class SkinTemplate extends Skin {
                $tpl->setRef( 'userpage', $this->userpage );
                $tpl->setRef( 'userpageurl', $this->userpageUrlDetails['href'] );
                $tpl->set( 'userlang', $wgLang->getCode() );
+               $tpl->set( 'userlangattributes', 'lang="' . $wgLang->getCode() . '" xml:lang="' . $wgLang->getCode() . '"' );
                $tpl->set( 'pagecss', $this->setupPageCss() );
                $tpl->setRef( 'usercss', $this->usercss );
                $tpl->setRef( 'userjs', $this->userjs );
@@ -528,10 +529,10 @@ class SkinTemplate extends Skin {
                        # from request values or be specified in "sub page" form. The plot
                        # thickens, because $wgTitle is altered for special pages, so doesn't
                        # contain the original alias-with-subpage.
-                       $title = Title::newFromText( $wgRequest->getText( 'title' ) );
-                       if( $title instanceof Title && $title->getNamespace() == NS_SPECIAL ) {
+                       $origTitle = Title::newFromText( $wgRequest->getText( 'title' ) );
+                       if( $origTitle instanceof Title && $origTitle->getNamespace() == NS_SPECIAL ) {
                                list( $spName, $spPar ) =
-                                       SpecialPage::resolveAliasWithSubpage( $title->getText() );
+                                       SpecialPage::resolveAliasWithSubpage( $origTitle->getText() );
                                $active = $spName == 'Contributions'
                                        && ( ( $spPar && $spPar == $this->username )
                                                || $wgRequest->getText( 'target' ) == $this->username );
@@ -858,17 +859,12 @@ class SkinTemplate extends Skin {
 
                $nav_urls = array();
                $nav_urls['mainpage'] = array( 'href' => self::makeMainPageUrl() );
-               if( $wgEnableUploads && $wgUser->isAllowed( 'upload' ) ) {
-                       if( $wgUploadNavigationUrl ) {
-                               $nav_urls['upload'] = array( 'href' => $wgUploadNavigationUrl );
-                       } else {
-                               $nav_urls['upload'] = array( 'href' => self::makeSpecialUrl( 'Upload' ) );
-                       }
+               if( $wgUploadNavigationUrl ) {
+                       $nav_urls['upload'] = array( 'href' => $wgUploadNavigationUrl );
+               } elseif( $wgEnableUploads && $wgUser->isAllowed( 'upload' ) ) {
+                       $nav_urls['upload'] = array( 'href' => self::makeSpecialUrl( 'Upload' ) );
                } else {
-                       if( $wgUploadNavigationUrl )
-                               $nav_urls['upload'] = array( 'href' => $wgUploadNavigationUrl );
-                       else
-                               $nav_urls['upload'] = false;
+                       $nav_urls['upload'] = false;
                }
                $nav_urls['specialpages'] = array( 'href' => self::makeSpecialUrl( 'Specialpages' ) );