3 * Standard (a.k.a. Classic) skin: old MediaWiki default skin
9 if( !defined( 'MEDIAWIKI' ) ) {
17 class SkinStandard extends Skin {
22 function setupSkinUserCss( OutputPage $out ){
24 $qb = $this->qbSetting();
27 if ( 2 == $qb ) { # Right
28 $rules[] = "#quickbar { position: absolute; top: 4px; right: 4px; border-left: 2px solid #000000; }";
29 $rules[] = "#article, #mw-data-after-content { margin-left: 4px; margin-right: 152px; }";
30 } elseif ( 1 == $qb || 3 == $qb ) {
31 $rules[] = "#quickbar { position: absolute; top: 4px; left: 4px; border-right: 1px solid gray; }";
32 $rules[] = "#article, #mw-data-after-content { margin-left: 152px; margin-right: 4px; }";
34 $rules[] = "#quickbar { position: fixed; padding: 4px; }";
36 } elseif ( 4 == $qb ) {
37 $rules[] = "#quickbar { position: fixed; right: 0px; top: 0px; padding: 4px;}";
38 $rules[] = "#quickbar { border-right: 1px solid gray; }";
39 $rules[] = "#article, #mw-data-after-content { margin-right: 152px; margin-left: 4px; }";
41 $style = implode( "\n", $rules );
42 if ( $wgContLang->getDir() === 'rtl' ) {
43 $style = CSSJanus::transform( $style, true, false );
45 $out->addInlineStyle( $style );
46 parent::setupSkinUserCss( $out );
49 function doAfterContent() {
50 global $wgContLang, $wgLang;
51 wfProfileIn( __METHOD__ );
52 wfProfileIn( __METHOD__ . '-1' );
54 $s = "\n</div><br style=\"clear:both\" />\n";
55 $s .= "\n<div id='footer'>";
56 $s .= '<table border="0" cellspacing="0"><tr>';
58 wfProfileOut( __METHOD__ . '-1' );
59 wfProfileIn( __METHOD__ . '-2' );
61 $qb = $this->qbSetting();
62 $shove = ( $qb != 0 );
63 $left = ( $qb == 1 || $qb == 3 );
64 if( $wgContLang->isRTL() ) {
68 if ( $shove && $left ) { # Left
69 $s .= $this->getQuickbarCompensator();
71 wfProfileOut( __METHOD__ . '-2' );
72 wfProfileIn( __METHOD__ . '-3' );
73 $l = $wgContLang->alignStart();
74 $s .= "<td class='bottom' align='$l' valign='top'>";
76 $s .= $this->bottomLinks();
77 $s .= "\n<br />" . $wgLang->pipeList( array(
78 $this->mainPageLink(),
80 $this->specialLink( 'Recentchanges' ),
81 $this->searchForm() ) )
82 . '<br /><span id="pagestats">' . $this->pageStats() . '</span>';
85 if ( $shove && !$left ) { # Right
86 $s .= $this->getQuickbarCompensator();
88 $s .= "</tr></table>\n</div>\n</div>\n";
90 wfProfileOut( __METHOD__ . '-3' );
91 wfProfileIn( __METHOD__ . '-4' );
93 $s .= $this->quickBar();
95 wfProfileOut( __METHOD__ . '-4' );
96 wfProfileOut( __METHOD__ );
100 function quickBar() {
101 global $wgOut, $wgUser, $wgRequest, $wgContLang;
103 wfProfileIn( __METHOD__ );
105 $action = $wgRequest->getText( 'action' );
106 $wpPreview = $wgRequest->getBool( 'wpPreview' );
107 $tns = $this->mTitle->getNamespace();
109 $s = "\n<div id='quickbar'>";
110 $s .= "\n" . $this->logoText() . "\n<hr class='sep' />";
114 # Use the first heading from the Monobook sidebar as the "browse" section
115 $bar = $this->buildSidebar();
116 unset( $bar['SEARCH'] );
117 unset( $bar['LANGUAGES'] );
118 unset( $bar['TOOLBOX'] );
119 $browseLinks = reset( $bar );
121 foreach ( $browseLinks as $link ) {
122 if ( $link['text'] != '-' ) {
123 $s .= "<a href=\"{$link['href']}\">" .
124 htmlspecialchars( $link['text'] ) . '</a>' . $sep;
128 if( $wgUser->isLoggedIn() ) {
129 $s.= $this->specialLink( 'Watchlist' ) ;
130 $s .= $sep . $this->linkKnown(
131 SpecialPage::getTitleFor( 'Contributions' ),
132 wfMsg( 'mycontris' ),
134 array( 'target' => $wgUser->getName() )
137 // only show watchlist link if logged in
138 $s .= "\n<hr class='sep' />";
139 $articleExists = $this->mTitle->getArticleId();
140 if ( $wgOut->isArticle() || $action == 'edit' || $action == 'history' || $wpPreview ) {
141 if( $wgOut->isArticle() ) {
142 $s .= '<strong>' . $this->editThisPage() . '</strong>';
143 } else { # backlink to the article in edit or history mode
144 if( $articleExists ){ # no backlink if no article
148 case NS_PROJECT_TALK:
150 case NS_MEDIAWIKI_TALK:
151 case NS_TEMPLATE_TALK:
153 case NS_CATEGORY_TALK:
154 $text = wfMsg('viewtalkpage');
157 $text = wfMsg( 'articlepage' );
160 $text = wfMsg( 'userpage' );
163 $text = wfMsg( 'projectpage' );
166 $text = wfMsg( 'imagepage' );
169 $text = wfMsg( 'mediawikipage' );
172 $text = wfMsg( 'templatepage' );
175 $text = wfMsg( 'viewhelppage' );
178 $text = wfMsg( 'categorypage' );
181 $text = wfMsg( 'articlepage' );
184 $link = $this->mTitle->getText();
185 $nstext = $wgContLang->getNsText( $tns );
186 if( $nstext ) { # add namespace if necessary
187 $link = $nstext . ':' . $link;
191 Title::newFromText( $link ),
194 } elseif( $this->mTitle->getNamespace() != NS_SPECIAL ) {
195 # we just throw in a "New page" text to tell the user that he's in edit mode,
196 # and to avoid messing with the separator that is prepended to the next item
197 $s .= '<strong>' . wfMsg( 'newpage' ) . '</strong>';
201 # "Post a comment" link
202 if( ( $this->mTitle->isTalkPage() || $wgOut->showNewSectionLink() ) && $action != 'edit' && !$wpPreview )
203 $s .= '<br />' . $this->link(
205 wfMsg( 'postcomment' ),
211 array( 'known', 'noclasses' )
215 watching could cause problems in edit mode:
216 if user edits article, then loads "watch this article" in background and then saves
217 article with "Watch this article" checkbox disabled, the article is transparently
218 unwatched. Therefore we do not show the "Watch this page" link in edit mode
220 if ( $wgUser->isLoggedIn() && $articleExists ) {
221 if( $action != 'edit' && $action != 'submit' ) {
222 $s .= $sep . $this->watchThisPage();
224 if ( $this->mTitle->userCan( 'edit' ) )
225 $s .= $sep . $this->moveThisPage();
227 if ( $wgUser->isAllowed( 'delete' ) && $articleExists ) {
228 $s .= $sep . $this->deleteThisPage() .
229 $sep . $this->protectThisPage();
231 $s .= $sep . $this->talkLink();
232 if( $articleExists && $action != 'history' ) {
233 $s .= $sep . $this->historyLink();
235 $s .= $sep . $this->whatLinksHere();
237 if( $wgOut->isArticleRelated() ) {
238 $s .= $sep . $this->watchPageLinksLink();
242 NS_USER == $this->mTitle->getNamespace() ||
243 $this->mTitle->getNamespace() == NS_USER_TALK
246 $id = User::idFromName( $this->mTitle->getText() );
247 $ip = User::isIP( $this->mTitle->getText() );
250 $s .= $sep . $this->userContribsLink();
252 if( $this->showEmailUser( $id ) ) {
253 $s .= $sep . $this->emailUserLink();
256 $s .= "\n<br /><hr class='sep' />";
259 if( UploadBase::isEnabled() && UploadBase::isAllowed( $wgUser ) === true ) {
260 $s .= $this->getUploadLink() . $sep;
263 $s .= $this->specialLink( 'Specialpages' );
265 global $wgSiteSupportPage;
266 if( $wgSiteSupportPage ) {
267 $s .= "\n<br /><a href=\"" . htmlspecialchars( $wgSiteSupportPage ) .
268 '" class="internal">' . wfMsg( 'sitesupport' ) . '</a>';
271 $s .= "\n<br /></div>\n";
272 wfProfileOut( __METHOD__ );