First part of bug 22881: Allow uploading directly into the archive to support importi...
[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 * @file
6 * @ingroup Skins
7 */
8
9 if( !defined( 'MEDIAWIKI' ) ) {
10 die( -1 );
11 }
12
13 /**
14 * @todo document
15 * @ingroup Skins
16 */
17 class SkinNostalgia extends SkinLegacy {
18 var $skinname = 'nostalgia', $stylename = 'nostalgia',
19 $template = 'NostalgiaTemplate';
20
21 function setupSkinUserCss( OutputPage $out ){
22 parent::setupSkinUserCss( $out );
23 $out->addModuleStyles( 'skins.nostalgia' );
24 }
25
26 }
27
28 class NostalgiaTemplate extends LegacyTemplate {
29
30 function doBeforeContent() {
31 $s = "\n<div id='content'>\n<div id='top'>\n";
32 $s .= '<div id="logo">' . $this->getSkin()->logoText( 'right' ) . '</div>';
33
34 $s .= $this->pageTitle();
35 $s .= $this->pageSubtitle() . "\n";
36
37 $s .= '<div id="topbar">';
38 $s .= $this->topLinks() . "\n<br />";
39
40 $notice = $this->getSkin()->getSiteNotice();
41 if( $notice ) {
42 $s .= "\n<div id='siteNotice'>$notice</div>\n";
43 }
44 $s .= $this->pageTitleLinks();
45
46 $ol = $this->otherLanguages();
47 if( $ol ) {
48 $s .= '<br />' . $ol;
49 }
50
51 $cat = $this->getSkin()->getCategoryLinks();
52 if( $cat ) {
53 $s .= '<br />' . $cat;
54 }
55
56 $s .= "<br clear='all' /></div><hr />\n</div>\n";
57 $s .= "\n<div id='article'>";
58
59 return $s;
60 }
61
62 function topLinks() {
63 global $wgOut, $wgUser;
64 $sep = " |\n";
65
66 $s = $this->getSkin()->mainPageLink() . $sep
67 . $this->getSkin()->specialLink( 'Recentchanges' );
68
69 if ( $wgOut->isArticle() ) {
70 $s .= $sep . '<strong>' . $this->editThisPage() . '</strong>' . $sep . $this->talkLink() .
71 $sep . $this->historyLink();
72 }
73
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 .= ' *';
85 }
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();
97 }
98
99 /* show log out link */
100 $s .= $sep . $this->getSkin()->specialLink( 'Userlogout' );
101 }
102
103 $s .= $sep . $this->specialPagesList();
104
105 return $s;
106 }
107
108 function doAfterContent() {
109 $s = "\n</div><br clear='all' />\n";
110
111 $s .= "\n<div id='footer'><hr />";
112
113 $s .= $this->bottomLinks();
114 $s .= "\n<br />" . $this->pageStats();
115 $s .= "\n<br />" . $this->getSkin()->mainPageLink()
116 . ' | ' . $this->getSkin()->aboutLink()
117 . ' | ' . $this->searchForm();
118
119 $s .= "\n</div>\n</div>\n";
120
121 return $s;
122 }
123 }