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';
21 function setupSkinUserCss( OutputPage
$out ){
22 parent
::setupSkinUserCss( $out );
23 $out->AddModuleStyles( 'skins.standard' );
26 $qb = $this->qbSetting();
29 if ( 2 == $qb ) { # Right
30 $rules[] = "#quickbar { position: absolute; top: 4px; right: 4px; border-left: 2px solid #000000; }";
31 $rules[] = "#article, #mw-data-after-content { margin-left: 4px; margin-right: 152px; }";
32 } elseif ( 1 == $qb ||
3 == $qb ) {
33 $rules[] = "#quickbar { position: absolute; top: 4px; left: 4px; border-right: 1px solid gray; }";
34 $rules[] = "#article, #mw-data-after-content { margin-left: 152px; margin-right: 4px; }";
36 $rules[] = "#quickbar { position: fixed; padding: 4px; }";
38 } elseif ( 4 == $qb ) {
39 $rules[] = "#quickbar { position: fixed; right: 0px; top: 0px; padding: 4px;}";
40 $rules[] = "#quickbar { border-right: 1px solid gray; }";
41 $rules[] = "#article, #mw-data-after-content { margin-right: 152px; margin-left: 4px; }";
43 $style = implode( "\n", $rules );
44 if ( $wgContLang->getDir() === 'rtl' ) {
45 $style = CSSJanus
::transform( $style, true, false );
47 $out->addInlineStyle( $style );
52 class StandardTemplate
extends LegacyTemplate
{
54 function doAfterContent() {
55 global $wgContLang, $wgLang;
56 wfProfileIn( __METHOD__
);
57 wfProfileIn( __METHOD__
. '-1' );
59 $s = "\n</div><br style=\"clear:both\" />\n";
60 $s .= "\n<div id='footer'>";
61 $s .= '<table border="0" cellspacing="0"><tr>';
63 wfProfileOut( __METHOD__
. '-1' );
64 wfProfileIn( __METHOD__
. '-2' );
66 $qb = $this->getSkin()->qbSetting();
67 $shove = ( $qb != 0 );
68 $left = ( $qb == 1 ||
$qb == 3 );
70 if ( $shove && $left ) { # Left
71 $s .= $this->getQuickbarCompensator();
73 wfProfileOut( __METHOD__
. '-2' );
74 wfProfileIn( __METHOD__
. '-3' );
75 $l = $wgContLang->alignStart();
76 $s .= "<td class='bottom' align='$l' valign='top'>";
78 $s .= $this->bottomLinks();
79 $s .= "\n<br />" . $wgLang->pipeList( array(
80 $this->getSkin()->mainPageLink(),
81 $this->getSkin()->aboutLink(),
82 Linker
::specialLink( 'Recentchanges' ),
83 $this->searchForm() ) )
84 . '<br /><span id="pagestats">' . $this->pageStats() . '</span>';
87 if ( $shove && !$left ) { # Right
88 $s .= $this->getQuickbarCompensator();
90 $s .= "</tr></table>\n</div>\n</div>\n";
92 wfProfileOut( __METHOD__
. '-3' );
93 wfProfileIn( __METHOD__
. '-4' );
95 $s .= $this->quickBar();
97 wfProfileOut( __METHOD__
. '-4' );
98 wfProfileOut( __METHOD__
);
102 function quickBar() {
103 global $wgOut, $wgUser, $wgRequest, $wgContLang;
105 wfProfileIn( __METHOD__
);
107 $action = $wgRequest->getText( 'action' );
108 $wpPreview = $wgRequest->getBool( 'wpPreview' );
109 $tns = $this->getSkin()->getTitle()->getNamespace();
111 $s = "\n<div id='quickbar'>";
112 $s .= "\n" . $this->getSkin()->logoText() . "\n<hr class='sep' />";
116 # Use the first heading from the Monobook sidebar as the "browse" section
117 $bar = $this->getSkin()->buildSidebar();
118 unset( $bar['SEARCH'] );
119 unset( $bar['LANGUAGES'] );
120 unset( $bar['TOOLBOX'] );
123 foreach ( $bar as $heading => $browseLinks ) {
124 if ( $barnumber > 1 ) {
125 $s .= "\n<hr class='sep' />";
127 foreach ( $browseLinks as $link ) {
128 if ( $link['text'] != '-' ) {
129 $s .= "<a href=\"{$link['href']}\">" .
130 htmlspecialchars( $link['text'] ) . '</a>' . $sep;
133 if ( $barnumber == 1 ) {
134 // only show watchlist link if logged in
135 if( $wgUser->isLoggedIn() ) {
136 $s.= Linker
::specialLink( 'Watchlist' ) ;
137 $s .= $sep . Linker
::linkKnown(
138 SpecialPage
::getTitleFor( 'Contributions' ),
139 wfMsg( 'mycontris' ),
141 array( 'target' => $wgUser->getName() )
145 $barnumber = $barnumber +
1;
148 $s .= "\n<hr class='sep' />";
149 $articleExists = $this->getSkin()->getTitle()->getArticleId();
150 if ( $wgOut->isArticle() ||
$action == 'edit' ||
$action == 'history' ||
$wpPreview ) {
151 if( $wgOut->isArticle() ) {
152 $s .= '<strong>' . $this->editThisPage() . '</strong>';
153 } else { # backlink to the article in edit or history mode
154 if( $articleExists ){ # no backlink if no article
158 case NS_PROJECT_TALK
:
160 case NS_MEDIAWIKI_TALK
:
161 case NS_TEMPLATE_TALK
:
163 case NS_CATEGORY_TALK
:
164 $text = wfMsg('viewtalkpage');
167 $text = wfMsg( 'articlepage' );
170 $text = wfMsg( 'userpage' );
173 $text = wfMsg( 'projectpage' );
176 $text = wfMsg( 'imagepage' );
179 $text = wfMsg( 'mediawikipage' );
182 $text = wfMsg( 'templatepage' );
185 $text = wfMsg( 'viewhelppage' );
188 $text = wfMsg( 'categorypage' );
191 $text = wfMsg( 'articlepage' );
194 $link = $this->getSkin()->getTitle()->getText();
195 $nstext = $wgContLang->getNsText( $tns );
196 if( $nstext ) { # add namespace if necessary
197 $link = $nstext . ':' . $link;
200 $s .= Linker
::link( Title
::newFromText( $link ), $text );
201 } elseif( $this->getSkin()->getTitle()->getNamespace() != NS_SPECIAL
) {
202 # we just throw in a "New page" text to tell the user that he's in edit mode,
203 # and to avoid messing with the separator that is prepended to the next item
204 $s .= '<strong>' . wfMsg( 'newpage' ) . '</strong>';
208 # "Post a comment" link
209 if( ( $this->getSkin()->getTitle()->isTalkPage() ||
$wgOut->showNewSectionLink() ) && $action != 'edit' && !$wpPreview )
210 $s .= '<br />' . $this->getSkin()->link(
211 $this->getSkin()->getTitle(),
212 wfMsg( 'postcomment' ),
218 array( 'known', 'noclasses' )
222 watching could cause problems in edit mode:
223 if user edits article, then loads "watch this article" in background and then saves
224 article with "Watch this article" checkbox disabled, the article is transparently
225 unwatched. Therefore we do not show the "Watch this page" link in edit mode
227 if ( $wgUser->isLoggedIn() && $articleExists ) {
228 if( $action != 'edit' && $action != 'submit' ) {
229 $s .= $sep . $this->watchThisPage();
231 if ( $this->getSkin()->getTitle()->userCan( 'edit' ) )
232 $s .= $sep . $this->moveThisPage();
234 if ( $wgUser->isAllowed( 'delete' ) && $articleExists ) {
235 $s .= $sep . $this->deleteThisPage() .
236 $sep . $this->protectThisPage();
238 $s .= $sep . $this->talkLink();
239 if( $articleExists && $action != 'history' ) {
240 $s .= $sep . $this->historyLink();
242 $s .= $sep . $this->whatLinksHere();
244 if( $wgOut->isArticleRelated() ) {
245 $s .= $sep . $this->watchPageLinksLink();
249 NS_USER
== $this->getSkin()->getTitle()->getNamespace() ||
250 $this->getSkin()->getTitle()->getNamespace() == NS_USER_TALK
253 $id = User
::idFromName( $this->getSkin()->getTitle()->getText() );
254 $ip = User
::isIP( $this->getSkin()->getTitle()->getText() );
257 $s .= $sep . $this->userContribsLink();
259 if( $this->getSkin()->showEmailUser( $id ) ) {
260 $s .= $sep . $this->emailUserLink();
263 $s .= "\n<br /><hr class='sep' />";
266 if( UploadBase
::isEnabled() && UploadBase
::isAllowed( $wgUser ) === true ) {
267 $s .= $this->getUploadLink() . $sep;
270 $s .= Linker
::specialLink( 'Specialpages' );
272 global $wgSiteSupportPage;
273 if( $wgSiteSupportPage ) {
274 $s .= "\n<br /><a href=\"" . htmlspecialchars( $wgSiteSupportPage ) .
275 '" class="internal">' . wfMsg( 'sitesupport' ) . '</a>';
278 $s .= "\n<br /></div>\n";
279 wfProfileOut( __METHOD__
);