* (bug 15905) Nostalgia skin could become more usable by including a Talk:link at...
[mediawiki.git] / skins / Nostalgia.php
blob2df7ddfe3b382b83ca954a2fba9bdcb41da64128
1 <?php
2 /**
3 * Nostalgia: A skin which looks like Wikipedia did in its first year (2001).
5 * @file
6 * @ingroup Skins
7 */
9 if( !defined( 'MEDIAWIKI' ) ) {
10 die( -1 );
13 /**
14 * @todo document
15 * @ingroup Skins
17 class SkinNostalgia extends SkinLegacy {
18 var $skinname = 'nostalgia', $stylename = 'nostalgia',
19 $template = 'NostalgiaTemplate';
21 function setupSkinUserCss( OutputPage $out ){
22 parent::setupSkinUserCss( $out );
23 $out->addModuleStyles( 'skins.nostalgia' );
28 class NostalgiaTemplate extends LegacyTemplate {
30 function doBeforeContent() {
31 $s = "\n<div id='content'>\n<div id='top'>\n";
32 $s .= '<div id="logo">' . $this->getSkin()->logoText( 'right' ) . '</div>';
34 $s .= $this->pageTitle();
35 $s .= $this->pageSubtitle() . "\n";
37 $s .= '<div id="topbar">';
38 $s .= $this->topLinks() . "\n<br />";
40 $notice = wfGetSiteNotice();
41 if( $notice ) {
42 $s .= "\n<div id='siteNotice'>$notice</div>\n";
44 $s .= $this->pageTitleLinks();
46 $ol = $this->otherLanguages();
47 if( $ol ) {
48 $s .= '<br />' . $ol;
51 $cat = $this->getSkin()->getCategoryLinks();
52 if( $cat ) {
53 $s .= '<br />' . $cat;
56 $s .= "<br clear='all' /></div><hr />\n</div>\n";
57 $s .= "\n<div id='article'>";
59 return $s;
62 function topLinks() {
63 global $wgOut, $wgUser;
64 $sep = " |\n";
66 $s = $this->getSkin()->mainPageLink() . $sep
67 . $this->getSkin()->specialLink( 'Recentchanges' );
69 if ( $wgOut->isArticle() ) {
70 $s .= $sep . '<strong>' . $this->editThisPage() . '</strong>' . $sep . $this->talkLink() .
71 $sep . $this->historyLink();
74 /* show links to different language variants */
75 $s .= $this->variantLinks();
76 $s .= $this->extensionTabLinks();
77 if ( $wgUser->isAnon() ) {
78 $s .= $sep . $this->getSkin()->specialLink( 'Userlogin' );
79 } else {
80 /* show user page and user talk links */
81 $s .= $sep . $this->getSkin()->link( $wgUser->getUserPage(), wfMsgHtml( 'mypage' ) );
82 $s .= $sep . $this->getSkin()->link( $wgUser->getTalkPage(), wfMsgHtml( 'mytalk' ) );
83 if ( $wgUser->getNewtalk() ) {
84 $s .= ' *';
86 /* show watchlist link */
87 $s .= $sep . $this->getSkin()->specialLink( 'Watchlist' );
88 /* show my contributions link */
89 $s .= $sep . $this->getSkin()->link(
90 SpecialPage::getSafeTitleFor( 'Contributions', $wgUser->getName() ),
91 wfMsgHtml( 'mycontris' ) );
92 /* show my preferences link */
93 $s .= $sep . $this->getSkin()->specialLink( 'Preferences' );
94 /* show upload file link */
95 if( UploadBase::isEnabled() && UploadBase::isAllowed( $wgUser ) === true ) {
96 $s .= $sep . $this->getUploadLink();
99 /* show log out link */
100 $s .= $sep . $this->getSkin()->specialLink( 'Userlogout' );
103 $s .= $sep . $this->specialPagesList();
105 return $s;
108 function doAfterContent() {
109 $s = "\n</div><br clear='all' />\n";
111 $s .= "\n<div id='footer'><hr />";
113 $s .= $this->bottomLinks();
114 $s .= "\n<br />" . $this->pageStats();
115 $s .= "\n<br />" . $this->getSkin()->mainPageLink()
116 . ' | ' . $this->getSkin()->aboutLink()
117 . ' | ' . $this->searchForm();
119 $s .= "\n</div>\n</div>\n";
121 return $s;