3 * Standard (a.k.a. Classic) skin: old MediaWiki default skin
9 if( !defined( 'MEDIAWIKI' ) )
16 class SkinStandard
extends Skin
{
20 function outputPage( OutputPage
$out ) {
22 if ( 3 == $this->qbSetting() ) { # Floating left
23 $out->addScriptFile ( "{$wgStylePath}/common/sticky.js" );
25 parent
::outputPage( $out );
31 function setupSkinUserCss( OutputPage
$out ){
32 if ( 3 == $this->qbSetting() ) { # Floating left
33 $out->addStyle( 'common/quickbar.css' );
34 } else if ( 4 == $this->qbSetting() ) { # Floating right
35 $out->addStyle( 'common/quickbar-right.css' );
37 parent
::setupSkinUserCss( $out );
43 function reallyGenerateUserStylesheet() {
44 $s = parent
::reallyGenerateUserStylesheet();
45 $qb = $this->qbSetting();
47 if ( 2 == $qb ) { # Right
48 $s .= "#quickbar { position: absolute; top: 4px; right: 4px; " .
49 "border-left: 2px solid #000000; }\n" .
50 "#article, #mw-data-after-content { margin-left: 4px; margin-right: 152px; }\n";
51 } else if ( 1 == $qb ||
3 == $qb ) {
52 $s .= "#quickbar { position: absolute; top: 4px; left: 4px; " .
53 "border-right: 1px solid gray; }\n" .
54 "#article, #mw-data-after-content { margin-left: 152px; margin-right: 4px; }\n";
55 } else if ( 4 == $qb) {
56 $s .= "#quickbar { border-right: 1px solid gray; }\n" .
57 "#article, #mw-data-after-content { margin-right: 152px; margin-left: 4px; }\n";
65 function getBodyOptions() {
66 $a = parent
::getBodyOptions();
68 if ( 3 == $this->qbSetting() ) { # Floating left
69 $qb = "setup(\"quickbar\")";
71 $a['onload'] .= ";$qb";
79 function doAfterContent() {
80 global $wgContLang, $wgLang;
81 wfProfileIn( __METHOD__
);
82 wfProfileIn( __METHOD__
. '-1' );
84 $s = "\n</div><br style=\"clear:both\" />\n";
85 $s .= "\n<div id='footer'>";
86 $s .= '<table border="0" cellspacing="0"><tr>';
88 wfProfileOut( __METHOD__
. '-1' );
89 wfProfileIn( __METHOD__
. '-2' );
91 $qb = $this->qbSetting();
92 $shove = ( $qb != 0 );
93 $left = ( $qb == 1 ||
$qb == 3 );
94 if( $wgContLang->isRTL() ) $left = !$left;
96 if ( $shove && $left ) { # Left
97 $s .= $this->getQuickbarCompensator();
99 wfProfileOut( __METHOD__
. '-2' );
100 wfProfileIn( __METHOD__
. '-3' );
101 $l = $wgContLang->alignStart();
102 $s .= "<td class='bottom' align='$l' valign='top'>";
104 $s .= $this->bottomLinks();
105 $s .= "\n<br />" . $wgLang->pipeList( array(
106 $this->mainPageLink(),
108 $this->specialLink( 'recentchanges' ),
109 $this->searchForm() ) )
110 . '<br /><span id="pagestats">' . $this->pageStats() . '</span>';
113 if ( $shove && !$left ) { # Right
114 $s .= $this->getQuickbarCompensator();
116 $s .= "</tr></table>\n</div>\n</div>\n";
118 wfProfileOut( __METHOD__
. '-3' );
119 wfProfileIn( __METHOD__
. '-4' );
121 $s .= $this->quickBar();
123 wfProfileOut( __METHOD__
. '-4' );
124 wfProfileOut( __METHOD__
);
128 function quickBar() {
129 global $wgOut, $wgUser, $wgRequest, $wgContLang;
130 global $wgEnableUploads, $wgRemoteUploads;
132 wfProfileIn( __METHOD__
);
134 $action = $wgRequest->getText( 'action' );
135 $wpPreview = $wgRequest->getBool( 'wpPreview' );
136 $tns = $this->mTitle
->getNamespace();
138 $s = "\n<div id='quickbar'>";
139 $s .= "\n" . $this->logoText() . "\n<hr class='sep' />";
143 # Use the first heading from the Monobook sidebar as the "browse" section
144 $bar = $this->buildSidebar();
145 unset( $bar['SEARCH'] );
146 unset( $bar['LANGUAGES'] );
147 unset( $bar['TOOLBOX'] );
148 $browseLinks = reset( $bar );
150 foreach ( $browseLinks as $link ) {
151 if ( $link['text'] != '-' ) {
152 $s .= "<a href=\"{$link['href']}\">" .
153 htmlspecialchars( $link['text'] ) . '</a>' . $sep;
157 if( $wgUser->isLoggedIn() ) {
158 $s.= $this->specialLink( 'watchlist' ) ;
159 $s .= $sep . $this->linkKnown(
160 SpecialPage
::getTitleFor( 'Contributions' ),
161 wfMsg( 'mycontris' ),
163 array( 'target' => $wgUser->getName() )
166 // only show watchlist link if logged in
167 $s .= "\n<hr class='sep' />";
168 $articleExists = $this->mTitle
->getArticleId();
169 if ( $wgOut->isArticle() ||
$action == 'edit' ||
$action == 'history' ||
$wpPreview ) {
170 if( $wgOut->isArticle() ) {
171 $s .= '<strong>' . $this->editThisPage() . '</strong>';
172 } else { # backlink to the article in edit or history mode
173 if( $articleExists ){ # no backlink if no article
177 case NS_PROJECT_TALK
:
179 case NS_MEDIAWIKI_TALK
:
180 case NS_TEMPLATE_TALK
:
182 case NS_CATEGORY_TALK
:
183 $text = wfMsg('viewtalkpage');
186 $text = wfMsg( 'articlepage' );
189 $text = wfMsg( 'userpage' );
192 $text = wfMsg( 'projectpage' );
195 $text = wfMsg( 'imagepage' );
198 $text = wfMsg( 'mediawikipage' );
201 $text = wfMsg( 'templatepage' );
204 $text = wfMsg( 'viewhelppage' );
207 $text = wfMsg( 'categorypage' );
210 $text = wfMsg( 'articlepage' );
213 $link = $this->mTitle
->getText();
214 if( $nstext = $wgContLang->getNsText( $tns ) ) { # add namespace if necessary
215 $link = $nstext . ':' . $link;
219 Title
::newFromText( $link ),
222 } elseif( $this->mTitle
->getNamespace() != NS_SPECIAL
) {
223 # we just throw in a "New page" text to tell the user that he's in edit mode,
224 # and to avoid messing with the separator that is prepended to the next item
225 $s .= '<strong>' . wfMsg( 'newpage' ) . '</strong>';
229 # "Post a comment" link
230 if( ( $this->mTitle
->isTalkPage() ||
$wgOut->showNewSectionLink() ) && $action != 'edit' && !$wpPreview )
231 $s .= '<br />' . $this->link(
233 wfMsg( 'postcomment' ),
239 array( 'known', 'noclasses' )
242 #if( $tns%2 && $action!='edit' && !$wpPreview) {
243 #$s.= '<br />'.$this->linkKnown( Title::newFromText( $wgTitle->getPrefixedText() ),wfMsg('postcomment'),array(),array('action'=>'edit','section'=>'new'));
247 watching could cause problems in edit mode:
248 if user edits article, then loads "watch this article" in background and then saves
249 article with "Watch this article" checkbox disabled, the article is transparently
250 unwatched. Therefore we do not show the "Watch this page" link in edit mode
252 if ( $wgUser->isLoggedIn() && $articleExists) {
253 if( $action != 'edit' && $action != 'submit' ){
254 $s .= $sep . $this->watchThisPage();
256 if ( $this->mTitle
->userCan( 'edit' ) )
257 $s .= $sep . $this->moveThisPage();
259 if ( $wgUser->isAllowed( 'delete' ) and $articleExists ) {
260 $s .= $sep . $this->deleteThisPage() .
261 $sep . $this->protectThisPage();
263 $s .= $sep . $this->talkLink();
264 if( $articleExists && $action != 'history' ) {
265 $s .= $sep . $this->historyLink();
267 $s.= $sep . $this->whatLinksHere();
269 if( $wgOut->isArticleRelated() ) {
270 $s .= $sep . $this->watchPageLinksLink();
273 if ( NS_USER
== $this->mTitle
->getNamespace()
274 ||
$this->mTitle
->getNamespace() == NS_USER_TALK
) {
276 $id = User
::idFromName( $this->mTitle
->getText() );
277 $ip = User
::isIP( $this->mTitle
->getText() );
280 $s .= $sep . $this->userContribsLink();
282 if( $this->showEmailUser( $id ) ) {
283 $s .= $sep . $this->emailUserLink();
286 $s .= "\n<br /><hr class='sep' />";
289 if ( $wgUser->isLoggedIn() && ( $wgEnableUploads ||
$wgRemoteUploads ) ) {
290 $s .= $this->specialLink( 'upload' ) . $sep;
292 $s .= $this->specialLink( 'specialpages' );
294 global $wgSiteSupportPage;
295 if( $wgSiteSupportPage ) {
296 $s .= "\n<br /><a href=\"" . htmlspecialchars( $wgSiteSupportPage ) .
297 '" class="internal">' . wfMsg( 'sitesupport' ) . '</a>';
300 $s .= "\n<br /></div>\n";
301 wfProfileOut( __METHOD__
);