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[] = "#quickbar { position: absolute; top: 4px; right: 4px; border-left: 2px solid #000000; }";
33 $rules[] = "#article, #mw-data-after-content { margin-left: 4px; margin-right: 152px; }";
34 } elseif ( 1 == $qb ||
3 == $qb ) {
35 $rules[] = "#quickbar { position: absolute; top: 4px; left: 4px; border-right: 1px solid gray; }";
36 $rules[] = "#article, #mw-data-after-content { margin-left: 152px; margin-right: 4px; }";
38 $rules[] = "#quickbar { position: fixed; padding: 4px; }";
40 } elseif ( 4 == $qb ) {
41 $rules[] = "#quickbar { position: fixed; right: 0px; top: 0px; padding: 4px;}";
42 $rules[] = "#quickbar { border-right: 1px solid gray; }";
43 $rules[] = "#article, #mw-data-after-content { margin-right: 152px; margin-left: 4px; }";
45 $style = implode( "\n", $rules );
46 $out->addInlineStyle( $style );
51 class StandardTemplate
extends LegacyTemplate
{
56 function doAfterContent() {
57 global $wgContLang, $wgLang;
58 wfProfileIn( __METHOD__
);
59 wfProfileIn( __METHOD__
. '-1' );
61 $s = "\n</div><br style=\"clear:both\" />\n";
62 $s .= "\n<div id='footer'>";
63 $s .= '<table border="0" cellspacing="0"><tr>';
65 wfProfileOut( __METHOD__
. '-1' );
66 wfProfileIn( __METHOD__
. '-2' );
68 $qb = $this->getSkin()->qbSetting();
69 $shove = ( $qb != 0 );
70 $left = ( $qb == 1 ||
$qb == 3 );
72 if ( $shove && $left ) { # Left
73 $s .= $this->getQuickbarCompensator();
75 wfProfileOut( __METHOD__
. '-2' );
76 wfProfileIn( __METHOD__
. '-3' );
77 $l = $wgContLang->alignStart();
78 $s .= "<td class='bottom' align='$l' valign='top'>";
80 $s .= $this->bottomLinks();
81 $s .= "\n<br />" . $wgLang->pipeList( array(
82 $this->getSkin()->mainPageLink(),
83 $this->getSkin()->aboutLink(),
84 Linker
::specialLink( 'Recentchanges' ),
85 $this->searchForm() ) )
86 . '<br /><span id="pagestats">' . $this->pageStats() . '</span>';
89 if ( $shove && !$left ) { # Right
90 $s .= $this->getQuickbarCompensator();
92 $s .= "</tr></table>\n</div>\n</div>\n";
94 wfProfileOut( __METHOD__
. '-3' );
95 wfProfileIn( __METHOD__
. '-4' );
97 $s .= $this->quickBar();
99 wfProfileOut( __METHOD__
. '-4' );
100 wfProfileOut( __METHOD__
);
107 function quickBar() {
108 global $wgOut, $wgUser, $wgRequest, $wgContLang;
110 wfProfileIn( __METHOD__
);
112 $action = $wgRequest->getText( 'action' );
113 $wpPreview = $wgRequest->getBool( 'wpPreview' );
114 $title = $this->getSkin()->getTitle();
115 $tns = $title->getNamespace();
117 $s = "\n<div id='quickbar'>";
118 $s .= "\n" . $this->getSkin()->logoText() . "\n<hr class='sep' />";
122 # Use the first heading from the Monobook sidebar as the "browse" section
123 $bar = $this->getSkin()->buildSidebar();
124 unset( $bar['SEARCH'] );
125 unset( $bar['LANGUAGES'] );
126 unset( $bar['TOOLBOX'] );
129 foreach ( $bar as $browseLinks ) {
130 if ( $barnumber > 1 ) {
131 $s .= "\n<hr class='sep' />";
133 foreach ( $browseLinks as $link ) {
134 if ( $link['text'] != '-' ) {
135 $s .= "<a href=\"{$link['href']}\">" .
136 htmlspecialchars( $link['text'] ) . '</a>' . $sep;
139 if ( $barnumber == 1 ) {
140 // only show watchlist link if logged in
141 if( $wgUser->isLoggedIn() ) {
142 $s.= Linker
::specialLink( 'Watchlist' ) ;
143 $s .= $sep . Linker
::linkKnown(
144 SpecialPage
::getTitleFor( 'Contributions' ),
145 wfMsg( 'mycontris' ),
147 array( 'target' => $wgUser->getName() )
151 $barnumber = $barnumber +
1;
154 $s .= "\n<hr class='sep' />";
155 $articleExists = $title->getArticleId();
156 if ( $wgOut->isArticle() ||
$action == 'edit' ||
$action == 'history' ||
$wpPreview ) {
157 if( $wgOut->isArticle() ) {
158 $s .= '<strong>' . $this->editThisPage() . '</strong>';
159 } else { # backlink to the article in edit or history mode
160 if( $articleExists ){ # no backlink if no article
164 case NS_PROJECT_TALK
:
166 case NS_MEDIAWIKI_TALK
:
167 case NS_TEMPLATE_TALK
:
169 case NS_CATEGORY_TALK
:
170 $text = wfMsg('viewtalkpage');
173 $text = wfMsg( 'articlepage' );
176 $text = wfMsg( 'userpage' );
179 $text = wfMsg( 'projectpage' );
182 $text = wfMsg( 'imagepage' );
185 $text = wfMsg( 'mediawikipage' );
188 $text = wfMsg( 'templatepage' );
191 $text = wfMsg( 'viewhelppage' );
194 $text = wfMsg( 'categorypage' );
197 $text = wfMsg( 'articlepage' );
200 $link = $title->getText();
201 $nstext = $wgContLang->getNsText( $tns );
202 if( $nstext ) { # add namespace if necessary
203 $link = $nstext . ':' . $link;
206 $s .= Linker
::link( Title
::newFromText( $link ), $text );
207 } elseif( $title->getNamespace() != NS_SPECIAL
) {
208 # we just throw in a "New page" text to tell the user that he's in edit mode,
209 # and to avoid messing with the separator that is prepended to the next item
210 $s .= '<strong>' . wfMsg( 'newpage' ) . '</strong>';
214 # "Post a comment" link
215 if( ( $title->isTalkPage() ||
$wgOut->showNewSectionLink() ) && $action != 'edit' && !$wpPreview )
216 $s .= '<br />' . Linker
::link(
218 wfMsg( 'postcomment' ),
227 watching could cause problems in edit mode:
228 if user edits article, then loads "watch this article" in background and then saves
229 article with "Watch this article" checkbox disabled, the article is transparently
230 unwatched. Therefore we do not show the "Watch this page" link in edit mode
232 if ( $wgUser->isLoggedIn() && $articleExists ) {
233 if( $action != 'edit' && $action != 'submit' ) {
234 $s .= $sep . $this->watchThisPage();
236 if ( $title->userCan( 'edit' ) )
237 $s .= $sep . $this->moveThisPage();
239 if ( $wgUser->isAllowed( 'delete' ) && $articleExists ) {
240 $s .= $sep . $this->deleteThisPage() .
241 $sep . $this->protectThisPage();
243 $s .= $sep . $this->talkLink();
244 if( $articleExists && $action != 'history' ) {
245 $s .= $sep . $this->historyLink();
247 $s .= $sep . $this->whatLinksHere();
249 if( $wgOut->isArticleRelated() ) {
250 $s .= $sep . $this->watchPageLinksLink();
254 NS_USER
== $title->getNamespace() ||
255 $title->getNamespace() == NS_USER_TALK
258 $id = User
::idFromName( $title->getText() );
259 $ip = User
::isIP( $title->getText() );
262 $s .= $sep . $this->userContribsLink();
264 if( $this->getSkin()->showEmailUser( $id ) ) {
265 $s .= $sep . $this->emailUserLink();
268 $s .= "\n<br /><hr class='sep' />";
271 if( UploadBase
::isEnabled() && UploadBase
::isAllowed( $wgUser ) === true ) {
272 $s .= $this->getUploadLink() . $sep;
275 $s .= Linker
::specialLink( 'Specialpages' );
277 global $wgSiteSupportPage;
278 if( $wgSiteSupportPage ) {
279 $s .= "\n<br /><a href=\"" . htmlspecialchars( $wgSiteSupportPage ) .
280 '" class="internal">' . wfMsg( 'sitesupport' ) . '</a>';
283 $s .= "\n<br /></div>\n";
284 wfProfileOut( __METHOD__
);