15 class SkinStandard
extends Skin
{
20 function getHeadScripts() {
23 $s = parent
::getHeadScripts();
24 if ( 3 == $this->qbSetting() ) { # Floating left
25 $s .= "<script language='javascript' type='text/javascript' " .
26 "src='{$wgStylePath}/common/sticky.js'></script>\n";
34 function getUserStyles() {
37 if ( 3 == $this->qbSetting() ) { # Floating left
38 $s .= "<style type='text/css'>\n" .
39 "@import '{$wgStylePath}/common/quickbar.css';\n</style>\n";
41 $s .= parent
::getUserStyles();
48 function doGetUserStyles() {
49 global $wgUser, $wgOut, $wgStylePath;
51 $s = parent
::doGetUserStyles();
52 $qb = $this->qbSetting();
54 if ( 2 == $qb ) { # Right
55 $s .= "#quickbar { position: absolute; top: 4px; right: 4px; " .
56 "border-left: 2px solid #000000; }\n" .
57 "#article { margin-left: 4px; margin-right: 152px; }\n";
58 } else if ( 1 == $qb ||
3 == $qb ) {
59 $s .= "#quickbar { position: absolute; top: 4px; left: 4px; " .
60 "border-right: 1px solid gray; }\n" .
61 "#article { margin-left: 152px; margin-right: 4px; }\n";
69 function getBodyOptions() {
70 $a = parent
::getBodyOptions();
72 if ( 3 == $this->qbSetting() ) { # Floating left
73 $qb = "setup(\"quickbar\")";
75 $a["onload"] .= ";$qb";
83 function doAfterContent() {
84 global $wgUser, $wgOut, $wgContLang;
85 $fname = 'SkinStandard::doAfterContent';
86 wfProfileIn( $fname );
87 wfProfileIn( $fname.'-1' );
89 $s = "\n</div><br style=\"clear:both\" />\n";
90 $s .= "\n<div id='footer'>";
91 $s .= '<table border="0" cellspacing="0"><tr>';
93 wfProfileOut( $fname.'-1' );
94 wfProfileIn( $fname.'-2' );
96 $qb = $this->qbSetting();
98 $left = ($qb == 1 ||
$qb == 3);
99 if($wgContLang->isRTL()) $left = !$left;
101 if ( $shove && $left ) { # Left
102 $s .= $this->getQuickbarCompensator();
104 wfProfileOut( $fname.'-2' );
105 wfProfileIn( $fname.'-3' );
106 $l = $wgContLang->isRTL() ?
'right' : 'left';
107 $s .= "<td class='bottom' align='$l' valign='top'>";
109 $s .= $this->bottomLinks();
110 $s .= "\n<br />" . $this->mainPageLink()
111 . ' | ' . $this->aboutLink()
112 . ' | ' . $this->specialLink( 'recentchanges' )
113 . ' | ' . $this->searchForm()
114 . '<br /><span id="pagestats">' . $this->pageStats() . '</span>';
117 if ( $shove && !$left ) { # Right
118 $s .= $this->getQuickbarCompensator();
120 $s .= "</tr></table>\n</div>\n</div>\n";
122 wfProfileOut( $fname.'-3' );
123 wfProfileIn( $fname.'-4' );
124 if ( 0 != $qb ) { $s .= $this->quickBar(); }
125 wfProfileOut( $fname.'-4' );
126 wfProfileOut( $fname );
130 function quickBar() {
131 global $wgOut, $wgTitle, $wgUser, $wgRequest, $wgContLang;
132 global $wgDisableUploads, $wgRemoteUploads, $wgNavigationLinks;
134 $fname = 'Skin::quickBar';
135 wfProfileIn( $fname );
137 $action = $wgRequest->getText( 'action' );
138 $wpPreview = $wgRequest->getBool( 'wpPreview' );
139 $tns=$wgTitle->getNamespace();
141 $s = "\n<div id='quickbar'>";
142 $s .= "\n" . $this->logoText() . "\n<hr class='sep' />";
146 foreach ( $wgNavigationLinks as $link ) {
147 $msg = wfMsgForContent( $link['href'] );
149 $s .= '<a href="' . $this->makeInternalOrExternalUrl( $msg ) . '">' .
150 wfMsg( $link['text'] ) . '</a>' . $sep;
155 if ($wgUser->getID()) {
156 $s.= $this->specialLink( 'watchlist' ) ;
157 $s .= $sep . $this->makeKnownLink( $wgContLang->specialPage( 'Contributions' ),
158 wfMsg( 'mycontris' ), 'target=' . wfUrlencode($wgUser->getName() ) );
160 // only show watchlist link if logged in
161 $s .= "\n<hr class='sep' />";
162 $articleExists = $wgTitle->getArticleId();
163 if ( $wgOut->isArticle() ||
$action =='edit' ||
$action =='history' ||
$wpPreview) {
164 if($wgOut->isArticle()) {
165 $s .= '<strong>' . $this->editThisPage() . '</strong>';
166 } else { # backlink to the article in edit or history mode
167 if($articleExists){ # no backlink if no article
170 $text = wfMsg('articlepage');
173 $text = wfMsg('viewtalkpage');
176 $text = wfMsg('userpage');
179 $text = wfMsg('viewtalkpage');
182 $text = wfMsg('wikipediapage');
185 $text = wfMsg('viewtalkpage');
188 $text = wfMsg('imagepage');
191 $text = wfMsg('viewtalkpage');
194 $text= wfMsg('articlepage');
197 $link = $wgTitle->getText();
198 if ($nstext = $wgContLang->getNsText($tns) ) { # add namespace if necessary
199 $link = $nstext . ':' . $link ;
202 $s .= $this->makeLink( $link, $text );
203 } elseif( $wgTitle->getNamespace() != Namespace::getSpecial() ) {
204 # we just throw in a "New page" text to tell the user that he's in edit mode,
205 # and to avoid messing with the separator that is prepended to the next item
206 $s .= '<strong>' . wfMsg('newpage') . '</strong>';
212 if( $tns%2
&& $action!='edit' && !$wpPreview) {
213 $s.= '<br />'.$this->makeKnownLink($wgTitle->getPrefixedText(),wfMsg('postcomment'),'action=edit§ion=new');
217 watching could cause problems in edit mode:
218 if user edits article, then loads "watch this article" in background and then saves
219 article with "Watch this article" checkbox disabled, the article is transparently
220 unwatched. Therefore we do not show the "Watch this page" link in edit mode
222 if ( 0 != $wgUser->getID() && $articleExists) {
223 if($action!='edit' && $action != 'submit' )
225 $s .= $sep . $this->watchThisPage();
227 if ( $wgTitle->userCanEdit() )
228 $s .= $sep . $this->moveThisPage();
230 if ( $wgUser->isAllowed('delete') and $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($wgOut->isArticleRelated()) {
241 $s .= $sep . $this->watchPageLinksLink();
244 if ( Namespace::getUser() == $wgTitle->getNamespace()
245 ||
$wgTitle->getNamespace() == Namespace::getTalk(Namespace::getUser())
248 $id=User
::idFromName($wgTitle->getText());
249 $ip=User
::isIP($wgTitle->getText());
252 $s .= $sep . $this->userContribsLink();
254 if ( 0 != $wgUser->getID() ) {
255 if($id) { # can only email real users
256 $s .= $sep . $this->emailUserLink();
260 $s .= "\n<br /><hr class='sep' />";
263 if ( 0 != $wgUser->getID() && ( !$wgDisableUploads ||
$wgRemoteUploads ) ) {
264 $s .= $this->specialLink( 'upload' ) . $sep;
266 $s .= $this->specialLink( 'specialpages' )
267 . $sep . $this->bugReportsLink();
269 global $wgSiteSupportPage;
270 if( $wgSiteSupportPage ) {
271 $s .= "\n<br /><a href=\"" . htmlspecialchars( $wgSiteSupportPage ) .
272 '" class="internal">' . wfMsg( 'sitesupport' ) . '</a>';
275 $s .= "\n<br /></div>\n";
276 wfProfileOut( $fname );