Bold tabs and user bar to go with navigation bar
authorTom Gilder <tomgilder@users.mediawiki.org>
Wed, 12 Oct 2005 01:13:46 +0000 (01:13 +0000)
committerTom Gilder <tomgilder@users.mediawiki.org>
Wed, 12 Oct 2005 01:13:46 +0000 (01:13 +0000)
includes/SkinTemplate.php
skins/MonoBook.php
skins/monobook/main.css

index 0902e44..cf8f1b0 100644 (file)
@@ -430,35 +430,45 @@ class SkinTemplate extends Skin {
         * @access private
         */
        function buildPersonalUrls() {
+               global $wgTitle, $wgShowIPinHeader;
+
                $fname = 'SkinTemplate::buildPersonalUrls';
+               $pageurl = $wgTitle->getLocalURL();
                wfProfileIn( $fname );
 
                /* set up the default links for the personal toolbar */
-               global $wgShowIPinHeader;
                $personal_urls = array();
                if ($this->loggedin) {
                        $personal_urls['userpage'] = array(
                                'text' => $this->username,
                                'href' => &$this->userpageUrlDetails['href'],
-                               'class' => $this->userpageUrlDetails['exists']?false:'new'
+                               'class' => $this->userpageUrlDetails['exists']?false:'new',
+                               'active' => ( $this->userpageUrlDetails['href'] == $pageurl )
                        );
                        $usertalkUrlDetails = $this->makeTalkUrlDetails($this->userpage);
                        $personal_urls['mytalk'] = array(
                                'text' => wfMsg('mytalk'),
                                'href' => &$usertalkUrlDetails['href'],
-                               'class' => $usertalkUrlDetails['exists']?false:'new'
+                               'class' => $usertalkUrlDetails['exists']?false:'new',
+                               'active' => ( $usertalkUrlDetails['href'] == $pageurl )
                        );
+                       $href = $this->makeSpecialUrl('Preferences');
                        $personal_urls['preferences'] = array(
                                'text' => wfMsg('preferences'),
-                               'href' => $this->makeSpecialUrl('Preferences')
+                               'href' => $this->makeSpecialUrl('Preferences'),
+                               'active' => ( $href == $pageurl )
                        );
+                       $href = $this->makeSpecialUrl('Watchlist');
                        $personal_urls['watchlist'] = array(
                                'text' => wfMsg('watchlist'),
-                               'href' => $this->makeSpecialUrl('Watchlist')
+                               'href' => $href,
+                               'active' => ( $href == $pageurl )
                        );
+                       $href = $this->makeSpecialUrl("Contributions/$this->username");
                        $personal_urls['mycontris'] = array(
                                'text' => wfMsg('mycontris'),
-                               'href' => $this->makeSpecialUrl("Contributions/$this->username")
+                               'href' => $href,
+                               'active' => ( $href == $pageurl . '/' . $this->username )
                        );
                        $personal_urls['logout'] = array(
                                'text' => wfMsg('userlogout'),
@@ -466,26 +476,32 @@ class SkinTemplate extends Skin {
                        );
                } else {
                        if( $wgShowIPinHeader && isset(  $_COOKIE[ini_get("session.name")] ) ) {
+                               $href = &$this->userpageUrlDetails['href'];
                                $personal_urls['anonuserpage'] = array(
                                        'text' => $this->username,
-                                       'href' => &$this->userpageUrlDetails['href'],
-                                       'class' => $this->userpageUrlDetails['exists']?false:'new'
+                                       'href' => $href,
+                                       'class' => $this->userpageUrlDetails['exists']?false:'new',
+                                       'active' => ( $pageurl == $href )
                                );
                                $usertalkUrlDetails = $this->makeTalkUrlDetails($this->userpage);
+                               $href = &$usertalkUrlDetails['href'];
                                $personal_urls['anontalk'] = array(
                                        'text' => wfMsg('anontalk'),
-                                       'href' => &$usertalkUrlDetails['href'],
-                                       'class' => $usertalkUrlDetails['exists']?false:'new'
+                                       'href' => $href,
+                                       'class' => $usertalkUrlDetails['exists']?false:'new',
+                                       'active' => ( $pageurl == $href )
                                );
                                $personal_urls['anonlogin'] = array(
                                        'text' => wfMsg('userlogin'),
-                                       'href' => $this->makeSpecialUrl('Userlogin', 'returnto=' . $this->thisurl )
+                                       'href' => $this->makeSpecialUrl('Userlogin', 'returnto=' . $this->thisurl ),
+                                       'active' => ( NS_SPECIAL == $wgTitle->getNamespace() && 'Userlogin' == $wgTitle->getDBkey() )
                                );
                        } else {
 
                                $personal_urls['login'] = array(
                                        'text' => wfMsg('userlogin'),
-                                       'href' => $this->makeSpecialUrl('Userlogin', 'returnto=' . $this->thisurl )
+                                       'href' => $this->makeSpecialUrl('Userlogin', 'returnto=' . $this->thisurl ),
+                                       'active' => ( NS_SPECIAL == $wgTitle->getNamespace() && 'Userlogin' == $wgTitle->getDBkey() )
                                );
                        }
                }
index def7b66..d410aa4 100644 (file)
@@ -110,11 +110,11 @@ class MonoBookTemplate extends QuickTemplate {
          <div class="pBody">
            <ul>
            <?php foreach($this->data['personal_urls'] as $key => $item) {
-              ?><li id="pt-<?php echo htmlspecialchars($key) ?>"><a href="<?php
+              ?><li id="pt-<?php echo htmlspecialchars($key) ?>"><?php if ($item['active']) echo '<strong>' ?><a href="<?php
               echo htmlspecialchars($item['href']) ?>"<?php
               if(!empty($item['class'])) { ?> class="<?php
               echo htmlspecialchars($item['class']) ?>"<?php } ?>><?php
-              echo htmlspecialchars($item['text']) ?></a></li><?php
+              echo htmlspecialchars($item['text']) ?></a><?php if ($item['active']) echo '</strong>' ?></li><?php
            } ?>
            </ul>
          </div>
index ba76616..149b3e2 100644 (file)
@@ -691,7 +691,6 @@ special external link styling */
 }
 
 #p-navigation li.active a, #p-navigation li.active a:hover {
-    color: #000;
     text-decoration: none;
     display: inline;
 }
@@ -837,6 +836,7 @@ li#pt-login {
 #p-cactions li.selected {
     border-color: #fabd23;
     padding: 0 0 .2em 0;
+    font-weight: bold;
 }
 #p-cactions li a {
     background-color: white;