From 851b8fe6920e7a4ff2c263710d6e55afe8cdd461 Mon Sep 17 00:00:00 2001 From: =?utf8?q?=C3=86var=20Arnfj=C3=B6r=C3=B0=20Bjarmason?= Date: Mon, 23 May 2005 14:44:17 +0000 Subject: [PATCH] * Using a wfMsgForContent message to build the navigation urls now. --- includes/DefaultSettings.php | 16 --------------- includes/SkinTemplate.php | 40 ++++++------------------------------ skins/MonoBook.php | 7 +------ 3 files changed, 7 insertions(+), 56 deletions(-) diff --git a/includes/DefaultSettings.php b/includes/DefaultSettings.php index a8ba248273..3726dd7d13 100644 --- a/includes/DefaultSettings.php +++ b/includes/DefaultSettings.php @@ -1267,22 +1267,6 @@ $wgThumbLimits = array( 300 ); -/** Navigation links for the user sidebar. - * 'text' is the name of the MediaWiki message that contains the label of this link - * 'href' is the name of the MediaWiki message that contains the link target of this link. - * Link targets starting with http are considered remote links. Ones not starting with - * http are considered as names of local wiki pages. - */ -$wgNavigationLinks = array ( - array( 'text'=>'mainpage', 'href'=>'mainpage' ), - array( 'text'=>'portal', 'href'=>'portal-url' ), - array( 'text'=>'currentevents', 'href'=>'currentevents-url' ), - array( 'text'=>'recentchanges', 'href'=>'recentchanges-url' ), - array( 'text'=>'randompage', 'href'=>'randompage-url' ), - array( 'text'=>'help', 'href'=>'helppage' ), - array( 'text'=>'sitesupport', 'href'=>'sitesupport-url' ), -); - /** * On category pages, show thumbnail gallery for images belonging to that * category instead of listing them as articles. diff --git a/includes/SkinTemplate.php b/includes/SkinTemplate.php index 4a7363c4b3..8d00e92f5a 100644 --- a/includes/SkinTemplate.php +++ b/includes/SkinTemplate.php @@ -383,7 +383,7 @@ class SkinTemplate extends Skin { } else { $tpl->set( 'body_onload', false ); } - $tpl->set( 'navigation_urls', $this->buildNavigationUrls() ); + $tpl->set( 'navigation_urls', $this->getNavigationLinks() ); $tpl->set( 'nav_urls', $this->buildNavUrls() ); // execute template @@ -703,39 +703,11 @@ class SkinTemplate extends Skin { } function getNavigationLinks() { - global $wgNavigationLinks; - return $wgNavigationLinks; - } - - /** - * build array of global navigation links - * @return array - * @access private - */ - function buildNavigationUrls () { - $fname = 'SkinTemplate::buildNavigationUrls'; - wfProfileIn( $fname ); - - $links = $this->getNavigationLinks(); - - $result = array(); - foreach ( $links as $link ) { - $text = wfMsg( $link['text'] ); - wfProfileIn( "$fname-{$link['text']}" ); - if ($text != '-') { - $dest = wfMsgForContent( $link['href'] ); - wfProfileIn( "$fname-{$link['text']}2" ); - $result[] = array( - 'text' => $text, - 'href' => $this->makeInternalOrExternalUrl( $dest ), - 'id' => 'n-'.$link['text'] - ); - wfProfileOut( "$fname-{$link['text']}2" ); - } - wfProfileOut( "$fname-{$link['text']}" ); - } - wfProfileOut( $fname ); - return $result; + global $wgParser, $wgTitle; + $text = wfMsgForContent( 'navbar' ); + $options = ParserOptions::newFromUser( $temp = NULL ); + $parserOutput = $wgParser->parse( $text, $wgTitle, $options, true ); + return $parserOutput->getText(); } /** diff --git a/skins/MonoBook.php b/skins/MonoBook.php index a43852dd32..b021999351 100644 --- a/skins/MonoBook.php +++ b/skins/MonoBook.php @@ -126,12 +126,7 @@ class MonoBookTemplate extends QuickTemplate {
msg('navigation') ?>
-
    - data['navigation_urls'] as $navlink) { ?> -
  • -
+ data['navigation_urls']; ?>