f7a2435331af9dbb123b32ab8954cccb47e9ceb9
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 parent
::outputPage( $out );
28 function setupSkinUserCss( OutputPage
$out ){
29 if ( 3 == $this->qbSetting() ) { # Floating left
30 $out->addStyle( 'common/quickbar.css' );
31 } else if ( 4 == $this->qbSetting() ) { # Floating right
32 $out->addStyle( 'common/quickbar-right.css' );
34 parent
::setupSkinUserCss( $out );
40 function reallyGenerateUserStylesheet() {
41 $s = parent
::reallyGenerateUserStylesheet();
42 $qb = $this->qbSetting();
44 if ( 2 == $qb ) { # Right
45 $s .= "#quickbar { position: absolute; top: 4px; right: 4px; " .
46 "border-left: 2px solid #000000; }\n" .
47 "#article, #mw-data-after-content { margin-left: 4px; margin-right: 152px; }\n";
48 } else if ( 1 == $qb ||
3 == $qb ) {
49 $s .= "#quickbar { position: absolute; top: 4px; left: 4px; " .
50 "border-right: 1px solid gray; }\n" .
51 "#article, #mw-data-after-content { margin-left: 152px; margin-right: 4px; }\n";
52 } else if ( 4 == $qb) {
53 $s .= "#quickbar { border-right: 1px solid gray; }\n" .
54 "#article, #mw-data-after-content { margin-right: 152px; margin-left: 4px; }\n";
59 function doAfterContent() {
60 global $wgContLang, $wgLang;
61 wfProfileIn( __METHOD__
);
62 wfProfileIn( __METHOD__
. '-1' );
64 $s = "\n</div><br style=\"clear:both\" />\n";
65 $s .= "\n<div id='footer'>";
66 $s .= '<table border="0" cellspacing="0"><tr>';
68 wfProfileOut( __METHOD__
. '-1' );
69 wfProfileIn( __METHOD__
. '-2' );
71 $qb = $this->qbSetting();
72 $shove = ( $qb != 0 );
73 $left = ( $qb == 1 ||
$qb == 3 );
74 if( $wgContLang->isRTL() ) $left = !$left;
76 if ( $shove && $left ) { # Left
77 $s .= $this->getQuickbarCompensator();
79 wfProfileOut( __METHOD__
. '-2' );
80 wfProfileIn( __METHOD__
. '-3' );
81 $l = $wgContLang->alignStart();
82 $s .= "<td class='bottom' align='$l' valign='top'>";
84 $s .= $this->bottomLinks();
85 $s .= "\n<br />" . $wgLang->pipeList( array(
86 $this->mainPageLink(),
88 $this->specialLink( 'recentchanges' ),
89 $this->searchForm() ) )
90 . '<br /><span id="pagestats">' . $this->pageStats() . '</span>';
93 if ( $shove && !$left ) { # Right
94 $s .= $this->getQuickbarCompensator();
96 $s .= "</tr></table>\n</div>\n</div>\n";
98 wfProfileOut( __METHOD__
. '-3' );
99 wfProfileIn( __METHOD__
. '-4' );
101 $s .= $this->quickBar();
103 wfProfileOut( __METHOD__
. '-4' );
104 wfProfileOut( __METHOD__
);
108 function quickBar() {
109 global $wgOut, $wgUser, $wgRequest, $wgContLang;
110 global $wgEnableUploads, $wgRemoteUploads;
112 wfProfileIn( __METHOD__
);
114 $action = $wgRequest->getText( 'action' );
115 $wpPreview = $wgRequest->getBool( 'wpPreview' );
116 $tns = $this->mTitle
->getNamespace();
118 $s = "\n<div id='quickbar'>";
119 $s .= "\n" . $this->logoText() . "\n<hr class='sep' />";
123 # Use the first heading from the Monobook sidebar as the "browse" section
124 $bar = $this->buildSidebar();
125 unset( $bar['SEARCH'] );
126 unset( $bar['LANGUAGES'] );
127 unset( $bar['TOOLBOX'] );
128 $browseLinks = reset( $bar );
130 foreach ( $browseLinks as $link ) {
131 if ( $link['text'] != '-' ) {
132 $s .= "<a href=\"{$link['href']}\">" .
133 htmlspecialchars( $link['text'] ) . '</a>' . $sep;
137 if( $wgUser->isLoggedIn() ) {
138 $s.= $this->specialLink( 'watchlist' ) ;
139 $s .= $sep . $this->linkKnown(
140 SpecialPage
::getTitleFor( 'Contributions' ),
141 wfMsg( 'mycontris' ),
143 array( 'target' => $wgUser->getName() )
146 // only show watchlist link if logged in
147 $s .= "\n<hr class='sep' />";
148 $articleExists = $this->mTitle
->getArticleId();
149 if ( $wgOut->isArticle() ||
$action == 'edit' ||
$action == 'history' ||
$wpPreview ) {
150 if( $wgOut->isArticle() ) {
151 $s .= '<strong>' . $this->editThisPage() . '</strong>';
152 } else { # backlink to the article in edit or history mode
153 if( $articleExists ){ # no backlink if no article
157 case NS_PROJECT_TALK
:
159 case NS_MEDIAWIKI_TALK
:
160 case NS_TEMPLATE_TALK
:
162 case NS_CATEGORY_TALK
:
163 $text = wfMsg('viewtalkpage');
166 $text = wfMsg( 'articlepage' );
169 $text = wfMsg( 'userpage' );
172 $text = wfMsg( 'projectpage' );
175 $text = wfMsg( 'imagepage' );
178 $text = wfMsg( 'mediawikipage' );
181 $text = wfMsg( 'templatepage' );
184 $text = wfMsg( 'viewhelppage' );
187 $text = wfMsg( 'categorypage' );
190 $text = wfMsg( 'articlepage' );
193 $link = $this->mTitle
->getText();
194 if( $nstext = $wgContLang->getNsText( $tns ) ) { # add namespace if necessary
195 $link = $nstext . ':' . $link;
199 Title
::newFromText( $link ),
202 } elseif( $this->mTitle
->getNamespace() != NS_SPECIAL
) {
203 # we just throw in a "New page" text to tell the user that he's in edit mode,
204 # and to avoid messing with the separator that is prepended to the next item
205 $s .= '<strong>' . wfMsg( 'newpage' ) . '</strong>';
209 # "Post a comment" link
210 if( ( $this->mTitle
->isTalkPage() ||
$wgOut->showNewSectionLink() ) && $action != 'edit' && !$wpPreview )
211 $s .= '<br />' . $this->link(
213 wfMsg( 'postcomment' ),
219 array( 'known', 'noclasses' )
222 #if( $tns%2 && $action!='edit' && !$wpPreview) {
223 #$s.= '<br />'.$this->linkKnown( Title::newFromText( $wgTitle->getPrefixedText() ),wfMsg('postcomment'),array(),array('action'=>'edit','section'=>'new'));
227 watching could cause problems in edit mode:
228 if user edits article, then loads "watch this article" in background and then saves
229 article with "Watch this article" checkbox disabled, the article is transparently
230 unwatched. Therefore we do not show the "Watch this page" link in edit mode
232 if ( $wgUser->isLoggedIn() && $articleExists) {
233 if( $action != 'edit' && $action != 'submit' ){
234 $s .= $sep . $this->watchThisPage();
236 if ( $this->mTitle
->userCan( 'edit' ) )
237 $s .= $sep . $this->moveThisPage();
239 if ( $wgUser->isAllowed( 'delete' ) and $articleExists ) {
240 $s .= $sep . $this->deleteThisPage() .
241 $sep . $this->protectThisPage();
243 $s .= $sep . $this->talkLink();
244 if( $articleExists && $action != 'history' ) {
245 $s .= $sep . $this->historyLink();
247 $s.= $sep . $this->whatLinksHere();
249 if( $wgOut->isArticleRelated() ) {
250 $s .= $sep . $this->watchPageLinksLink();
253 if ( NS_USER
== $this->mTitle
->getNamespace()
254 ||
$this->mTitle
->getNamespace() == NS_USER_TALK
) {
256 $id = User
::idFromName( $this->mTitle
->getText() );
257 $ip = User
::isIP( $this->mTitle
->getText() );
260 $s .= $sep . $this->userContribsLink();
262 if( $this->showEmailUser( $id ) ) {
263 $s .= $sep . $this->emailUserLink();
266 $s .= "\n<br /><hr class='sep' />";
269 if ( $wgUser->isLoggedIn() && ( $wgEnableUploads ||
$wgRemoteUploads ) ) {
270 $s .= $this->specialLink( 'upload' ) . $sep;
272 $s .= $this->specialLink( 'specialpages' );
274 global $wgSiteSupportPage;
275 if( $wgSiteSupportPage ) {
276 $s .= "\n<br /><a href=\"" . htmlspecialchars( $wgSiteSupportPage ) .
277 '" class="internal">' . wfMsg( 'sitesupport' ) . '</a>';
280 $s .= "\n<br /></div>\n";
281 wfProfileOut( __METHOD__
);