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 $tns = $this->getSkin()->getTitle()->getNamespace();
116 $s = "\n<div id='quickbar'>";
117 $s .= "\n" . $this->getSkin()->logoText() . "\n<hr class='sep' />";
121 # Use the first heading from the Monobook sidebar as the "browse" section
122 $bar = $this->getSkin()->buildSidebar();
123 unset( $bar['SEARCH'] );
124 unset( $bar['LANGUAGES'] );
125 unset( $bar['TOOLBOX'] );
128 foreach ( $bar as $browseLinks ) {
129 if ( $barnumber > 1 ) {
130 $s .= "\n<hr class='sep' />";
132 foreach ( $browseLinks as $link ) {
133 if ( $link['text'] != '-' ) {
134 $s .= "<a href=\"{$link['href']}\">" .
135 htmlspecialchars( $link['text'] ) . '</a>' . $sep;
138 if ( $barnumber == 1 ) {
139 // only show watchlist link if logged in
140 if( $wgUser->isLoggedIn() ) {
141 $s.= Linker
::specialLink( 'Watchlist' ) ;
142 $s .= $sep . Linker
::linkKnown(
143 SpecialPage
::getTitleFor( 'Contributions' ),
144 wfMsg( 'mycontris' ),
146 array( 'target' => $wgUser->getName() )
150 $barnumber = $barnumber +
1;
153 $s .= "\n<hr class='sep' />";
154 $articleExists = $this->getSkin()->getTitle()->getArticleId();
155 if ( $wgOut->isArticle() ||
$action == 'edit' ||
$action == 'history' ||
$wpPreview ) {
156 if( $wgOut->isArticle() ) {
157 $s .= '<strong>' . $this->editThisPage() . '</strong>';
158 } else { # backlink to the article in edit or history mode
159 if( $articleExists ){ # no backlink if no article
163 case NS_PROJECT_TALK
:
165 case NS_MEDIAWIKI_TALK
:
166 case NS_TEMPLATE_TALK
:
168 case NS_CATEGORY_TALK
:
169 $text = wfMsg('viewtalkpage');
172 $text = wfMsg( 'articlepage' );
175 $text = wfMsg( 'userpage' );
178 $text = wfMsg( 'projectpage' );
181 $text = wfMsg( 'imagepage' );
184 $text = wfMsg( 'mediawikipage' );
187 $text = wfMsg( 'templatepage' );
190 $text = wfMsg( 'viewhelppage' );
193 $text = wfMsg( 'categorypage' );
196 $text = wfMsg( 'articlepage' );
199 $link = $this->getSkin()->getTitle()->getText();
200 $nstext = $wgContLang->getNsText( $tns );
201 if( $nstext ) { # add namespace if necessary
202 $link = $nstext . ':' . $link;
205 $s .= Linker
::link( Title
::newFromText( $link ), $text );
206 } elseif( $this->getSkin()->getTitle()->getNamespace() != NS_SPECIAL
) {
207 # we just throw in a "New page" text to tell the user that he's in edit mode,
208 # and to avoid messing with the separator that is prepended to the next item
209 $s .= '<strong>' . wfMsg( 'newpage' ) . '</strong>';
213 # "Post a comment" link
214 if( ( $this->getSkin()->getTitle()->isTalkPage() ||
$wgOut->showNewSectionLink() ) && $action != 'edit' && !$wpPreview )
215 $s .= '<br />' . $this->getSkin()->link(
216 $this->getSkin()->getTitle(),
217 wfMsg( 'postcomment' ),
223 array( 'known', 'noclasses' )
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 ( $this->getSkin()->getTitle()->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
== $this->getSkin()->getTitle()->getNamespace() ||
255 $this->getSkin()->getTitle()->getNamespace() == NS_USER_TALK
258 $id = User
::idFromName( $this->getSkin()->getTitle()->getText() );
259 $ip = User
::isIP( $this->getSkin()->getTitle()->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__
);