00001 <?php
00010 if( !defined( 'MEDIAWIKI' ) ) {
00011 die( -1 );
00012 }
00013
00018 class SkinCologneBlue extends Skin {
00019
00020 function getStylesheet() {
00021 return 'common/cologneblue.css';
00022 }
00023
00024 function getSkinName() {
00025 return 'cologneblue';
00026 }
00027
00028 function doBeforeContent() {
00029 $qb = $this->qbSetting();
00030 $mainPageObj = Title::newMainPage();
00031
00032 $s = "\n<div id='content'>\n<div id='topbar'>" .
00033 '<table width="100%" border="0" cellspacing="0" cellpadding="8"><tr>';
00034
00035 $s .= '<td class="top" align="left" valign="middle" nowrap="nowrap">';
00036 $s .= '<a href="' . $mainPageObj->escapeLocalURL() . '">';
00037 $s .= '<span id="sitetitle">' . wfMsg( 'sitetitle' ) . '</span></a>';
00038
00039 $s .= '</td><td class="top" align="right" valign="bottom" width="100%">';
00040 $s .= $this->sysLinks();
00041 $s .= '</td></tr><tr><td valign="top">';
00042
00043 $s .= '<font size="-1"><span id="sitesub">';
00044 $s .= htmlspecialchars( wfMsg( 'sitesubtitle' ) ) . '</span></font>';
00045 $s .= '</td><td align="right">';
00046
00047 $s .= '<font size="-1"><span id="langlinks">';
00048 $s .= str_replace( '<br />', '', $this->otherLanguages() );
00049 $cat = $this->getCategoryLinks();
00050 if( $cat ) {
00051 $s .= "<br />$cat\n";
00052 }
00053 $s .= '<br />' . $this->pageTitleLinks();
00054 $s .= '</span></font>';
00055
00056 $s .= "</td></tr></table>\n";
00057
00058 $s .= "\n</div>\n<div id='article'>";
00059
00060 $notice = wfGetSiteNotice();
00061 if( $notice ) {
00062 $s .= "\n<div id='siteNotice'>$notice</div>\n";
00063 }
00064 $s .= $this->pageTitle();
00065 $s .= $this->pageSubtitle() . "\n";
00066 return $s;
00067 }
00068
00069 function doAfterContent(){
00070 global $wgLang;
00071
00072 $s = "\n</div><br clear='all' />\n";
00073
00074 $s .= "\n<div id='footer'>";
00075 $s .= '<table width="98%" border="0" cellspacing="0"><tr>';
00076
00077 $qb = $this->qbSetting();
00078 if ( 1 == $qb || 3 == $qb ) { # Left
00079 $s .= $this->getQuickbarCompensator();
00080 }
00081 $s .= '<td class="bottom" align="center" valign="top">';
00082
00083 $s .= $this->bottomLinks();
00084 $s .= $wgLang->pipeList( array(
00085 "\n<br />" . $this->link(
00086 Title::newMainPage(),
00087 null,
00088 array(),
00089 array(),
00090 array( 'known', 'noclasses' )
00091 ),
00092 $this->aboutLink(),
00093 $this->searchForm( wfMsg( 'qbfind' ) )
00094 ) );
00095
00096 $s .= "\n<br />" . $this->pageStats();
00097
00098 $s .= '</td>';
00099 if ( 2 == $qb ) { # Right
00100 $s .= $this->getQuickbarCompensator();
00101 }
00102 $s .= "</tr></table>\n</div>\n</div>\n";
00103
00104 if ( 0 != $qb ) {
00105 $s .= $this->quickBar();
00106 }
00107 return $s;
00108 }
00109
00110 function reallyGenerateUserStylesheet() {
00111 $s = parent::reallyGenerateUserStylesheet();
00112 $qb = $this->qbSetting();
00113
00114 if ( 2 == $qb ) { # Right
00115 $s .= "#quickbar { position: absolute; right: 4px; }\n" .
00116 "#article { margin-left: 4px; margin-right: 148px; }\n";
00117 } elseif ( 1 == $qb ) {
00118 $s .= "#quickbar { position: absolute; left: 4px; }\n" .
00119 "#article { margin-left: 148px; margin-right: 4px; }\n";
00120 } elseif ( 3 == $qb ) { # Floating left
00121 $s .= "#quickbar { position:absolute; left:4px } \n" .
00122 "#topbar { margin-left: 148px }\n" .
00123 "#article { margin-left:148px; margin-right: 4px; } \n" .
00124 "body>#quickbar { position:fixed; left:4px; top:4px; overflow:auto ;bottom:4px;} \n"; # Hides from IE
00125 } elseif ( 4 == $qb ) { # Floating right
00126 $s .= "#quickbar { position: fixed; right: 4px; } \n" .
00127 "#topbar { margin-right: 148px }\n" .
00128 "#article { margin-right: 148px; margin-left: 4px; } \n" .
00129 "body>#quickbar { position: fixed; right: 4px; top: 4px; overflow: auto ;bottom:4px;} \n"; # Hides from IE
00130 }
00131 return $s;
00132 }
00133
00134 function sysLinks() {
00135 global $wgUser, $wgLang, $wgContLang;
00136 $li = SpecialPage::getTitleFor( 'Userlogin' );
00137 $lo = SpecialPage::getTitleFor( 'Userlogout' );
00138
00139 $rt = $this->mTitle->getPrefixedURL();
00140 if ( 0 == strcasecmp( urlencode( $lo ), $rt ) ) {
00141 $q = array();
00142 } else {
00143 $q = array( 'returnto' => $rt );
00144 }
00145
00146 $s = array(
00147 $this->mainPageLink(),
00148 $this->linkKnown(
00149 Title::newFromText( wfMsgForContent( 'aboutpage' ) ),
00150 wfMsg( 'about' )
00151 ),
00152 $this->linkKnown(
00153 Title::newFromText( wfMsgForContent( 'helppage' ) ),
00154 wfMsg( 'help' )
00155 ),
00156 $this->linkKnown(
00157 Title::newFromText( wfMsgForContent( 'faqpage' ) ),
00158 wfMsg( 'faq' )
00159 ),
00160 $this->specialLink( 'specialpages' )
00161 );
00162
00163
00164 if( $this->variantLinks() ) {
00165 $s[] = $this->variantLinks();
00166 }
00167 if( $this->extensionTabLinks() ) {
00168 $s[] = $this->extensionTabLinks();
00169 }
00170 if ( $wgUser->isLoggedIn() ) {
00171 $s[] = $this->linkKnown(
00172 $lo,
00173 wfMsg( 'logout' ),
00174 array(),
00175 $q
00176 );
00177 } else {
00178 $s[] = $this->linkKnown(
00179 $li,
00180 wfMsg( 'login' ),
00181 array(),
00182 $q
00183 );
00184 }
00185
00186 return $wgLang->pipeList( $s );
00187 }
00188
00193 function quickBar(){
00194 global $wgOut, $wgUser, $wgEnableUploads;
00195
00196 $tns = $this->mTitle->getNamespace();
00197
00198 $s = "\n<div id='quickbar'>";
00199
00200 $sep = '<br />';
00201 $s .= $this->menuHead( 'qbfind' );
00202 $s .= $this->searchForm();
00203
00204 $s .= $this->menuHead( 'qbbrowse' );
00205
00206 # Use the first heading from the Monobook sidebar as the "browse" section
00207 $bar = $this->buildSidebar();
00208 unset( $bar['SEARCH'] );
00209 unset( $bar['LANGUAGES'] );
00210 unset( $bar['TOOLBOX'] );
00211 $browseLinks = reset( $bar );
00212
00213 foreach ( $browseLinks as $link ) {
00214 if ( $link['text'] != '-' ) {
00215 $s .= "<a href=\"{$link['href']}\">" .
00216 htmlspecialchars( $link['text'] ) . '</a>' . $sep;
00217 }
00218 }
00219
00220 if ( $wgOut->isArticle() ) {
00221 $s .= $this->menuHead( 'qbedit' );
00222 $s .= '<strong>' . $this->editThisPage() . '</strong>';
00223
00224 $s .= $sep . $this->linkKnown(
00225 Title::newFromText( wfMsgForContent( 'edithelppage' ) ),
00226 wfMsg( 'edithelp' )
00227 );
00228
00229 if( $wgUser->isLoggedIn() ) {
00230 $s .= $sep . $this->moveThisPage();
00231 }
00232 if ( $wgUser->isAllowed( 'delete' ) ) {
00233 $dtp = $this->deleteThisPage();
00234 if ( $dtp != '' ) {
00235 $s .= $sep . $dtp;
00236 }
00237 }
00238 if ( $wgUser->isAllowed( 'protect' ) ) {
00239 $ptp = $this->protectThisPage();
00240 if ( $ptp != '' ) {
00241 $s .= $sep . $ptp;
00242 }
00243 }
00244 $s .= $sep;
00245
00246 $s .= $this->menuHead( 'qbpageoptions' );
00247 $s .= $this->talkLink()
00248 . $sep . $this->commentLink()
00249 . $sep . $this->printableLink();
00250 if ( $wgUser->isLoggedIn() ) {
00251 $s .= $sep . $this->watchThisPage();
00252 }
00253
00254 $s .= $sep;
00255
00256 $s .= $this->menuHead( 'qbpageinfo' )
00257 . $this->historyLink()
00258 . $sep . $this->whatLinksHere()
00259 . $sep . $this->watchPageLinksLink();
00260
00261 if( $tns == NS_USER || $tns == NS_USER_TALK ) {
00262 $id = User::idFromName( $this->mTitle->getText() );
00263 if( $id != 0 ) {
00264 $s .= $sep . $this->userContribsLink();
00265 if( $this->showEmailUser( $id ) ) {
00266 $s .= $sep . $this->emailUserLink();
00267 }
00268 }
00269 }
00270 $s .= $sep;
00271 }
00272
00273 $s .= $this->menuHead( 'qbmyoptions' );
00274 if ( $wgUser->isLoggedIn() ) {
00275 $name = $wgUser->getName();
00276 $tl = $this->link(
00277 $wgUser->getTalkPage(),
00278 wfMsg( 'mytalk' ),
00279 array(),
00280 array(),
00281 array( 'known', 'noclasses' )
00282 );
00283 if ( $wgUser->getNewtalk() ) {
00284 $tl .= ' *';
00285 }
00286
00287 $s .= $this->link(
00288 $wgUser->getUserPage(),
00289 wfMsg( 'mypage' ),
00290 array(),
00291 array(),
00292 array( 'known', 'noclasses' )
00293 ) . $sep . $tl . $sep . $this->specialLink( 'watchlist' )
00294 . $sep .
00295 $this->link(
00296 SpecialPage::getSafeTitleFor( 'Contributions', $wgUser->getName() ),
00297 wfMsg( 'mycontris' ),
00298 array(),
00299 array(),
00300 array( 'known', 'noclasses' )
00301 ) . $sep . $this->specialLink( 'preferences' )
00302 . $sep . $this->specialLink( 'userlogout' );
00303 } else {
00304 $s .= $this->specialLink( 'userlogin' );
00305 }
00306
00307 $s .= $this->menuHead( 'qbspecialpages' )
00308 . $this->specialLink( 'newpages' )
00309 . $sep . $this->specialLink( 'listfiles' )
00310 . $sep . $this->specialLink( 'statistics' );
00311 if ( $wgUser->isLoggedIn() && $wgEnableUploads ) {
00312 $s .= $sep . $this->specialLink( 'upload' );
00313 }
00314
00315 global $wgSiteSupportPage;
00316
00317 if( $wgSiteSupportPage ) {
00318 $s .= $sep . '<a href="' . htmlspecialchars( $wgSiteSupportPage ) . '" class="internal">'
00319 . wfMsg( 'sitesupport' ) . '</a>';
00320 }
00321
00322 $s .= $sep . $this->link(
00323 SpecialPage::getTitleFor( 'Specialpages' ),
00324 wfMsg( 'moredotdotdot' ),
00325 array(),
00326 array(),
00327 array( 'known', 'noclasses' )
00328 );
00329
00330 $s .= $sep . "\n</div>\n";
00331 return $s;
00332 }
00333
00334 function menuHead( $key ) {
00335 $s = "\n<h6>" . wfMsg( $key ) . "</h6>";
00336 return $s;
00337 }
00338
00339 function searchForm( $label = '' ) {
00340 global $wgRequest, $wgUseTwoButtonsSearchForm;
00341
00342 $search = $wgRequest->getText( 'search' );
00343 $action = $this->escapeSearchLink();
00344 $s = "<form id=\"searchform{$this->searchboxes}\" method=\"get\" class=\"inline\" action=\"$action\">";
00345 if( $label != '' ) {
00346 $s .= "{$label}: ";
00347 }
00348
00349 $s .= "<input type='text' id=\"searchInput{$this->searchboxes}\" class=\"mw-searchInput\" name=\"search\" size=\"14\" value=\""
00350 . htmlspecialchars( substr( $search, 0, 256 ) ) . "\" /><br />"
00351 . "<input type='submit' id=\"searchGoButton{$this->searchboxes}\" class=\"searchButton\" name=\"go\" value=\"" . htmlspecialchars( wfMsg( 'searcharticle' ) ) . "\" />";
00352
00353 if( $wgUseTwoButtonsSearchForm ) {
00354 $s .= "<input type='submit' id=\"mw-searchButton{$this->searchboxes}\" class=\"searchButton\" name=\"fulltext\" value=\"" . htmlspecialchars( wfMsg( 'search' ) ) . "\" />\n";
00355 } else {
00356 $s .= '<div><a href="' . $action . '" rel="search">' . wfMsg( 'powersearch-legend' ) . "</a></div>\n";
00357 }
00358
00359 $s .= '</form>';
00360
00361
00362 $this->searchboxes = $this->searchboxes == '' ? 2 : $this->searchboxes + 1;
00363
00364 return $s;
00365 }
00366 }