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";
62 function doAfterContent() {
63 global $wgContLang, $wgLang;
64 wfProfileIn( __METHOD__
);
65 wfProfileIn( __METHOD__
. '-1' );
67 $s = "\n</div><br style=\"clear:both\" />\n";
68 $s .= "\n<div id='footer'>";
69 $s .= '<table border="0" cellspacing="0"><tr>';
71 wfProfileOut( __METHOD__
. '-1' );
72 wfProfileIn( __METHOD__
. '-2' );
74 $qb = $this->qbSetting();
75 $shove = ( $qb != 0 );
76 $left = ( $qb == 1 ||
$qb == 3 );
77 if( $wgContLang->isRTL() ) $left = !$left;
79 if ( $shove && $left ) { # Left
80 $s .= $this->getQuickbarCompensator();
82 wfProfileOut( __METHOD__
. '-2' );
83 wfProfileIn( __METHOD__
. '-3' );
84 $l = $wgContLang->alignStart();
85 $s .= "<td class='bottom' align='$l' valign='top'>";
87 $s .= $this->bottomLinks();
88 $s .= "\n<br />" . $wgLang->pipeList( array(
89 $this->mainPageLink(),
91 $this->specialLink( 'recentchanges' ),
92 $this->searchForm() ) )
93 . '<br /><span id="pagestats">' . $this->pageStats() . '</span>';
96 if ( $shove && !$left ) { # Right
97 $s .= $this->getQuickbarCompensator();
99 $s .= "</tr></table>\n</div>\n</div>\n";
101 wfProfileOut( __METHOD__
. '-3' );
102 wfProfileIn( __METHOD__
. '-4' );
104 $s .= $this->quickBar();
106 wfProfileOut( __METHOD__
. '-4' );
107 wfProfileOut( __METHOD__
);
111 function quickBar() {
112 global $wgOut, $wgUser, $wgRequest, $wgContLang;
113 global $wgEnableUploads, $wgRemoteUploads;
115 wfProfileIn( __METHOD__
);
117 $action = $wgRequest->getText( 'action' );
118 $wpPreview = $wgRequest->getBool( 'wpPreview' );
119 $tns = $this->mTitle
->getNamespace();
121 $s = "\n<div id='quickbar'>";
122 $s .= "\n" . $this->logoText() . "\n<hr class='sep' />";
126 # Use the first heading from the Monobook sidebar as the "browse" section
127 $bar = $this->buildSidebar();
128 unset( $bar['SEARCH'] );
129 unset( $bar['LANGUAGES'] );
130 unset( $bar['TOOLBOX'] );
131 $browseLinks = reset( $bar );
133 foreach ( $browseLinks as $link ) {
134 if ( $link['text'] != '-' ) {
135 $s .= "<a href=\"{$link['href']}\">" .
136 htmlspecialchars( $link['text'] ) . '</a>' . $sep;
140 if( $wgUser->isLoggedIn() ) {
141 $s.= $this->specialLink( 'watchlist' ) ;
142 $s .= $sep . $this->linkKnown(
143 SpecialPage
::getTitleFor( 'Contributions' ),
144 wfMsg( 'mycontris' ),
146 array( 'target' => $wgUser->getName() )
149 // only show watchlist link if logged in
150 $s .= "\n<hr class='sep' />";
151 $articleExists = $this->mTitle
->getArticleId();
152 if ( $wgOut->isArticle() ||
$action == 'edit' ||
$action == 'history' ||
$wpPreview ) {
153 if( $wgOut->isArticle() ) {
154 $s .= '<strong>' . $this->editThisPage() . '</strong>';
155 } else { # backlink to the article in edit or history mode
156 if( $articleExists ){ # no backlink if no article
160 case NS_PROJECT_TALK
:
162 case NS_MEDIAWIKI_TALK
:
163 case NS_TEMPLATE_TALK
:
165 case NS_CATEGORY_TALK
:
166 $text = wfMsg('viewtalkpage');
169 $text = wfMsg( 'articlepage' );
172 $text = wfMsg( 'userpage' );
175 $text = wfMsg( 'projectpage' );
178 $text = wfMsg( 'imagepage' );
181 $text = wfMsg( 'mediawikipage' );
184 $text = wfMsg( 'templatepage' );
187 $text = wfMsg( 'viewhelppage' );
190 $text = wfMsg( 'categorypage' );
193 $text = wfMsg( 'articlepage' );
196 $link = $this->mTitle
->getText();
197 if( $nstext = $wgContLang->getNsText( $tns ) ) { # add namespace if necessary
198 $link = $nstext . ':' . $link;
202 Title
::newFromText( $link ),
205 } elseif( $this->mTitle
->getNamespace() != NS_SPECIAL
) {
206 # we just throw in a "New page" text to tell the user that he's in edit mode,
207 # and to avoid messing with the separator that is prepended to the next item
208 $s .= '<strong>' . wfMsg( 'newpage' ) . '</strong>';
212 # "Post a comment" link
213 if( ( $this->mTitle
->isTalkPage() ||
$wgOut->showNewSectionLink() ) && $action != 'edit' && !$wpPreview )
214 $s .= '<br />' . $this->link(
216 wfMsg( 'postcomment' ),
222 array( 'known', 'noclasses' )
225 #if( $tns%2 && $action!='edit' && !$wpPreview) {
226 #$s.= '<br />'.$this->linkKnown( Title::newFromText( $wgTitle->getPrefixedText() ),wfMsg('postcomment'),array(),array('action'=>'edit','section'=>'new'));
230 watching could cause problems in edit mode:
231 if user edits article, then loads "watch this article" in background and then saves
232 article with "Watch this article" checkbox disabled, the article is transparently
233 unwatched. Therefore we do not show the "Watch this page" link in edit mode
235 if ( $wgUser->isLoggedIn() && $articleExists) {
236 if( $action != 'edit' && $action != 'submit' ){
237 $s .= $sep . $this->watchThisPage();
239 if ( $this->mTitle
->userCan( 'edit' ) )
240 $s .= $sep . $this->moveThisPage();
242 if ( $wgUser->isAllowed( 'delete' ) and $articleExists ) {
243 $s .= $sep . $this->deleteThisPage() .
244 $sep . $this->protectThisPage();
246 $s .= $sep . $this->talkLink();
247 if( $articleExists && $action != 'history' ) {
248 $s .= $sep . $this->historyLink();
250 $s.= $sep . $this->whatLinksHere();
252 if( $wgOut->isArticleRelated() ) {
253 $s .= $sep . $this->watchPageLinksLink();
256 if ( NS_USER
== $this->mTitle
->getNamespace()
257 ||
$this->mTitle
->getNamespace() == NS_USER_TALK
) {
259 $id = User
::idFromName( $this->mTitle
->getText() );
260 $ip = User
::isIP( $this->mTitle
->getText() );
263 $s .= $sep . $this->userContribsLink();
265 if( $this->showEmailUser( $id ) ) {
266 $s .= $sep . $this->emailUserLink();
269 $s .= "\n<br /><hr class='sep' />";
272 if ( $wgUser->isLoggedIn() && ( $wgEnableUploads ||
$wgRemoteUploads ) ) {
273 $s .= $this->specialLink( 'upload' ) . $sep;
275 $s .= $this->specialLink( 'specialpages' );
277 global $wgSiteSupportPage;
278 if( $wgSiteSupportPage ) {
279 $s .= "\n<br /><a href=\"" . htmlspecialchars( $wgSiteSupportPage ) .
280 '" class="internal">' . wfMsg( 'sitesupport' ) . '</a>';
283 $s .= "\n<br /></div>\n";
284 wfProfileOut( __METHOD__
);