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