* Using a wfMsgForContent message to build the navigation urls now.
authorÆvar Arnfjörð Bjarmason <avar@users.mediawiki.org>
Mon, 23 May 2005 14:44:17 +0000 (14:44 +0000)
committerÆvar Arnfjörð Bjarmason <avar@users.mediawiki.org>
Mon, 23 May 2005 14:44:17 +0000 (14:44 +0000)
includes/DefaultSettings.php
includes/SkinTemplate.php
skins/MonoBook.php

index a8ba248..3726dd7 100644 (file)
@@ -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.
index 4a7363c..8d00e92 100644 (file)
@@ -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();
        }
 
        /**
index a43852d..b021999 100644 (file)
@@ -126,12 +126,7 @@ class MonoBookTemplate extends QuickTemplate {
        <div class="portlet" id="p-nav">
          <h5><?php $this->msg('navigation') ?></h5>
          <div class="pBody">
-           <ul>
-             <?php foreach($this->data['navigation_urls'] as $navlink) { ?>
-             <li id="<?php echo htmlspecialchars($navlink['id'])
-               ?>"><a href="<?php echo htmlspecialchars($navlink['href']) ?>"><?php 
-               echo htmlspecialchars($navlink['text']) ?></a></li><?php } ?>
-           </ul>
+           <?php echo $this->data['navigation_urls']; ?>
          </div>
        </div>
        <div id="p-search" class="portlet">