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();
25 if ( 2 == $qb ) { # Right
26 $rules[] = "#quickbar { position: absolute; top: 4px; right: 4px; border-left: 2px solid #000000; }";
27 $rules[] = "#article, #mw-data-after-content { margin-left: 4px; margin-right: 152px; }";
28 } elseif ( 1 == $qb ||
3 == $qb ) {
29 $rules[] = "#quickbar { position: absolute; top: 4px; left: 4px; border-right: 1px solid gray; }";
30 $rules[] = "#article, #mw-data-after-content { margin-left: 152px; margin-right: 4px; }";
32 $rules[] = "#quickbar { position: fixed; padding: 4px; }";
34 } elseif ( 4 == $qb ) {
35 $rules[] = "#quickbar { position: fixed; right: 0px; top: 0px; padding: 4px;}";
36 $rules[] = "#quickbar { border-right: 1px solid gray; }";
37 $rules[] = "#article, #mw-data-after-content { margin-right: 152px; margin-left: 4px; }";
39 $style = implode( "\n", $rules );
40 if ( $wgContLang->getDir() === 'rtl' ) {
41 $style = CSSJanus
::transform( $style, true, false );
43 $out->addInlineStyle( $style );
44 parent
::setupSkinUserCss( $out );
47 function doAfterContent() {
48 global $wgContLang, $wgLang;
49 wfProfileIn( __METHOD__
);
50 wfProfileIn( __METHOD__
. '-1' );
52 $s = "\n</div><br style=\"clear:both\" />\n";
53 $s .= "\n<div id='footer'>";
54 $s .= '<table border="0" cellspacing="0"><tr>';
56 wfProfileOut( __METHOD__
. '-1' );
57 wfProfileIn( __METHOD__
. '-2' );
59 $qb = $this->qbSetting();
60 $shove = ( $qb != 0 );
61 $left = ( $qb == 1 ||
$qb == 3 );
62 if( $wgContLang->isRTL() ) {
66 if ( $shove && $left ) { # Left
67 $s .= $this->getQuickbarCompensator();
69 wfProfileOut( __METHOD__
. '-2' );
70 wfProfileIn( __METHOD__
. '-3' );
71 $l = $wgContLang->alignStart();
72 $s .= "<td class='bottom' align='$l' valign='top'>";
74 $s .= $this->bottomLinks();
75 $s .= "\n<br />" . $wgLang->pipeList( array(
76 $this->mainPageLink(),
78 $this->specialLink( 'Recentchanges' ),
79 $this->searchForm() ) )
80 . '<br /><span id="pagestats">' . $this->pageStats() . '</span>';
83 if ( $shove && !$left ) { # Right
84 $s .= $this->getQuickbarCompensator();
86 $s .= "</tr></table>\n</div>\n</div>\n";
88 wfProfileOut( __METHOD__
. '-3' );
89 wfProfileIn( __METHOD__
. '-4' );
91 $s .= $this->quickBar();
93 wfProfileOut( __METHOD__
. '-4' );
94 wfProfileOut( __METHOD__
);
99 global $wgOut, $wgUser, $wgRequest, $wgContLang;
101 wfProfileIn( __METHOD__
);
103 $action = $wgRequest->getText( 'action' );
104 $wpPreview = $wgRequest->getBool( 'wpPreview' );
105 $tns = $this->mTitle
->getNamespace();
107 $s = "\n<div id='quickbar'>";
108 $s .= "\n" . $this->logoText() . "\n<hr class='sep' />";
112 # Use the first heading from the Monobook sidebar as the "browse" section
113 $bar = $this->buildSidebar();
114 unset( $bar['SEARCH'] );
115 unset( $bar['LANGUAGES'] );
116 unset( $bar['TOOLBOX'] );
117 $browseLinks = reset( $bar );
119 foreach ( $browseLinks as $link ) {
120 if ( $link['text'] != '-' ) {
121 $s .= "<a href=\"{$link['href']}\">" .
122 htmlspecialchars( $link['text'] ) . '</a>' . $sep;
126 if( $wgUser->isLoggedIn() ) {
127 $s.= $this->specialLink( 'Watchlist' ) ;
128 $s .= $sep . $this->linkKnown(
129 SpecialPage
::getTitleFor( 'Contributions' ),
130 wfMsg( 'mycontris' ),
132 array( 'target' => $wgUser->getName() )
135 // only show watchlist link if logged in
136 $s .= "\n<hr class='sep' />";
137 $articleExists = $this->mTitle
->getArticleId();
138 if ( $wgOut->isArticle() ||
$action == 'edit' ||
$action == 'history' ||
$wpPreview ) {
139 if( $wgOut->isArticle() ) {
140 $s .= '<strong>' . $this->editThisPage() . '</strong>';
141 } else { # backlink to the article in edit or history mode
142 if( $articleExists ){ # no backlink if no article
146 case NS_PROJECT_TALK
:
148 case NS_MEDIAWIKI_TALK
:
149 case NS_TEMPLATE_TALK
:
151 case NS_CATEGORY_TALK
:
152 $text = wfMsg('viewtalkpage');
155 $text = wfMsg( 'articlepage' );
158 $text = wfMsg( 'userpage' );
161 $text = wfMsg( 'projectpage' );
164 $text = wfMsg( 'imagepage' );
167 $text = wfMsg( 'mediawikipage' );
170 $text = wfMsg( 'templatepage' );
173 $text = wfMsg( 'viewhelppage' );
176 $text = wfMsg( 'categorypage' );
179 $text = wfMsg( 'articlepage' );
182 $link = $this->mTitle
->getText();
183 $nstext = $wgContLang->getNsText( $tns );
184 if( $nstext ) { # add namespace if necessary
185 $link = $nstext . ':' . $link;
189 Title
::newFromText( $link ),
192 } elseif( $this->mTitle
->getNamespace() != NS_SPECIAL
) {
193 # we just throw in a "New page" text to tell the user that he's in edit mode,
194 # and to avoid messing with the separator that is prepended to the next item
195 $s .= '<strong>' . wfMsg( 'newpage' ) . '</strong>';
199 # "Post a comment" link
200 if( ( $this->mTitle
->isTalkPage() ||
$wgOut->showNewSectionLink() ) && $action != 'edit' && !$wpPreview )
201 $s .= '<br />' . $this->link(
203 wfMsg( 'postcomment' ),
209 array( 'known', 'noclasses' )
213 watching could cause problems in edit mode:
214 if user edits article, then loads "watch this article" in background and then saves
215 article with "Watch this article" checkbox disabled, the article is transparently
216 unwatched. Therefore we do not show the "Watch this page" link in edit mode
218 if ( $wgUser->isLoggedIn() && $articleExists ) {
219 if( $action != 'edit' && $action != 'submit' ) {
220 $s .= $sep . $this->watchThisPage();
222 if ( $this->mTitle
->userCan( 'edit' ) )
223 $s .= $sep . $this->moveThisPage();
225 if ( $wgUser->isAllowed( 'delete' ) && $articleExists ) {
226 $s .= $sep . $this->deleteThisPage() .
227 $sep . $this->protectThisPage();
229 $s .= $sep . $this->talkLink();
230 if( $articleExists && $action != 'history' ) {
231 $s .= $sep . $this->historyLink();
233 $s .= $sep . $this->whatLinksHere();
235 if( $wgOut->isArticleRelated() ) {
236 $s .= $sep . $this->watchPageLinksLink();
240 NS_USER
== $this->mTitle
->getNamespace() ||
241 $this->mTitle
->getNamespace() == NS_USER_TALK
244 $id = User
::idFromName( $this->mTitle
->getText() );
245 $ip = User
::isIP( $this->mTitle
->getText() );
248 $s .= $sep . $this->userContribsLink();
250 if( $this->showEmailUser( $id ) ) {
251 $s .= $sep . $this->emailUserLink();
254 $s .= "\n<br /><hr class='sep' />";
257 if( UploadBase
::isEnabled() && UploadBase
::isAllowed( $wgUser ) === true ) {
258 $s .= $this->getUploadLink() . $sep;
261 $s .= $this->specialLink( 'Specialpages' );
263 global $wgSiteSupportPage;
264 if( $wgSiteSupportPage ) {
265 $s .= "\n<br /><a href=\"" . htmlspecialchars( $wgSiteSupportPage ) .
266 '" class="internal">' . wfMsg( 'sitesupport' ) . '</a>';
269 $s .= "\n<br /></div>\n";
270 wfProfileOut( __METHOD__
);