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 ( $barnumber > 1 ) {
120 $s .= "\n<hr class='sep' />";
122 foreach ( $browseLinks as $link ) {
123 if ( $link['text'] != '-' ) {
124 $s .= "<a href=\"{$link['href']}\">" .
125 htmlspecialchars( $link['text'] ) . '</a>' . $sep;
128 if ( $barnumber == 1 ) {
129 // only show watchlist link if logged in
130 if( $this->data
['loggedin'] ) {
131 $s.= Linker
::specialLink( 'Watchlist' ) ;
132 $s .= $sep . Linker
::linkKnown(
133 SpecialPage
::getTitleFor( 'Contributions' ),
134 wfMsg( 'mycontris' ),
136 array( 'target' => $this->data
['username'] )
140 $barnumber = $barnumber +
1;
143 $s .= "\n<hr class='sep' />";
144 $articleExists = $title->getArticleId();
145 if ( $this->data
['isarticle'] ||
$action == 'edit' ||
$action == 'history' ||
$wpPreview ) {
146 if( $this->data
['isarticle'] ) {
147 $s .= '<strong>' . $this->editThisPage() . '</strong>';
148 } else { # backlink to the article in edit or history mode
149 if( $articleExists ){ # no backlink if no article
153 case NS_PROJECT_TALK
:
155 case NS_MEDIAWIKI_TALK
:
156 case NS_TEMPLATE_TALK
:
158 case NS_CATEGORY_TALK
:
159 $text = wfMsg('viewtalkpage');
162 $text = wfMsg( 'articlepage' );
165 $text = wfMsg( 'userpage' );
168 $text = wfMsg( 'projectpage' );
171 $text = wfMsg( 'imagepage' );
174 $text = wfMsg( 'mediawikipage' );
177 $text = wfMsg( 'templatepage' );
180 $text = wfMsg( 'viewhelppage' );
183 $text = wfMsg( 'categorypage' );
186 $text = wfMsg( 'articlepage' );
189 $link = $title->getText();
190 $nstext = $wgContLang->getNsText( $tns );
191 if( $nstext ) { # add namespace if necessary
192 $link = $nstext . ':' . $link;
195 $s .= Linker
::link( Title
::newFromText( $link ), $text );
196 } elseif( $title->getNamespace() != NS_SPECIAL
) {
197 # we just throw in a "New page" text to tell the user that he's in edit mode,
198 # and to avoid messing with the separator that is prepended to the next item
199 $s .= '<strong>' . wfMsg( 'newpage' ) . '</strong>';
203 # "Post a comment" link
204 if( ( $title->isTalkPage() ||
$this->getSkin()->getOutput()->showNewSectionLink() ) && $action != 'edit' && !$wpPreview )
205 $s .= '<br />' . Linker
::link(
207 wfMsg( 'postcomment' ),
216 watching could cause problems in edit mode:
217 if user edits article, then loads "watch this article" in background and then saves
218 article with "Watch this article" checkbox disabled, the article is transparently
219 unwatched. Therefore we do not show the "Watch this page" link in edit mode
221 if ( $this->data
['loggedin'] && $articleExists ) {
222 if( $action != 'edit' && $action != 'submit' ) {
223 $s .= $sep . $this->watchThisPage();
225 if ( $title->userCan( 'edit' ) )
226 $s .= $sep . $this->moveThisPage();
228 if ( $this->getSkin()->getUser()->isAllowed( 'delete' ) && $articleExists ) {
229 $s .= $sep . $this->deleteThisPage() .
230 $sep . $this->protectThisPage();
232 $s .= $sep . $this->talkLink();
233 if( $articleExists && $action != 'history' ) {
234 $s .= $sep . $this->historyLink();
236 $s .= $sep . $this->whatLinksHere();
238 if( $this->getSkin()->getOutput()->isArticleRelated() ) {
239 $s .= $sep . $this->watchPageLinksLink();
243 NS_USER
== $title->getNamespace() ||
244 $title->getNamespace() == NS_USER_TALK
247 $id = User
::idFromName( $title->getText() );
248 $ip = User
::isIP( $title->getText() );
251 $s .= $sep . $this->userContribsLink();
253 if( $this->getSkin()->showEmailUser( $id ) ) {
254 $s .= $sep . $this->emailUserLink();
257 $s .= "\n<br /><hr class='sep' />";
260 if( UploadBase
::isEnabled() && UploadBase
::isAllowed( $this->getSkin()->getUser() ) === true ) {
261 $s .= $this->getUploadLink() . $sep;
264 $s .= Linker
::specialLink( 'Specialpages' );
266 global $wgSiteSupportPage;
267 if( $wgSiteSupportPage ) {
268 $s .= "\n<br /><a href=\"" . htmlspecialchars( $wgSiteSupportPage ) .
269 '" class="internal">' . wfMsg( 'sitesupport' ) . '</a>';
272 $s .= "\n<br /></div>\n";
273 wfProfileOut( __METHOD__
);