* Removed '@todo document', it has been documented.
[lhc/web/wiklou.git] / skins / CologneBlue.php
index a40dd8f..1481cb8 100644 (file)
@@ -25,7 +25,7 @@ class SkinCologneBlue extends Skin {
        }
 
        function doBeforeContent() {
-               global $wgUser, $wgOut, $wgTitle, $wgSiteNotice;
+               global $wgOut, $wgTitle;
 
                $s = "";
                $qb = $this->qbSetting();
@@ -57,8 +57,9 @@ class SkinCologneBlue extends Skin {
 
                $s .= "\n</div>\n<div id='article'>";
 
-               if( $wgSiteNotice ) {
-                       $s .= "\n<div id='siteNotice'>$wgSiteNotice</div>\n";
+               $notice = wfGetSiteNotice();
+               if( $notice ) {
+                       $s .= "\n<div id='siteNotice'>$notice</div>\n";
                }
                $s .= $this->pageTitle();
                $s .= $this->pageSubtitle() . "\n";
@@ -67,7 +68,7 @@ class SkinCologneBlue extends Skin {
 
        function doAfterContent()
        {
-               global $wgUser, $wgOut;
+               global $wgOut;
 
                $s = "\n</div><br clear='all' />\n";
 
@@ -96,9 +97,9 @@ class SkinCologneBlue extends Skin {
                if ( 0 != $qb ) { $s .= $this->quickBar(); }
                return $s;
        }
-       function doGetUserStyles()
-       {
-               global $wgUser, $wgOut, $wgStyleSheetPath;
+       
+       function doGetUserStyles() {
+               global $wgOut, $wgStyleSheetPath;
                $s = parent::doGetUserStyles();
                $qb = $this->qbSetting();
 
@@ -116,8 +117,8 @@ class SkinCologneBlue extends Skin {
                }
                return $s;
        }
-       function sysLinks()
-       {
+       
+       function sysLinks() {
                global $wgUser, $wgContLang, $wgTitle;
                $li = $wgContLang->specialPage("Userlogin");
                $lo = $wgContLang->specialPage("Userlogout");
@@ -140,12 +141,9 @@ class SkinCologneBlue extends Skin {
                  . " | " .
                  $this->specialLink( "specialpages" ) . " | ";
 
-               if ( $wgUser->getID() )
-               {
+               if ( $wgUser->isLoggedIn() ) {
                        $s .=  $this->makeKnownLink( $lo, wfMsg( "logout" ), $q );
-               }
-               else
-               {
+               } else {
                        $s .=  $this->makeKnownLink( $li, wfMsg( "login" ), $q );
                }
 
@@ -173,7 +171,7 @@ class SkinCologneBlue extends Skin {
         */
        function quickBar()
        {
-               global $wgOut, $wgTitle, $wgUser, $wgLang, $wgContLang, $wgDisableUploads, $wgNavigationLinks;
+               global $wgOut, $wgTitle, $wgUser, $wgLang, $wgContLang, $wgEnableUploads, $wgNavigationLinks;
 
                $tns=$wgTitle->getNamespace();
 
@@ -200,7 +198,7 @@ class SkinCologneBlue extends Skin {
 
                        $s .= $sep . $this->makeKnownLink( wfMsgForContent( "edithelppage" ), wfMsg( "edithelp" ) );
 
-                       if ( 0 != $wgUser->getID() ) {
+                       if( $wgUser->isLoggedIn() ) {
                                $s .= $sep . $this->moveThisPage();
                        }
                        if ( $wgUser->isAllowed('delete') ) {
@@ -221,7 +219,7 @@ class SkinCologneBlue extends Skin {
                        $s .= $this->talkLink()
                          . $sep . $this->commentLink() 
                          . $sep . $this->printableLink();
-                       if ( 0 != $wgUser->getID() ) {
+                       if ( $wgUser->isLoggedIn() ) {
                                $s .= $sep . $this->watchThisPage();
                        }
 
@@ -232,7 +230,7 @@ class SkinCologneBlue extends Skin {
                          . $sep . $this->whatLinksHere()
                          . $sep . $this->watchPageLinksLink();
                          
-                       if ( Namespace::getUser() == $tns || Namespace::getTalk(Namespace::getUser()) == $tns ) {
+                       if( $tns == NS_USER || $tns == NS_USER_TALK ) {
                                $id=User::idFromName($wgTitle->getText());
                                if ($id != 0) {
                                        $s .= $sep . $this->userContribsLink();
@@ -245,18 +243,19 @@ class SkinCologneBlue extends Skin {
                }
 
                $s .= $this->menuHead( "qbmyoptions" );
-               if ( 0 != $wgUser->getID() ) {
+               if ( $wgUser->isLoggedIn() ) {
                        $name = $wgUser->getName();
-                       $tl = $this->makeKnownLink( $wgContLang->getNsText(
-                         Namespace::getTalk( Namespace::getUser() ) ) . ":{$name}",
-                         wfMsg( "mytalk" ) );
-                       if ( 0 != $wgUser->getNewtalk() ) { $tl .= " *"; }
+                       $tl = $this->makeKnownLinkObj( $wgUser->getTalkPage(),
+                               wfMsg( 'mytalk' ) );
+                       if ( $wgUser->getNewtalk() ) {
+                               $tl .= " *";
+                       }
 
-                       $s .= $this->makeKnownLink( $wgContLang->getNsText(
-                         Namespace::getUser() ) . ":{$name}", wfMsg( "mypage" ) )
+                       $s .= $this->makeKnownLinkObj( $wgUser->getUserPage(),
+                               wfMsg( "mypage" ) )
                          . $sep . $tl
                          . $sep . $this->specialLink( "watchlist" )
-                         . $sep . $this->makeKnownLink( $wgContLang->specialPage( "Contributions" ),
+                         . $sep . $this->makeKnownLinkObj( Title::makeTitle( NS_SPECIAL, "Contributions" ),
                                wfMsg( "mycontris" ), "target=" . wfUrlencode($wgUser->getName() ) )            
                          . $sep . $this->specialLink( "preferences" )
                          . $sep . $this->specialLink( "userlogout" );
@@ -269,7 +268,7 @@ class SkinCologneBlue extends Skin {
                  . $sep . $this->specialLink( "imagelist" ) 
                  . $sep . $this->specialLink( "statistics" ) 
                  . $sep . $this->bugReportsLink();
-               if ( 0 != $wgUser->getID() && !$wgDisableUploads ) {
+               if ( $wgUser->isLoggedIn() && $wgEnableUploads ) {
                        $s .= $sep . $this->specialLink( "upload" );
                }
                global $wgSiteSupportPage;
@@ -278,7 +277,9 @@ class SkinCologneBlue extends Skin {
                              .wfMsg( "sitesupport" )."</a>";
                }
                
-               $s .= $sep . $this->makeKnownLink( $wgContLang->specialPage( "Specialpages" ), wfMsg("moredotdotdot") );
+               $s .= $sep . $this->makeKnownLinkObj(
+                       Title::makeTitle( NS_SPECIAL, 'Specialpages' ),
+                       wfMsg( 'moredotdotdot' ) );
 
                $s .= $sep . "\n</div>\n";
                return $s;