Merge "(bug 43315) Cursor of enhancedchangelist wrong for non-toggle lines"
[lhc/web/wiklou.git] / skins / Nostalgia.php
index 597cd23..3028915 100644 (file)
@@ -2,6 +2,21 @@
 /**
  * Nostalgia: A skin which looks like Wikipedia did in its first year (2001).
  *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ * http://www.gnu.org/copyleft/gpl.html
+ *
  * @file
  * @ingroup Skins
  */
@@ -18,7 +33,10 @@ class SkinNostalgia extends SkinLegacy {
        var $skinname = 'nostalgia', $stylename = 'nostalgia',
                $template = 'NostalgiaTemplate';
 
-       function setupSkinUserCss( OutputPage $out ){
+       /**
+        * @param $out OutputPage
+        */
+       function setupSkinUserCss( OutputPage $out ) {
                parent::setupSkinUserCss( $out );
                $out->addModuleStyles( 'skins.nostalgia' );
        }
@@ -27,6 +45,9 @@ class SkinNostalgia extends SkinLegacy {
 
 class NostalgiaTemplate extends LegacyTemplate {
 
+       /**
+        * @return string
+        */
        function doBeforeContent() {
                $s = "\n<div id='content'>\n<div id='top'>\n";
                $s .= '<div id="logo">' . $this->getSkin()->logoText( 'right' ) . '</div>';
@@ -48,10 +69,7 @@ class NostalgiaTemplate extends LegacyTemplate {
                        $s .= '<br />' . $ol;
                }
 
-               $cat = $this->getSkin()->getCategoryLinks();
-               if( $cat ) {
-                       $s .= '<br />' . $cat;
-               }
+               $s .= $this->getSkin()->getCategories();
 
                $s .= "<br clear='all' /></div><hr />\n</div>\n";
                $s .= "\n<div id='article'>";
@@ -59,14 +77,16 @@ class NostalgiaTemplate extends LegacyTemplate {
                return $s;
        }
 
+       /**
+        * @return string
+        */
        function topLinks() {
-               global $wgOut, $wgUser;
                $sep = " |\n";
 
                $s = $this->getSkin()->mainPageLink() . $sep
                  . Linker::specialLink( 'Recentchanges' );
 
-               if ( $wgOut->isArticle() ) {
+               if ( $this->data['isarticle'] ) {
                        $s .= $sep . '<strong>' . $this->editThisPage() . '</strong>' . $sep . $this->talkLink() .
                                        $sep . $this->historyLink();
                }
@@ -74,30 +94,31 @@ class NostalgiaTemplate extends LegacyTemplate {
                /* show links to different language variants */
                $s .= $this->variantLinks();
                $s .= $this->extensionTabLinks();
-               if ( $wgUser->isAnon() ) {
+               if ( !$this->data['loggedin'] ) {
                        $s .= $sep . Linker::specialLink( 'Userlogin' );
                } else {
                        /* show user page and user talk links */
-                       $s .= $sep . Linker::link( $wgUser->getUserPage(), wfMsgHtml( 'mypage' ) );
-                       $s .= $sep . Linker::link( $wgUser->getTalkPage(), wfMsgHtml( 'mytalk' ) );
-                       if ( $wgUser->getNewtalk() ) {
+                       $user = $this->getSkin()->getUser();
+                       $s .= $sep . Linker::link( $user->getUserPage(), wfMessage( 'mypage' )->escaped() );
+                       $s .= $sep . Linker::link( $user->getTalkPage(), wfMessage( 'mytalk' )->escaped() );
+                       if ( $user->getNewtalk() ) {
                                $s .= ' *';
                        }
                        /* show watchlist link */
                        $s .= $sep . Linker::specialLink( 'Watchlist' );
                        /* show my contributions link */
                        $s .= $sep . Linker::link(
-                               SpecialPage::getSafeTitleFor( 'Contributions', $wgUser->getName() ),
-                               wfMsgHtml( 'mycontris' ) );
+                               SpecialPage::getSafeTitleFor( 'Contributions', $this->data['username'] ),
+                               wfMessage( 'mycontris' )->escaped() );
                        /* show my preferences link */
                        $s .= $sep . Linker::specialLink( 'Preferences' );
                        /* show upload file link */
-                       if( UploadBase::isEnabled() && UploadBase::isAllowed( $wgUser ) === true ) {
+                       if( UploadBase::isEnabled() && UploadBase::isAllowed( $user ) === true ) {
                                $s .= $sep . $this->getUploadLink();
                        }
 
                        /* show log out link */
-                       $s .= $sep . $this->getSkin()->specialLink( 'Userlogout' );
+                       $s .= $sep . Linker::specialLink( 'Userlogout' );
                }
 
                $s .= $sep . $this->specialPagesList();
@@ -105,6 +126,9 @@ class NostalgiaTemplate extends LegacyTemplate {
                return $s;
        }
 
+       /**
+        * @return string
+        */
        function doAfterContent() {
                $s = "\n</div><br clear='all' />\n";