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 ){
23 parent
::setupSkinUserCss( $out );
24 $out->AddModuleStyles( 'skins.standard' );
27 $qb = $this->qbSetting();
30 if ( 2 == $qb ) { # Right
31 $rules[] = "#quickbar { position: absolute; top: 4px; right: 4px; border-left: 2px solid #000000; }";
32 $rules[] = "#article, #mw-data-after-content { margin-left: 4px; margin-right: 152px; }";
33 } elseif ( 1 == $qb ||
3 == $qb ) {
34 $rules[] = "#quickbar { position: absolute; top: 4px; left: 4px; border-right: 1px solid gray; }";
35 $rules[] = "#article, #mw-data-after-content { margin-left: 152px; margin-right: 4px; }";
37 $rules[] = "#quickbar { position: fixed; padding: 4px; }";
39 } elseif ( 4 == $qb ) {
40 $rules[] = "#quickbar { position: fixed; right: 0px; top: 0px; padding: 4px;}";
41 $rules[] = "#quickbar { border-right: 1px solid gray; }";
42 $rules[] = "#article, #mw-data-after-content { margin-right: 152px; margin-left: 4px; }";
44 $style = implode( "\n", $rules );
45 if ( $wgContLang->getDir() === 'rtl' ) {
46 $style = CSSJanus
::transform( $style, true, false );
48 $out->addInlineStyle( $style );
51 function doAfterContent() {
52 global $wgContLang, $wgLang;
53 wfProfileIn( __METHOD__
);
54 wfProfileIn( __METHOD__
. '-1' );
56 $s = "\n</div><br style=\"clear:both\" />\n";
57 $s .= "\n<div id='footer'>";
58 $s .= '<table border="0" cellspacing="0"><tr>';
60 wfProfileOut( __METHOD__
. '-1' );
61 wfProfileIn( __METHOD__
. '-2' );
63 $qb = $this->qbSetting();
64 $shove = ( $qb != 0 );
65 $left = ( $qb == 1 ||
$qb == 3 );
67 if ( $shove && $left ) { # Left
68 $s .= $this->getQuickbarCompensator();
70 wfProfileOut( __METHOD__
. '-2' );
71 wfProfileIn( __METHOD__
. '-3' );
72 $l = $wgContLang->alignStart();
73 $s .= "<td class='bottom' align='$l' valign='top'>";
75 $s .= $this->bottomLinks();
76 $s .= "\n<br />" . $wgLang->pipeList( array(
77 $this->mainPageLink(),
79 $this->specialLink( 'Recentchanges' ),
80 $this->searchForm() ) )
81 . '<br /><span id="pagestats">' . $this->pageStats() . '</span>';
84 if ( $shove && !$left ) { # Right
85 $s .= $this->getQuickbarCompensator();
87 $s .= "</tr></table>\n</div>\n</div>\n";
89 wfProfileOut( __METHOD__
. '-3' );
90 wfProfileIn( __METHOD__
. '-4' );
92 $s .= $this->quickBar();
94 wfProfileOut( __METHOD__
. '-4' );
95 wfProfileOut( __METHOD__
);
100 global $wgOut, $wgUser, $wgRequest, $wgContLang;
102 wfProfileIn( __METHOD__
);
104 $action = $wgRequest->getText( 'action' );
105 $wpPreview = $wgRequest->getBool( 'wpPreview' );
106 $tns = $this->mTitle
->getNamespace();
108 $s = "\n<div id='quickbar'>";
109 $s .= "\n" . $this->logoText() . "\n<hr class='sep' />";
113 # Use the first heading from the Monobook sidebar as the "browse" section
114 $bar = $this->buildSidebar();
115 unset( $bar['SEARCH'] );
116 unset( $bar['LANGUAGES'] );
117 unset( $bar['TOOLBOX'] );
118 $browseLinks = reset( $bar );
120 foreach ( $browseLinks as $link ) {
121 if ( $link['text'] != '-' ) {
122 $s .= "<a href=\"{$link['href']}\">" .
123 htmlspecialchars( $link['text'] ) . '</a>' . $sep;
127 if( $wgUser->isLoggedIn() ) {
128 $s.= $this->specialLink( 'Watchlist' ) ;
129 $s .= $sep . $this->linkKnown(
130 SpecialPage
::getTitleFor( 'Contributions' ),
131 wfMsg( 'mycontris' ),
133 array( 'target' => $wgUser->getName() )
136 // only show watchlist link if logged in
137 $s .= "\n<hr class='sep' />";
138 $articleExists = $this->mTitle
->getArticleId();
139 if ( $wgOut->isArticle() ||
$action == 'edit' ||
$action == 'history' ||
$wpPreview ) {
140 if( $wgOut->isArticle() ) {
141 $s .= '<strong>' . $this->editThisPage() . '</strong>';
142 } else { # backlink to the article in edit or history mode
143 if( $articleExists ){ # no backlink if no article
147 case NS_PROJECT_TALK
:
149 case NS_MEDIAWIKI_TALK
:
150 case NS_TEMPLATE_TALK
:
152 case NS_CATEGORY_TALK
:
153 $text = wfMsg('viewtalkpage');
156 $text = wfMsg( 'articlepage' );
159 $text = wfMsg( 'userpage' );
162 $text = wfMsg( 'projectpage' );
165 $text = wfMsg( 'imagepage' );
168 $text = wfMsg( 'mediawikipage' );
171 $text = wfMsg( 'templatepage' );
174 $text = wfMsg( 'viewhelppage' );
177 $text = wfMsg( 'categorypage' );
180 $text = wfMsg( 'articlepage' );
183 $link = $this->mTitle
->getText();
184 $nstext = $wgContLang->getNsText( $tns );
185 if( $nstext ) { # add namespace if necessary
186 $link = $nstext . ':' . $link;
190 Title
::newFromText( $link ),
193 } elseif( $this->mTitle
->getNamespace() != NS_SPECIAL
) {
194 # we just throw in a "New page" text to tell the user that he's in edit mode,
195 # and to avoid messing with the separator that is prepended to the next item
196 $s .= '<strong>' . wfMsg( 'newpage' ) . '</strong>';
200 # "Post a comment" link
201 if( ( $this->mTitle
->isTalkPage() ||
$wgOut->showNewSectionLink() ) && $action != 'edit' && !$wpPreview )
202 $s .= '<br />' . $this->link(
204 wfMsg( 'postcomment' ),
210 array( 'known', 'noclasses' )
214 watching could cause problems in edit mode:
215 if user edits article, then loads "watch this article" in background and then saves
216 article with "Watch this article" checkbox disabled, the article is transparently
217 unwatched. Therefore we do not show the "Watch this page" link in edit mode
219 if ( $wgUser->isLoggedIn() && $articleExists ) {
220 if( $action != 'edit' && $action != 'submit' ) {
221 $s .= $sep . $this->watchThisPage();
223 if ( $this->mTitle
->userCan( 'edit' ) )
224 $s .= $sep . $this->moveThisPage();
226 if ( $wgUser->isAllowed( 'delete' ) && $articleExists ) {
227 $s .= $sep . $this->deleteThisPage() .
228 $sep . $this->protectThisPage();
230 $s .= $sep . $this->talkLink();
231 if( $articleExists && $action != 'history' ) {
232 $s .= $sep . $this->historyLink();
234 $s .= $sep . $this->whatLinksHere();
236 if( $wgOut->isArticleRelated() ) {
237 $s .= $sep . $this->watchPageLinksLink();
241 NS_USER
== $this->mTitle
->getNamespace() ||
242 $this->mTitle
->getNamespace() == NS_USER_TALK
245 $id = User
::idFromName( $this->mTitle
->getText() );
246 $ip = User
::isIP( $this->mTitle
->getText() );
249 $s .= $sep . $this->userContribsLink();
251 if( $this->showEmailUser( $id ) ) {
252 $s .= $sep . $this->emailUserLink();
255 $s .= "\n<br /><hr class='sep' />";
258 if( UploadBase
::isEnabled() && UploadBase
::isAllowed( $wgUser ) === true ) {
259 $s .= $this->getUploadLink() . $sep;
262 $s .= $this->specialLink( 'Specialpages' );
264 global $wgSiteSupportPage;
265 if( $wgSiteSupportPage ) {
266 $s .= "\n<br /><a href=\"" . htmlspecialchars( $wgSiteSupportPage ) .
267 '" class="internal">' . wfMsg( 'sitesupport' ) . '</a>';
270 $s .= "\n<br /></div>\n";
271 wfProfileOut( __METHOD__
);