X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=skins%2FNostalgia.php;h=98437e2e4f8141272fe860d6e8eef589fbe39b93;hb=eeb7300f6004e95620514eb9bac508425e94f197;hp=5bada29b49bcc3e439a37a063bba0c6d613765a7;hpb=380b6725d5b0c127bd8d62af8904f6787905aca8;p=lhc%2Fweb%2Fwiklou.git diff --git a/skins/Nostalgia.php b/skins/Nostalgia.php index 5bada29b49..98437e2e4f 100644 --- a/skins/Nostalgia.php +++ b/skins/Nostalgia.php @@ -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 */ @@ -14,19 +29,28 @@ if( !defined( 'MEDIAWIKI' ) ) { * @todo document * @ingroup Skins */ -class SkinNostalgia extends Skin { - - function getStylesheet() { - return 'common/nostalgia.css'; +class SkinNostalgia extends SkinLegacy { + var $skinname = 'nostalgia', $stylename = 'nostalgia', + $template = 'NostalgiaTemplate'; + + /** + * @param $out OutputPage + */ + function setupSkinUserCss( OutputPage $out ){ + parent::setupSkinUserCss( $out ); + $out->addModuleStyles( 'skins.nostalgia' ); } - function getSkinName() { - return 'nostalgia'; - } +} +class NostalgiaTemplate extends LegacyTemplate { + + /** + * @return string + */ function doBeforeContent() { $s = "\n
\n
\n"; - $s .= ''; + $s .= ''; $s .= $this->pageTitle(); $s .= $this->pageSubtitle() . "\n"; @@ -34,7 +58,7 @@ class SkinNostalgia extends Skin { $s .= '
'; $s .= $this->topLinks() . "\n
"; - $notice = wfGetSiteNotice(); + $notice = $this->getSkin()->getSiteNotice(); if( $notice ) { $s .= "\n
$notice
\n"; } @@ -45,10 +69,7 @@ class SkinNostalgia extends Skin { $s .= '
' . $ol; } - $cat = $this->getCategoryLinks(); - if( $cat ) { - $s .= '
' . $cat; - } + $s .= $this->getSkin()->getCategories(); $s .= "

\n
\n"; $s .= "\n
"; @@ -56,44 +77,48 @@ class SkinNostalgia extends Skin { return $s; } + /** + * @return string + */ function topLinks() { - global $wgOut, $wgUser; $sep = " |\n"; - $s = $this->mainPageLink() . $sep - . $this->specialLink( 'recentchanges' ); + $s = $this->getSkin()->mainPageLink() . $sep + . Linker::specialLink( 'Recentchanges' ); - if ( $wgOut->isArticle() ) { - $s .= $sep . '' . $this->editThisPage() . '' . $sep . $this->historyLink(); + if ( $this->data['isarticle'] ) { + $s .= $sep . '' . $this->editThisPage() . '' . $sep . $this->talkLink() . + $sep . $this->historyLink(); } /* show links to different language variants */ $s .= $this->variantLinks(); $s .= $this->extensionTabLinks(); - if ( $wgUser->isAnon() ) { - $s .= $sep . $this->specialLink( 'userlogin' ); + if ( !$this->data['loggedin'] ) { + $s .= $sep . Linker::specialLink( 'Userlogin' ); } else { /* show user page and user talk links */ - $s .= $sep . $this->link( $wgUser->getUserPage(), wfMsgHtml( 'mypage' ) ); - $s .= $sep . $this->link( $wgUser->getTalkPage(), wfMsgHtml( 'mytalk' ) ); - if ( $wgUser->getNewtalk() ) { + $user = $this->getSkin()->getUser(); + $s .= $sep . Linker::link( $user->getUserPage(), wfMsgHtml( 'mypage' ) ); + $s .= $sep . Linker::link( $user->getTalkPage(), wfMsgHtml( 'mytalk' ) ); + if ( $user->getNewtalk() ) { $s .= ' *'; } /* show watchlist link */ - $s .= $sep . $this->specialLink( 'watchlist' ); + $s .= $sep . Linker::specialLink( 'Watchlist' ); /* show my contributions link */ - $s .= $sep . $this->link( - SpecialPage::getSafeTitleFor( 'Contributions', $wgUser->getName() ), + $s .= $sep . Linker::link( + SpecialPage::getSafeTitleFor( 'Contributions', $this->data['username'] ), wfMsgHtml( 'mycontris' ) ); /* show my preferences link */ - $s .= $sep . $this->specialLink( 'preferences' ); + $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->specialLink( 'userlogout' ); + $s .= $sep . Linker::specialLink( 'Userlogout' ); } $s .= $sep . $this->specialPagesList(); @@ -101,6 +126,9 @@ class SkinNostalgia extends Skin { return $s; } + /** + * @return string + */ function doAfterContent() { $s = "\n

\n"; @@ -108,8 +136,8 @@ class SkinNostalgia extends Skin { $s .= $this->bottomLinks(); $s .= "\n
" . $this->pageStats(); - $s .= "\n
" . $this->mainPageLink() - . ' | ' . $this->aboutLink() + $s .= "\n
" . $this->getSkin()->mainPageLink() + . ' | ' . $this->getSkin()->aboutLink() . ' | ' . $this->searchForm(); $s .= "\n
\n\n";