unbroke classic and cologne blue skins
authorTim Starling <tstarling@users.mediawiki.org>
Tue, 28 Jun 2005 14:18:08 +0000 (14:18 +0000)
committerTim Starling <tstarling@users.mediawiki.org>
Tue, 28 Jun 2005 14:18:08 +0000 (14:18 +0000)
includes/Skin.php
includes/SkinTemplate.php
skins/CologneBlue.php
skins/Standard.php

index bdd40ca..5c266af 100644 (file)
@@ -1286,6 +1286,43 @@ END;
                }
        }
 
+       /**
+        * Build an array that represents the sidebar(s), the navigation bar among them
+        *
+        * @return array
+        * @access private
+        */ 
+       function buildSidebar() {
+               $fname = 'SkinTemplate::buildSidebar';
+               wfProfileIn( $fname );
+               
+               $bar = array();
+               $lines = explode( "\n", wfMsgForContent( 'sidebar' ) );
+               foreach ($lines as $line) {
+                       if (strpos($line, '*') !== 0)
+                               continue;
+                       if (strpos($line, '**') !== 0) {
+                               $line = trim($line, '* ');
+                               $heading = $line;
+                       } else {
+                               if (strpos($line, '|') !== false) { // sanity check
+                                       $line = explode( '|' , trim($line, '* '), 2 );
+                                       $link = wfMsgForContent( $line[0] );
+                                       if( $link == '-' ) {
+                                               continue;
+                                       }
+                                       $bar[$heading][] = array(
+                                               'text' => wfMsg( $line[1] ),
+                                               'href' => $this->makeInternalOrExternalUrl( $link ),
+                                               'id' => 'n-' . $line[1],
+                                       );
+                               } else { continue; }
+                       }
+               }
+               
+               wfProfileOut( $fname );
+               return $bar;
+       }
 }
 
 }
index e41b2b6..9ee175e 100644 (file)
@@ -719,43 +719,7 @@ class SkinTemplate extends Skin {
                return $content_actions;
        }
        
-       /**
-        * Build an array that represents the sidebar(s), the navigation bar among them
-        *
-        * @return array
-        * @access private
-        */ 
-       function buildSidebar() {
-               $fname = 'SkinTemplate::buildSidebar';
-               wfProfileIn( $fname );
-               
-               $bar = array();
-               $lines = explode( "\n", wfMsgForContent( 'sidebar' ) );
-               foreach ($lines as $line) {
-                       if (strpos($line, '*') !== 0)
-                               continue;
-                       if (strpos($line, '**') !== 0) {
-                               $line = trim($line, '* ');
-                               $heading = $line;
-                       } else {
-                               if (strpos($line, '|') !== false) { // sanity check
-                                       $line = explode( '|' , trim($line, '* '), 2 );
-                                       $link = wfMsgForContent( $line[0] );
-                                       if( $link == '-' ) {
-                                               continue;
-                                       }
-                                       $bar[$heading][] = array(
-                                               'text' => wfMsg( $line[1] ),
-                                               'href' => $this->makeInternalOrExternalUrl( $link ),
-                                               'id' => 'n-' . $line[1],
-                                       );
-                               } else { continue; }
-                       }
-               }
-               
-               wfProfileOut( $fname );
-               return $bar;
-       }
+
 
        /**
         * build array of common navigation links
index d1ef094..6cc1d3d 100644 (file)
@@ -183,6 +183,17 @@ class SkinCologneBlue extends Skin {
 
                $s .= $this->menuHead( "qbbrowse" );
 
+               # Use the first heading from the Monobook sidebar as the "browse" section
+               $bar = $this->buildSidebar();
+               $browseLinks = reset( $bar );
+
+               foreach ( $browseLinks as $link ) {
+                       if ( $link['text'] != '-' ) {
+                               $s .= "<a href=\"{$link['href']}\">" .
+                                       htmlspecialchars( $link['text'] ) . '</a>' . $sep;
+                       }
+               }
+               
                if ( $wgOut->isArticle() ) {
                        $s .= $this->menuHead( "qbedit" );
                        $s .= "<strong>" . $this->editThisPage() . "</strong>";
index 6ef32d9..257f65d 100644 (file)
@@ -145,6 +145,17 @@ class SkinStandard extends Skin {
                $s .= "\n" . $this->logoText() . "\n<hr class='sep' />";
 
                $sep = "\n<br />";
+               
+               # Use the first heading from the Monobook sidebar as the "browse" section
+               $bar = $this->buildSidebar();
+               $browseLinks = reset( $bar );
+
+               foreach ( $browseLinks as $link ) {
+                       if ( $link['text'] != '-' ) {
+                               $s .= "<a href=\"{$link['href']}\">" .
+                                       htmlspecialchars( $link['text'] ) . '</a>' . $sep;
+                       }
+               }
 
                if( $wgUser->isLoggedIn() ) {
                        $s.= $this->specialLink( 'watchlist' ) ;