]> scripts.mit.edu Git - autoinstallsdev/mediawiki.git/blobdiff - skins/Nostalgia.php
MediaWiki 1.17.0
[autoinstallsdev/mediawiki.git] / skins / Nostalgia.php
index d4dee0f429f57decc8e038fd17675cbdd8573bf9..6c599b218cb72a9982542c973831b7359961b331 100644 (file)
@@ -1,14 +1,14 @@
 <?php
 /**
- * See docs/skin.txt
+ * Nostalgia: A skin which looks like Wikipedia did in its first year (2001).
  *
- * @todo document
  * @file
  * @ingroup Skins
  */
 
-if( !defined( 'MEDIAWIKI' ) )
+if( !defined( 'MEDIAWIKI' ) ) {
        die( -1 );
+}
 
 /**
  * @todo document
@@ -19,18 +19,19 @@ class SkinNostalgia extends Skin {
        function getStylesheet() {
                return 'common/nostalgia.css';
        }
+
        function getSkinName() {
-               return "nostalgia";
+               return 'nostalgia';
        }
 
        function doBeforeContent() {
                $s = "\n<div id='content'>\n<div id='top'>\n";
-               $s .= "<div id=\"logo\">".$this->logoText( "right" )."</div>";
+               $s .= '<div id="logo">' . $this->logoText( 'right' ) . '</div>';
 
                $s .= $this->pageTitle();
                $s .= $this->pageSubtitle() . "\n";
 
-               $s .= "<div id=\"topbar\">";
+               $s .= '<div id="topbar">';
                $s .= $this->topLinks() . "\n<br />";
 
                $notice = wfGetSiteNotice();
@@ -40,10 +41,14 @@ class SkinNostalgia extends Skin {
                $s .= $this->pageTitleLinks();
 
                $ol = $this->otherLanguages();
-               if($ol) $s .= "<br />" . $ol;
+               if( $ol ) {
+                       $s .= '<br />' . $ol;
+               }
 
                $cat = $this->getCategoryLinks();
-               if($cat) $s .= "<br />" . $cat;
+               if( $cat ) {
+                       $s .= '<br />' . $cat;
+               }
 
                $s .= "<br clear='all' /></div><hr />\n</div>\n";
                $s .= "\n<div id='article'>";
@@ -52,11 +57,11 @@ class SkinNostalgia extends Skin {
        }
 
        function topLinks() {
-               global $wgOut, $wgUser, $wgEnableUploads;
+               global $wgOut, $wgUser;
                $sep = " |\n";
 
                $s = $this->mainPageLink() . $sep
-                 . $this->specialLink( 'recentchanges' );
+                 . $this->specialLink( 'Recentchanges' );
 
                if ( $wgOut->isArticle() ) {
                        $s .= $sep . '<strong>' . $this->editThisPage() . '</strong>' . $sep . $this->historyLink();
@@ -66,9 +71,8 @@ class SkinNostalgia extends Skin {
                $s .= $this->variantLinks();
                $s .= $this->extensionTabLinks();
                if ( $wgUser->isAnon() ) {
-                       $s .= $sep . $this->specialLink( 'userlogin' );
+                       $s .= $sep . $this->specialLink( 'Userlogin' );
                } else {
-                       $name = $wgUser->getName();
                        /* show user page and user talk links */
                        $s .= $sep . $this->link( $wgUser->getUserPage(), wfMsgHtml( 'mypage' ) );
                        $s .= $sep . $this->link( $wgUser->getTalkPage(), wfMsgHtml( 'mytalk' ) );
@@ -76,19 +80,20 @@ class SkinNostalgia extends Skin {
                                $s .= ' *';
                        }
                        /* show watchlist link */
-                       $s .= $sep . $this->specialLink( 'watchlist' );
+                       $s .= $sep . $this->specialLink( 'Watchlist' );
                        /* show my contributions link */
                        $s .= $sep . $this->link(
-                               SpecialPage::getSafeTitleFor( "Contributions", $wgUser->getName() ),
+                               SpecialPage::getSafeTitleFor( 'Contributions', $wgUser->getName() ),
                                wfMsgHtml( 'mycontris' ) );
                        /* show my preferences link */
-                       $s .= $sep . $this->specialLink( 'preferences' );
+                       $s .= $sep . $this->specialLink( 'Preferences' );
                        /* show upload file link */
-                       if ( $wgEnableUploads ) {
-                               $s .= $sep . $this->specialLink( 'upload' );
+                       if( UploadBase::isEnabled() && UploadBase::isAllowed( $wgUser ) === true ) {
+                               $s .= $sep . $this->getUploadLink();
                        }
+
                        /* show log out link */
-                       $s .= $sep . $this->specialLink( 'userlogout' );
+                       $s .= $sep . $this->specialLink( 'Userlogout' );
                }
 
                $s .= $sep . $this->specialPagesList();
@@ -104,13 +109,11 @@ class SkinNostalgia extends Skin {
                $s .= $this->bottomLinks();
                $s .= "\n<br />" . $this->pageStats();
                $s .= "\n<br />" . $this->mainPageLink()
-                 . " | " . $this->aboutLink()
-                 . " | " . $this->searchForm();
+                               . ' | ' . $this->aboutLink()
+                               . ' | ' . $this->searchForm();
 
                $s .= "\n</div>\n</div>\n";
 
                return $s;
        }
 }
-
-