r1583 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r1582‎ | r1583 | r1584 >
Date:12:08, 20 August 2003
Author:matjordan
Status:old
Tags:
Comment:
Added this nifty "Back to <last article>" feature when you login or logout
that's known from SkinStandard.php.
Modified paths:
  • /trunk/phase3/includes/SkinCologneBlue.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/SkinCologneBlue.php
@@ -97,7 +97,20 @@
9898 }
9999 function sysLinks()
100100 {
101 - global $wgUser;
 101+ global $wgUser, $wgLang, $wgTitle;
 102+ $li = $wgLang->specialPage("Userlogin");
 103+ $lo = $wgLang->specialPage("Userlogout");
 104+
 105+ $rt = $wgTitle->getPrefixedURL();
 106+ if ( 0 == strcasecmp( urlencode( $lo ), $rt ) ) {
 107+ $q = "";
 108+ } else {
 109+ $q = "returnto={$rt}";
 110+ }
 111+
 112+ $s .= "\n<br>" . $this->makeKnownLink( $li,
 113+ wfMsg( "login" ), $q );
 114+
102115 $s = "" .
103116 $this->makeKnownLink( wfMsg( "mainpage" ), wfMsg( "mainpage" ) )
104117 . " | " .
@@ -107,8 +120,17 @@
108121 . " | " .
109122 $this->makeKnownLink( wfMsg( "faqpage" ), wfMsg("faq") )
110123 . " | " .
111 - $this->specialLink( "specialpages" ) . " | " .
112 - $this->specialLink( $wgUser->getID() ? "userlogout" : "userlogin" ) ;
 124+ $this->specialLink( "specialpages" ) . " | ";
 125+
 126+ if ( $wgUser->getID() )
 127+ {
 128+ $s .= $this->makeKnownLink( $lo, wfMsg( "logout" ), $q );
 129+ }
 130+ else
 131+ {
 132+ $s .= $this->makeKnownLink( $li, wfMsg( "login" ), $q );
 133+ }
 134+
113135 return $s;
114136 }
115137

Status & tagging log