Kill off $wg{Request,User,Lang,Output} usage within skins/ and redundant $this->skin...
[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 /**
22 * @param $out OutputPage
23 */
24 function setupSkinUserCss( OutputPage $out ){
25 parent::setupSkinUserCss( $out );
26 $out->addModuleStyles( 'skins.nostalgia' );
27 }
28
29 }
30
31 class NostalgiaTemplate extends LegacyTemplate {
32
33 /**
34 * @return string
35 */
36 function doBeforeContent() {
37 $s = "\n<div id='content'>\n<div id='top'>\n";
38 $s .= '<div id="logo">' . $this->getSkin()->logoText( 'right' ) . '</div>';
39
40 $s .= $this->pageTitle();
41 $s .= $this->pageSubtitle() . "\n";
42
43 $s .= '<div id="topbar">';
44 $s .= $this->topLinks() . "\n<br />";
45
46 $notice = $this->getSkin()->getSiteNotice();
47 if( $notice ) {
48 $s .= "\n<div id='siteNotice'>$notice</div>\n";
49 }
50 $s .= $this->pageTitleLinks();
51
52 $ol = $this->otherLanguages();
53 if( $ol ) {
54 $s .= '<br />' . $ol;
55 }
56
57 $cat = '<div id="catlinks" class="catlinks">' . $this->getSkin()->getCategoryLinks() . '</div>';
58 if( $cat ) {
59 $s .= '<br />' . $cat;
60 }
61
62 $s .= "<br clear='all' /></div><hr />\n</div>\n";
63 $s .= "\n<div id='article'>";
64
65 return $s;
66 }
67
68 /**
69 * @return string
70 */
71 function topLinks() {
72 $sep = " |\n";
73
74 $s = $this->getSkin()->mainPageLink() . $sep
75 . Linker::specialLink( 'Recentchanges' );
76
77 if ( $this->data['isarticle'] ) {
78 $s .= $sep . '<strong>' . $this->editThisPage() . '</strong>' . $sep . $this->talkLink() .
79 $sep . $this->historyLink();
80 }
81
82 /* show links to different language variants */
83 $s .= $this->variantLinks();
84 $s .= $this->extensionTabLinks();
85 if ( !$this->data['loggedin'] ) {
86 $s .= $sep . Linker::specialLink( 'Userlogin' );
87 } else {
88 /* show user page and user talk links */
89 $s .= $sep . Linker::link( $this->getSkin()->getUser()->getUserPage(), wfMsgHtml( 'mypage' ) );
90 $s .= $sep . Linker::link( $this->getSkin()->getUser()->getTalkPage(), wfMsgHtml( 'mytalk' ) );
91 if ( $this->getSkin()->getUser()->getNewtalk() ) {
92 $s .= ' *';
93 }
94 /* show watchlist link */
95 $s .= $sep . Linker::specialLink( 'Watchlist' );
96 /* show my contributions link */
97 $s .= $sep . Linker::link(
98 SpecialPage::getSafeTitleFor( 'Contributions', $this->data['username'] ),
99 wfMsgHtml( 'mycontris' ) );
100 /* show my preferences link */
101 $s .= $sep . Linker::specialLink( 'Preferences' );
102 /* show upload file link */
103 if( UploadBase::isEnabled() && UploadBase::isAllowed( $this->getSkin()->getUser() ) === true ) {
104 $s .= $sep . $this->getUploadLink();
105 }
106
107 /* show log out link */
108 $s .= $sep . $this->getSkin()->specialLink( 'Userlogout' );
109 }
110
111 $s .= $sep . $this->specialPagesList();
112
113 return $s;
114 }
115
116 /**
117 * @return string
118 */
119 function doAfterContent() {
120 $s = "\n</div><br clear='all' />\n";
121
122 $s .= "\n<div id='footer'><hr />";
123
124 $s .= $this->bottomLinks();
125 $s .= "\n<br />" . $this->pageStats();
126 $s .= "\n<br />" . $this->getSkin()->mainPageLink()
127 . ' | ' . $this->getSkin()->aboutLink()
128 . ' | ' . $this->searchForm();
129
130 $s .= "\n</div>\n</div>\n";
131
132 return $s;
133 }
134 }