3 * Standard (a.k.a. Classic) skin: old MediaWiki default skin
9 if( !defined( 'MEDIAWIKI' ) ) {
17 class SkinStandard
extends SkinLegacy
{
18 var $skinname = 'standard', $stylename = 'standard',
19 $template = 'StandardTemplate';
22 * @param $out OutputPage
24 function setupSkinUserCss( OutputPage
$out ){
25 parent
::setupSkinUserCss( $out );
26 $out->addModuleStyles( 'skins.standard' );
28 $qb = $this->qbSetting();
31 if ( 2 == $qb ) { # Right
32 $rules[] = "/* @noflip */#quickbar { position: absolute; top: 4px; right: 4px; border-left: 2px solid #000000; }";
33 $rules[] = "/* @noflip */#article, #mw-data-after-content { margin-left: 4px; margin-right: 152px; }";
34 $rules[] = "/* @noflip */#topbar, #footer { margin-right: 152px; }";
35 } elseif ( 1 == $qb ||
3 == $qb ) {
36 $rules[] = "/* @noflip */#quickbar { position: absolute; top: 4px; left: 4px; border-right: 1px solid gray; }";
37 $rules[] = "/* @noflip */#article, #mw-data-after-content { margin-left: 152px; margin-right: 4px; }";
38 $rules[] = "/* @noflip */#topbar, #footer { margin-left: 152px; }";
40 $rules[] = "/* @noflip */#quickbar { position: fixed; padding: 4px; }";
42 } elseif ( 4 == $qb ) {
43 $rules[] = "/* @noflip */#quickbar { position: fixed; right: 0px; top: 0px; padding: 4px;}";
44 $rules[] = "/* @noflip */#quickbar { border-right: 1px solid gray; }";
45 $rules[] = "/* @noflip */#article, #mw-data-after-content { margin-right: 152px; margin-left: 4px; }";
46 $rules[] = "/* @noflip */#topbar, #footer { margin-right: 152px; }";
48 $style = implode( "\n", $rules );
49 $out->addInlineStyle( $style, 'flip' );
54 class StandardTemplate
extends LegacyTemplate
{
59 function doAfterContent() {
60 wfProfileIn( __METHOD__
);
61 wfProfileIn( __METHOD__
. '-1' );
63 $s = "\n</div><br style=\"clear:both\" />\n";
64 $s .= "\n<div id='footer'>";
65 $s .= '<table border="0" cellspacing="0"><tr>';
67 wfProfileOut( __METHOD__
. '-1' );
68 wfProfileIn( __METHOD__
. '-2' );
69 $l = $this->getSkin()->getLang()->alignStart();
70 $s .= "<td class='bottom' align='$l' valign='top'>";
72 $s .= $this->bottomLinks();
73 $s .= "\n<br />" . $this->getSkin()->getLang()->pipeList( array(
74 $this->getSkin()->mainPageLink(),
75 $this->getSkin()->aboutLink(),
76 Linker
::specialLink( 'Recentchanges' ),
77 $this->searchForm() ) )
78 . '<br /><span id="pagestats">' . $this->pageStats() . '</span>';
81 $s .= "</tr></table>\n</div>\n</div>\n";
83 wfProfileOut( __METHOD__
. '-2' );
84 wfProfileIn( __METHOD__
. '-3' );
85 if ( $this->getSkin()->qbSetting() != 0 ) {
86 $s .= $this->quickBar();
88 wfProfileOut( __METHOD__
. '-3' );
89 wfProfileOut( __METHOD__
);
99 wfProfileIn( __METHOD__
);
101 $action = $this->getSkin()->getRequest()->getText( 'action' );
102 $wpPreview = $this->getSkin()->getRequest()->getBool( 'wpPreview' );
103 $title = $this->getSkin()->getTitle();
104 $tns = $title->getNamespace();
106 $s = "\n<div id='quickbar'>";
107 $s .= "\n" . $this->getSkin()->logoText() . "\n<hr class='sep' />";
111 # Use the first heading from the Monobook sidebar as the "browse" section
112 $bar = $this->getSkin()->buildSidebar();
113 unset( $bar['SEARCH'] );
114 unset( $bar['LANGUAGES'] );
115 unset( $bar['TOOLBOX'] );
118 foreach ( $bar as $browseLinks ) {
119 if ( is_array( $browseLinks ) ) {
120 if ( $barnumber > 1 ) {
121 $s .= "\n<hr class='sep' />";
123 foreach ( $browseLinks as $link ) {
124 if ( $link['text'] != '-' ) {
125 $s .= "<a href=\"{$link['href']}\">" .
126 htmlspecialchars( $link['text'] ) . '</a>' . $sep;
130 if ( $barnumber == 1 ) {
131 // only show watchlist link if logged in
132 if( $this->data
['loggedin'] ) {
133 $s.= Linker
::specialLink( 'Watchlist' ) ;
134 $s .= $sep . Linker
::linkKnown(
135 SpecialPage
::getTitleFor( 'Contributions' ),
136 wfMsg( 'mycontris' ),
138 array( 'target' => $this->data
['username'] )
142 $barnumber = $barnumber +
1;
145 $s .= "\n<hr class='sep' />";
146 $articleExists = $title->getArticleId();
147 if ( $this->data
['isarticle'] ||
$action == 'edit' ||
$action == 'history' ||
$wpPreview ) {
148 if( $this->data
['isarticle'] ) {
149 $s .= '<strong>' . $this->editThisPage() . '</strong>';
150 } else { # backlink to the article in edit or history mode
151 if( $articleExists ){ # no backlink if no article
155 case NS_PROJECT_TALK
:
157 case NS_MEDIAWIKI_TALK
:
158 case NS_TEMPLATE_TALK
:
160 case NS_CATEGORY_TALK
:
161 $text = wfMsg('viewtalkpage');
164 $text = wfMsg( 'articlepage' );
167 $text = wfMsg( 'userpage' );
170 $text = wfMsg( 'projectpage' );
173 $text = wfMsg( 'imagepage' );
176 $text = wfMsg( 'mediawikipage' );
179 $text = wfMsg( 'templatepage' );
182 $text = wfMsg( 'viewhelppage' );
185 $text = wfMsg( 'categorypage' );
188 $text = wfMsg( 'articlepage' );
191 $link = $title->getText();
192 $nstext = $wgContLang->getNsText( $tns );
193 if( $nstext ) { # add namespace if necessary
194 $link = $nstext . ':' . $link;
197 $s .= Linker
::link( Title
::newFromText( $link ), $text );
198 } elseif( $title->getNamespace() != NS_SPECIAL
) {
199 # we just throw in a "New page" text to tell the user that he's in edit mode,
200 # and to avoid messing with the separator that is prepended to the next item
201 $s .= '<strong>' . wfMsg( 'newpage' ) . '</strong>';
205 # "Post a comment" link
206 if( ( $title->isTalkPage() ||
$this->getSkin()->getOutput()->showNewSectionLink() ) && $action != 'edit' && !$wpPreview )
207 $s .= '<br />' . Linker
::link(
209 wfMsg( 'postcomment' ),
218 watching could cause problems in edit mode:
219 if user edits article, then loads "watch this article" in background and then saves
220 article with "Watch this article" checkbox disabled, the article is transparently
221 unwatched. Therefore we do not show the "Watch this page" link in edit mode
223 if ( $this->data
['loggedin'] && $articleExists ) {
224 if( $action != 'edit' && $action != 'submit' ) {
225 $s .= $sep . $this->watchThisPage();
227 if ( $title->userCan( 'edit' ) )
228 $s .= $sep . $this->moveThisPage();
230 if ( $this->getSkin()->getUser()->isAllowed( 'delete' ) && $articleExists ) {
231 $s .= $sep . $this->deleteThisPage() .
232 $sep . $this->protectThisPage();
234 $s .= $sep . $this->talkLink();
235 if( $articleExists && $action != 'history' ) {
236 $s .= $sep . $this->historyLink();
238 $s .= $sep . $this->whatLinksHere();
240 if( $this->getSkin()->getOutput()->isArticleRelated() ) {
241 $s .= $sep . $this->watchPageLinksLink();
245 NS_USER
== $title->getNamespace() ||
246 $title->getNamespace() == NS_USER_TALK
249 $id = User
::idFromName( $title->getText() );
250 $ip = User
::isIP( $title->getText() );
253 $s .= $sep . $this->userContribsLink();
255 if( $this->getSkin()->showEmailUser( $id ) ) {
256 $s .= $sep . $this->emailUserLink();
259 $s .= "\n<br /><hr class='sep' />";
262 if( UploadBase
::isEnabled() && UploadBase
::isAllowed( $this->getSkin()->getUser() ) === true ) {
263 $s .= $this->getUploadLink() . $sep;
266 $s .= Linker
::specialLink( 'Specialpages' );
268 global $wgSiteSupportPage;
269 if( $wgSiteSupportPage ) {
270 $s .= "\n<br /><a href=\"" . htmlspecialchars( $wgSiteSupportPage ) .
271 '" class="internal">' . wfMsg( 'sitesupport' ) . '</a>';
274 $s .= "\n<br /></div>\n";
275 wfProfileOut( __METHOD__
);