(bug 18338) WAI-ARIA landmark roles in most used skins
[lhc/web/wiklou.git] / skins / Nostalgia.php
1 <?php
2 /**
3 * Nostalgia: A skin which looks like Wikipedia did in its first year (2001).
4 *
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.
9 *
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.
14 *
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
19 *
20 * @file
21 * @ingroup Skins
22 */
23
24 if( !defined( 'MEDIAWIKI' ) ) {
25 die( -1 );
26 }
27
28 /**
29 * @todo document
30 * @ingroup Skins
31 */
32 class SkinNostalgia extends SkinLegacy {
33 var $skinname = 'nostalgia', $stylename = 'nostalgia',
34 $template = 'NostalgiaTemplate';
35
36 /**
37 * @param $out OutputPage
38 */
39 function setupSkinUserCss( OutputPage $out ){
40 parent::setupSkinUserCss( $out );
41 $out->addModuleStyles( 'skins.nostalgia' );
42 }
43
44 }
45
46 class NostalgiaTemplate extends LegacyTemplate {
47
48 /**
49 * @return string
50 */
51 function doBeforeContent() {
52 $s = "\n<div id='content'>\n<div id='top'>\n";
53 $s .= '<div id="logo">' . $this->getSkin()->logoText( 'right' ) . '</div>';
54
55 $s .= $this->pageTitle();
56 $s .= $this->pageSubtitle() . "\n";
57
58 $s .= '<div id="topbar">';
59 $s .= $this->topLinks() . "\n<br />";
60
61 $notice = $this->getSkin()->getSiteNotice();
62 if( $notice ) {
63 $s .= "\n<div id='siteNotice'>$notice</div>\n";
64 }
65 $s .= $this->pageTitleLinks();
66
67 $ol = $this->otherLanguages();
68 if( $ol ) {
69 $s .= '<br />' . $ol;
70 }
71
72 $s .= $this->getSkin()->getCategories();
73
74 $s .= "<br clear='all' /></div><hr />\n</div>\n";
75 $s .= "\n<div id='article'>";
76
77 return $s;
78 }
79
80 /**
81 * @return string
82 */
83 function topLinks() {
84 $sep = " |\n";
85
86 $s = $this->getSkin()->mainPageLink() . $sep
87 . Linker::specialLink( 'Recentchanges' );
88
89 if ( $this->data['isarticle'] ) {
90 $s .= $sep . '<strong>' . $this->editThisPage() . '</strong>' . $sep . $this->talkLink() .
91 $sep . $this->historyLink();
92 }
93
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 .= ' *';
106 }
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();
118 }
119
120 /* show log out link */
121 $s .= $sep . Linker::specialLink( 'Userlogout' );
122 }
123
124 $s .= $sep . $this->specialPagesList();
125
126 return $s;
127 }
128
129 /**
130 * @return string
131 */
132 function doAfterContent() {
133 $s = "\n</div><br clear='all' />\n";
134
135 $s .= "\n<div id='footer'><hr />";
136
137 $s .= $this->bottomLinks();
138 $s .= "\n<br />" . $this->pageStats();
139 $s .= "\n<br />" . $this->getSkin()->mainPageLink()
140 . ' | ' . $this->getSkin()->aboutLink()
141 . ' | ' . $this->searchForm();
142
143 $s .= "\n</div>\n</div>\n";
144
145 return $s;
146 }
147 }