Merge "Output converted namespace name in nstab when nstab-* is not defined"
[lhc/web/wiklou.git] / includes / skins / SkinTemplate.php
index f60e4e8..61aad92 100644 (file)
@@ -54,7 +54,8 @@ class SkinTemplate extends Skin {
                $out->addModuleStyles( array(
                        'mediawiki.legacy.shared',
                        'mediawiki.legacy.commonPrint',
-                       'mediawiki.ui.button'
+                       'mediawiki.ui.button',
+                       'mediawiki.sectionAnchor'
                ) );
        }
 
@@ -204,8 +205,6 @@ class SkinTemplate extends Skin {
                        $this->userpageUrlDetails = self::makeKnownUrlDetails( $this->userpage );
                }
 
-
-
                return $tpl;
        }
 
@@ -253,7 +252,6 @@ class SkinTemplate extends Skin {
                        $wgShowCreditsIfMax, $wgArticlePath,
                        $wgScriptPath, $wgServer;
 
-
                $title = $this->getTitle();
                $request = $this->getRequest();
                $out = $this->getOutput();
@@ -353,7 +351,6 @@ class SkinTemplate extends Skin {
                        $tpl->set( 'userlangattributes', $attrs );
                }
 
-
                $tpl->set( 'newtalk', $this->getNewtalks() );
                $tpl->set( 'logo', $this->logoText() );
 
@@ -720,7 +717,7 @@ class SkinTemplate extends Skin {
                        $text = $msg->text();
                } else {
                        global $wgContLang;
-                       $text = $wgContLang->getFormattedNsText(
+                       $text = $wgContLang->getConverter()->convertNamespace(
                                MWNamespace::getSubject( $title->getNamespace() ) );
                }
 
@@ -747,17 +744,20 @@ class SkinTemplate extends Skin {
                self::checkTitle( $title, $name );
                return array(
                        'href' => $title->getLocalURL( $urlaction ),
-                       'exists' => $title->getArticleID() != 0,
+                       'exists' => $title->isKnown(),
                );
        }
 
+       /**
+        * @todo is this even used?
+        */
        function makeArticleUrlDetails( $name, $urlaction = '' ) {
                $title = Title::newFromText( $name );
                $title = $title->getSubjectPage();
                self::checkTitle( $title, $name );
                return array(
                        'href' => $title->getLocalURL( $urlaction ),
-                       'exists' => $title->getArticleID() != 0,
+                       'exists' => $title->exists(),
                );
        }
 
@@ -798,7 +798,6 @@ class SkinTemplate extends Skin {
        protected function buildContentNavigationUrls() {
                global $wgDisableLangConversion;
 
-
                // Display tabs for the relevant title rather than always the title itself
                $title = $this->getRelevantTitle();
                $onPage = $title->equals( $this->getTitle() );
@@ -884,7 +883,6 @@ class SkinTemplate extends Skin {
                                        );
                                }
 
-
                                // Checks if user can edit the current page if it exists or create it otherwise
                                if ( $title->quickUserCan( 'edit', $user )
                                        && ( $title->exists() || $title->quickUserCan( 'create', $user ) )
@@ -950,7 +948,6 @@ class SkinTemplate extends Skin {
                                                'text' => wfMessageFallback( "$skname-view-history", 'history_short' )
                                                        ->setContext( $this->getContext() )->text(),
                                                'href' => $title->getLocalURL( 'action=history' ),
-                                               'rel' => 'archives',
                                        );
 
                                        if ( $title->quickUserCan( 'delete', $user ) ) {
@@ -1002,7 +999,6 @@ class SkinTemplate extends Skin {
                                        );
                                }
 
-
                                // Checks if the user is logged in
                                if ( $this->loggedin && $user->isAllowedAll( 'viewmywatchlist', 'editmywatchlist' ) ) {
                                        /**
@@ -1109,7 +1105,6 @@ class SkinTemplate extends Skin {
                        }
                }
 
-
                return $content_navigation;
        }
 
@@ -1120,7 +1115,6 @@ class SkinTemplate extends Skin {
         */
        private function buildContentActionUrls( $content_navigation ) {
 
-
                // content_actions has been replaced with content_navigation for backwards
                // compatibility and also for skins that just want simple tabs content_actions
                // is now built by flattening the content_navigation arrays into one
@@ -1152,7 +1146,6 @@ class SkinTemplate extends Skin {
                        }
                }
 
-
                return $content_actions;
        }
 
@@ -1163,7 +1156,6 @@ class SkinTemplate extends Skin {
        protected function buildNavUrls() {
                global $wgUploadNavigationUrl;
 
-
                $out = $this->getOutput();
                $request = $this->getRequest();
 
@@ -1224,7 +1216,7 @@ class SkinTemplate extends Skin {
                                'href' => $this->getTitle()->getLocalURL( "action=info" )
                        );
 
-                       if ( $this->getTitle()->getArticleID() ) {
+                       if ( $this->getTitle()->exists() ) {
                                $nav_urls['recentchangeslinked'] = array(
                                        'href' => SpecialPage::getTitleFor( 'Recentchangeslinked', $this->thispage )->getLocalURL()
                                );