Merge "Combine JavaScript and JSON encoding logic"
[mediawiki.git] / skins / Nostalgia.php
blob3028915e3bb056e80ebd59899a37d6305a321ee7
1 <?php
2 /**
3 * Nostalgia: A skin which looks like Wikipedia did in its first year (2001).
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License along
16 * with this program; if not, write to the Free Software Foundation, Inc.,
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 * http://www.gnu.org/copyleft/gpl.html
20 * @file
21 * @ingroup Skins
24 if( !defined( 'MEDIAWIKI' ) ) {
25 die( -1 );
28 /**
29 * @todo document
30 * @ingroup Skins
32 class SkinNostalgia extends SkinLegacy {
33 var $skinname = 'nostalgia', $stylename = 'nostalgia',
34 $template = 'NostalgiaTemplate';
36 /**
37 * @param $out OutputPage
39 function setupSkinUserCss( OutputPage $out ) {
40 parent::setupSkinUserCss( $out );
41 $out->addModuleStyles( 'skins.nostalgia' );
46 class NostalgiaTemplate extends LegacyTemplate {
48 /**
49 * @return string
51 function doBeforeContent() {
52 $s = "\n<div id='content'>\n<div id='top'>\n";
53 $s .= '<div id="logo">' . $this->getSkin()->logoText( 'right' ) . '</div>';
55 $s .= $this->pageTitle();
56 $s .= $this->pageSubtitle() . "\n";
58 $s .= '<div id="topbar">';
59 $s .= $this->topLinks() . "\n<br />";
61 $notice = $this->getSkin()->getSiteNotice();
62 if( $notice ) {
63 $s .= "\n<div id='siteNotice'>$notice</div>\n";
65 $s .= $this->pageTitleLinks();
67 $ol = $this->otherLanguages();
68 if( $ol ) {
69 $s .= '<br />' . $ol;
72 $s .= $this->getSkin()->getCategories();
74 $s .= "<br clear='all' /></div><hr />\n</div>\n";
75 $s .= "\n<div id='article'>";
77 return $s;
80 /**
81 * @return string
83 function topLinks() {
84 $sep = " |\n";
86 $s = $this->getSkin()->mainPageLink() . $sep
87 . Linker::specialLink( 'Recentchanges' );
89 if ( $this->data['isarticle'] ) {
90 $s .= $sep . '<strong>' . $this->editThisPage() . '</strong>' . $sep . $this->talkLink() .
91 $sep . $this->historyLink();
94 /* show links to different language variants */
95 $s .= $this->variantLinks();
96 $s .= $this->extensionTabLinks();
97 if ( !$this->data['loggedin'] ) {
98 $s .= $sep . Linker::specialLink( 'Userlogin' );
99 } else {
100 /* show user page and user talk links */
101 $user = $this->getSkin()->getUser();
102 $s .= $sep . Linker::link( $user->getUserPage(), wfMessage( 'mypage' )->escaped() );
103 $s .= $sep . Linker::link( $user->getTalkPage(), wfMessage( 'mytalk' )->escaped() );
104 if ( $user->getNewtalk() ) {
105 $s .= ' *';
107 /* show watchlist link */
108 $s .= $sep . Linker::specialLink( 'Watchlist' );
109 /* show my contributions link */
110 $s .= $sep . Linker::link(
111 SpecialPage::getSafeTitleFor( 'Contributions', $this->data['username'] ),
112 wfMessage( 'mycontris' )->escaped() );
113 /* show my preferences link */
114 $s .= $sep . Linker::specialLink( 'Preferences' );
115 /* show upload file link */
116 if( UploadBase::isEnabled() && UploadBase::isAllowed( $user ) === true ) {
117 $s .= $sep . $this->getUploadLink();
120 /* show log out link */
121 $s .= $sep . Linker::specialLink( 'Userlogout' );
124 $s .= $sep . $this->specialPagesList();
126 return $s;
130 * @return string
132 function doAfterContent() {
133 $s = "\n</div><br clear='all' />\n";
135 $s .= "\n<div id='footer'><hr />";
137 $s .= $this->bottomLinks();
138 $s .= "\n<br />" . $this->pageStats();
139 $s .= "\n<br />" . $this->getSkin()->mainPageLink()
140 . ' | ' . $this->getSkin()->aboutLink()
141 . ' | ' . $this->searchForm();
143 $s .= "\n</div>\n</div>\n";
145 return $s;