Throw an exception instead of low-level PHP fatal error if something invokes the...
[mediawiki.git] / skins / Nostalgia.php
blob6c599b218cb72a9982542c973831b7359961b331
1 <?php
2 /**
3 * Nostalgia: A skin which looks like Wikipedia did in its first year (2001).
5 * @file
6 * @ingroup Skins
7 */
9 if( !defined( 'MEDIAWIKI' ) ) {
10 die( -1 );
13 /**
14 * @todo document
15 * @ingroup Skins
17 class SkinNostalgia extends Skin {
19 function getStylesheet() {
20 return 'common/nostalgia.css';
23 function getSkinName() {
24 return 'nostalgia';
27 function doBeforeContent() {
28 $s = "\n<div id='content'>\n<div id='top'>\n";
29 $s .= '<div id="logo">' . $this->logoText( 'right' ) . '</div>';
31 $s .= $this->pageTitle();
32 $s .= $this->pageSubtitle() . "\n";
34 $s .= '<div id="topbar">';
35 $s .= $this->topLinks() . "\n<br />";
37 $notice = wfGetSiteNotice();
38 if( $notice ) {
39 $s .= "\n<div id='siteNotice'>$notice</div>\n";
41 $s .= $this->pageTitleLinks();
43 $ol = $this->otherLanguages();
44 if( $ol ) {
45 $s .= '<br />' . $ol;
48 $cat = $this->getCategoryLinks();
49 if( $cat ) {
50 $s .= '<br />' . $cat;
53 $s .= "<br clear='all' /></div><hr />\n</div>\n";
54 $s .= "\n<div id='article'>";
56 return $s;
59 function topLinks() {
60 global $wgOut, $wgUser;
61 $sep = " |\n";
63 $s = $this->mainPageLink() . $sep
64 . $this->specialLink( 'Recentchanges' );
66 if ( $wgOut->isArticle() ) {
67 $s .= $sep . '<strong>' . $this->editThisPage() . '</strong>' . $sep . $this->historyLink();
70 /* show links to different language variants */
71 $s .= $this->variantLinks();
72 $s .= $this->extensionTabLinks();
73 if ( $wgUser->isAnon() ) {
74 $s .= $sep . $this->specialLink( 'Userlogin' );
75 } else {
76 /* show user page and user talk links */
77 $s .= $sep . $this->link( $wgUser->getUserPage(), wfMsgHtml( 'mypage' ) );
78 $s .= $sep . $this->link( $wgUser->getTalkPage(), wfMsgHtml( 'mytalk' ) );
79 if ( $wgUser->getNewtalk() ) {
80 $s .= ' *';
82 /* show watchlist link */
83 $s .= $sep . $this->specialLink( 'Watchlist' );
84 /* show my contributions link */
85 $s .= $sep . $this->link(
86 SpecialPage::getSafeTitleFor( 'Contributions', $wgUser->getName() ),
87 wfMsgHtml( 'mycontris' ) );
88 /* show my preferences link */
89 $s .= $sep . $this->specialLink( 'Preferences' );
90 /* show upload file link */
91 if( UploadBase::isEnabled() && UploadBase::isAllowed( $wgUser ) === true ) {
92 $s .= $sep . $this->getUploadLink();
95 /* show log out link */
96 $s .= $sep . $this->specialLink( 'Userlogout' );
99 $s .= $sep . $this->specialPagesList();
101 return $s;
104 function doAfterContent() {
105 $s = "\n</div><br clear='all' />\n";
107 $s .= "\n<div id='footer'><hr />";
109 $s .= $this->bottomLinks();
110 $s .= "\n<br />" . $this->pageStats();
111 $s .= "\n<br />" . $this->mainPageLink()
112 . ' | ' . $this->aboutLink()
113 . ' | ' . $this->searchForm();
115 $s .= "\n</div>\n</div>\n";
117 return $s;