r11306 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r11305‎ | r11306 | r11307 >
Date:01:13, 12 October 2005
Author:tomgilder
Status:old
Tags:
Comment:
Bold tabs and user bar to go with navigation bar
Modified paths:
  • /trunk/phase3/includes/SkinTemplate.php (modified) (history)
  • /trunk/phase3/skins/MonoBook.php (modified) (history)
  • /trunk/phase3/skins/monobook/main.css (modified) (history)

Diff [purge]

Index: trunk/phase3/skins/monobook/main.css
@@ -691,7 +691,6 @@
692692 }
693693
694694 #p-navigation li.active a, #p-navigation li.active a:hover {
695 - color: #000;
696695 text-decoration: none;
697696 display: inline;
698697 }
@@ -837,6 +836,7 @@
838837 #p-cactions li.selected {
839838 border-color: #fabd23;
840839 padding: 0 0 .2em 0;
 840+ font-weight: bold;
841841 }
842842 #p-cactions li a {
843843 background-color: white;
Index: trunk/phase3/skins/MonoBook.php
@@ -110,11 +110,11 @@
111111 <div class="pBody">
112112 <ul>
113113 <?php foreach($this->data['personal_urls'] as $key => $item) {
114 - ?><li id="pt-<?php echo htmlspecialchars($key) ?>"><a href="<?php
 114+ ?><li id="pt-<?php echo htmlspecialchars($key) ?>"><?php if ($item['active']) echo '<strong>' ?><a href="<?php
115115 echo htmlspecialchars($item['href']) ?>"<?php
116116 if(!empty($item['class'])) { ?> class="<?php
117117 echo htmlspecialchars($item['class']) ?>"<?php } ?>><?php
118 - echo htmlspecialchars($item['text']) ?></a></li><?php
 118+ echo htmlspecialchars($item['text']) ?></a><?php if ($item['active']) echo '</strong>' ?></li><?php
119119 } ?>
120120 </ul>
121121 </div>
Index: trunk/phase3/includes/SkinTemplate.php
@@ -430,35 +430,45 @@
431431 * @access private
432432 */
433433 function buildPersonalUrls() {
 434+ global $wgTitle, $wgShowIPinHeader;
 435+
434436 $fname = 'SkinTemplate::buildPersonalUrls';
 437+ $pageurl = $wgTitle->getLocalURL();
435438 wfProfileIn( $fname );
436439
437440 /* set up the default links for the personal toolbar */
438 - global $wgShowIPinHeader;
439441 $personal_urls = array();
440442 if ($this->loggedin) {
441443 $personal_urls['userpage'] = array(
442444 'text' => $this->username,
443445 'href' => &$this->userpageUrlDetails['href'],
444 - 'class' => $this->userpageUrlDetails['exists']?false:'new'
 446+ 'class' => $this->userpageUrlDetails['exists']?false:'new',
 447+ 'active' => ( $this->userpageUrlDetails['href'] == $pageurl )
445448 );
446449 $usertalkUrlDetails = $this->makeTalkUrlDetails($this->userpage);
447450 $personal_urls['mytalk'] = array(
448451 'text' => wfMsg('mytalk'),
449452 'href' => &$usertalkUrlDetails['href'],
450 - 'class' => $usertalkUrlDetails['exists']?false:'new'
 453+ 'class' => $usertalkUrlDetails['exists']?false:'new',
 454+ 'active' => ( $usertalkUrlDetails['href'] == $pageurl )
451455 );
 456+ $href = $this->makeSpecialUrl('Preferences');
452457 $personal_urls['preferences'] = array(
453458 'text' => wfMsg('preferences'),
454 - 'href' => $this->makeSpecialUrl('Preferences')
 459+ 'href' => $this->makeSpecialUrl('Preferences'),
 460+ 'active' => ( $href == $pageurl )
455461 );
 462+ $href = $this->makeSpecialUrl('Watchlist');
456463 $personal_urls['watchlist'] = array(
457464 'text' => wfMsg('watchlist'),
458 - 'href' => $this->makeSpecialUrl('Watchlist')
 465+ 'href' => $href,
 466+ 'active' => ( $href == $pageurl )
459467 );
 468+ $href = $this->makeSpecialUrl("Contributions/$this->username");
460469 $personal_urls['mycontris'] = array(
461470 'text' => wfMsg('mycontris'),
462 - 'href' => $this->makeSpecialUrl("Contributions/$this->username")
 471+ 'href' => $href,
 472+ 'active' => ( $href == $pageurl . '/' . $this->username )
463473 );
464474 $personal_urls['logout'] = array(
465475 'text' => wfMsg('userlogout'),
@@ -466,26 +476,32 @@
467477 );
468478 } else {
469479 if( $wgShowIPinHeader && isset( $_COOKIE[ini_get("session.name")] ) ) {
 480+ $href = &$this->userpageUrlDetails['href'];
470481 $personal_urls['anonuserpage'] = array(
471482 'text' => $this->username,
472 - 'href' => &$this->userpageUrlDetails['href'],
473 - 'class' => $this->userpageUrlDetails['exists']?false:'new'
 483+ 'href' => $href,
 484+ 'class' => $this->userpageUrlDetails['exists']?false:'new',
 485+ 'active' => ( $pageurl == $href )
474486 );
475487 $usertalkUrlDetails = $this->makeTalkUrlDetails($this->userpage);
 488+ $href = &$usertalkUrlDetails['href'];
476489 $personal_urls['anontalk'] = array(
477490 'text' => wfMsg('anontalk'),
478 - 'href' => &$usertalkUrlDetails['href'],
479 - 'class' => $usertalkUrlDetails['exists']?false:'new'
 491+ 'href' => $href,
 492+ 'class' => $usertalkUrlDetails['exists']?false:'new',
 493+ 'active' => ( $pageurl == $href )
480494 );
481495 $personal_urls['anonlogin'] = array(
482496 'text' => wfMsg('userlogin'),
483 - 'href' => $this->makeSpecialUrl('Userlogin', 'returnto=' . $this->thisurl )
 497+ 'href' => $this->makeSpecialUrl('Userlogin', 'returnto=' . $this->thisurl ),
 498+ 'active' => ( NS_SPECIAL == $wgTitle->getNamespace() && 'Userlogin' == $wgTitle->getDBkey() )
484499 );
485500 } else {
486501
487502 $personal_urls['login'] = array(
488503 'text' => wfMsg('userlogin'),
489 - 'href' => $this->makeSpecialUrl('Userlogin', 'returnto=' . $this->thisurl )
 504+ 'href' => $this->makeSpecialUrl('Userlogin', 'returnto=' . $this->thisurl ),
 505+ 'active' => ( NS_SPECIAL == $wgTitle->getNamespace() && 'Userlogin' == $wgTitle->getDBkey() )
490506 );
491507 }
492508 }

Status & tagging log