ParseMaster is designed to use big regexes, with many starting characters.
[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 Skin {
18
19 function getSkinName() {
20 return 'nostalgia';
21 }
22
23 function setupSkinUserCss( OutputPage $out ){
24 parent::setupSkinUserCss( $out );
25 $out->addModuleStyles( 'skins.nostalgia' );
26 }
27
28 function doBeforeContent() {
29 $s = "\n<div id='content'>\n<div id='top'>\n";
30 $s .= '<div id="logo">' . $this->logoText( 'right' ) . '</div>';
31
32 $s .= $this->pageTitle();
33 $s .= $this->pageSubtitle() . "\n";
34
35 $s .= '<div id="topbar">';
36 $s .= $this->topLinks() . "\n<br />";
37
38 $notice = wfGetSiteNotice();
39 if( $notice ) {
40 $s .= "\n<div id='siteNotice'>$notice</div>\n";
41 }
42 $s .= $this->pageTitleLinks();
43
44 $ol = $this->otherLanguages();
45 if( $ol ) {
46 $s .= '<br />' . $ol;
47 }
48
49 $cat = $this->getCategoryLinks();
50 if( $cat ) {
51 $s .= '<br />' . $cat;
52 }
53
54 $s .= "<br clear='all' /></div><hr />\n</div>\n";
55 $s .= "\n<div id='article'>";
56
57 return $s;
58 }
59
60 function topLinks() {
61 global $wgOut, $wgUser;
62 $sep = " |\n";
63
64 $s = $this->mainPageLink() . $sep
65 . $this->specialLink( 'Recentchanges' );
66
67 if ( $wgOut->isArticle() ) {
68 $s .= $sep . '<strong>' . $this->editThisPage() . '</strong>' . $sep . $this->historyLink();
69 }
70
71 /* show links to different language variants */
72 $s .= $this->variantLinks();
73 $s .= $this->extensionTabLinks();
74 if ( $wgUser->isAnon() ) {
75 $s .= $sep . $this->specialLink( 'Userlogin' );
76 } else {
77 /* show user page and user talk links */
78 $s .= $sep . $this->link( $wgUser->getUserPage(), wfMsgHtml( 'mypage' ) );
79 $s .= $sep . $this->link( $wgUser->getTalkPage(), wfMsgHtml( 'mytalk' ) );
80 if ( $wgUser->getNewtalk() ) {
81 $s .= ' *';
82 }
83 /* show watchlist link */
84 $s .= $sep . $this->specialLink( 'Watchlist' );
85 /* show my contributions link */
86 $s .= $sep . $this->link(
87 SpecialPage::getSafeTitleFor( 'Contributions', $wgUser->getName() ),
88 wfMsgHtml( 'mycontris' ) );
89 /* show my preferences link */
90 $s .= $sep . $this->specialLink( 'Preferences' );
91 /* show upload file link */
92 if( UploadBase::isEnabled() && UploadBase::isAllowed( $wgUser ) === true ) {
93 $s .= $sep . $this->getUploadLink();
94 }
95
96 /* show log out link */
97 $s .= $sep . $this->specialLink( 'Userlogout' );
98 }
99
100 $s .= $sep . $this->specialPagesList();
101
102 return $s;
103 }
104
105 function doAfterContent() {
106 $s = "\n</div><br clear='all' />\n";
107
108 $s .= "\n<div id='footer'><hr />";
109
110 $s .= $this->bottomLinks();
111 $s .= "\n<br />" . $this->pageStats();
112 $s .= "\n<br />" . $this->mainPageLink()
113 . ' | ' . $this->aboutLink()
114 . ' | ' . $this->searchForm();
115
116 $s .= "\n</div>\n</div>\n";
117
118 return $s;
119 }
120 }