From 222b01f5169f1c7e69762e0e8904c24f78f71882 Mon Sep 17 00:00:00 2001 From: Pierre Schmitz Date: Wed, 28 Jul 2010 11:52:48 +0200 Subject: update to MediaWiki 1.16.0 --- skins/CologneBlue.php | 274 +++++++++++++++++++++++++++++--------------------- 1 file changed, 161 insertions(+), 113 deletions(-) (limited to 'skins/CologneBlue.php') diff --git a/skins/CologneBlue.php b/skins/CologneBlue.php index c650cbee..a7aac8a0 100644 --- a/skins/CologneBlue.php +++ b/skins/CologneBlue.php @@ -1,14 +1,15 @@ qbSetting(); $mainPageObj = Title::newMainPage(); - $s .= "\n
\n
" . - ""; + $s = "\n
\n
" . + '
'; - $s .= "
"; - $s .= "escapeLocalURL() . "\">"; - $s .= "" . wfMsg( "sitetitle" ) . ""; + $s .= ''; + $s .= ''; + $s .= '' . wfMsg( 'sitetitle' ) . ''; - $s .= ""; + $s .= ''; $s .= $this->sysLinks(); - $s .= "
"; + $s .= '
'; - $s .= ""; - $s .= htmlspecialchars( wfMsg( "sitesubtitle" ) ) . ""; - $s .= "" ; + $s .= ''; + $s .= htmlspecialchars( wfMsg( 'sitesubtitle' ) ) . ''; + $s .= ''; - $s .= "" ; - $s .= str_replace ( "
" , "" , $this->otherLanguages() ); + $s .= ''; + $s .= str_replace( '
', '', $this->otherLanguages() ); $cat = $this->getCategoryLinks(); - if( $cat ) $s .= "
$cat\n"; - $s .= "
" . $this->pageTitleLinks(); - $s .= "
"; + if( $cat ) { + $s .= "
$cat\n"; + } + $s .= '
' . $this->pageTitleLinks(); + $s .= '
'; $s .= "
\n"; @@ -64,37 +66,44 @@ class SkinCologneBlue extends Skin { return $s; } - function doAfterContent() - { - global $wgOut, $wgLang; + function doAfterContent(){ + global $wgLang; $s = "\n

\n"; $s .= "\n\n
\n"; - if ( 0 != $qb ) { $s .= $this->quickBar(); } + if ( 0 != $qb ) { + $s .= $this->quickBar(); + } return $s; } @@ -104,42 +113,51 @@ class SkinCologneBlue extends Skin { if ( 2 == $qb ) { # Right $s .= "#quickbar { position: absolute; right: 4px; }\n" . - "#article { margin-left: 4px; margin-right: 148px; }\n"; - } else if ( 1 == $qb ) { + "#article { margin-left: 4px; margin-right: 148px; }\n"; + } elseif ( 1 == $qb ) { $s .= "#quickbar { position: absolute; left: 4px; }\n" . - "#article { margin-left: 148px; margin-right: 4px; }\n"; - } else if ( 3 == $qb ) { # Floating left + "#article { margin-left: 148px; margin-right: 4px; }\n"; + } elseif ( 3 == $qb ) { # Floating left $s .= "#quickbar { position:absolute; left:4px } \n" . - "#topbar { margin-left: 148px }\n" . - "#article { margin-left:148px; margin-right: 4px; } \n" . - "body>#quickbar { position:fixed; left:4px; top:4px; overflow:auto ;bottom:4px;} \n"; # Hides from IE - } else if ( 4 == $qb ) { # Floating right + "#topbar { margin-left: 148px }\n" . + "#article { margin-left:148px; margin-right: 4px; } \n" . + "body>#quickbar { position:fixed; left:4px; top:4px; overflow:auto ;bottom:4px;} \n"; # Hides from IE + } elseif ( 4 == $qb ) { # Floating right $s .= "#quickbar { position: fixed; right: 4px; } \n" . - "#topbar { margin-right: 148px }\n" . - "#article { margin-right: 148px; margin-left: 4px; } \n" . - "body>#quickbar { position: fixed; right: 4px; top: 4px; overflow: auto ;bottom:4px;} \n"; # Hides from IE + "#topbar { margin-right: 148px }\n" . + "#article { margin-right: 148px; margin-left: 4px; } \n" . + "body>#quickbar { position: fixed; right: 4px; top: 4px; overflow: auto ;bottom:4px;} \n"; # Hides from IE } return $s; } function sysLinks() { - global $wgUser, $wgLang, $wgContLang, $wgTitle; - $li = $wgContLang->specialPage("Userlogin"); - $lo = $wgContLang->specialPage("Userlogout"); + global $wgUser, $wgLang, $wgContLang; + $li = SpecialPage::getTitleFor( 'Userlogin' ); + $lo = SpecialPage::getTitleFor( 'Userlogout' ); - $rt = $wgTitle->getPrefixedURL(); + $rt = $this->mTitle->getPrefixedURL(); if ( 0 == strcasecmp( urlencode( $lo ), $rt ) ) { - $q = ""; + $q = array(); } else { - $q = "returnto={$rt}"; + $q = array( 'returnto' => $rt ); } $s = array( $this->mainPageLink(), - $this->makeKnownLink( wfMsgForContent( "aboutpage" ), wfMsg( "about" ) ), - $this->makeKnownLink( wfMsgForContent( "helppage" ), wfMsg( "help" ) ), - $this->makeKnownLink( wfMsgForContent( "faqpage" ), wfMsg("faq") ), - $this->specialLink( "specialpages" ) + $this->linkKnown( + Title::newFromText( wfMsgForContent( 'aboutpage' ) ), + wfMsg( 'about' ) + ), + $this->linkKnown( + Title::newFromText( wfMsgForContent( 'helppage' ) ), + wfMsg( 'help' ) + ), + $this->linkKnown( + Title::newFromText( wfMsgForContent( 'faqpage' ) ), + wfMsg( 'faq' ) + ), + $this->specialLink( 'specialpages' ) ); /* show links to different language variants */ @@ -150,9 +168,19 @@ class SkinCologneBlue extends Skin { $s[] = $this->extensionTabLinks(); } if ( $wgUser->isLoggedIn() ) { - $s[] = $this->makeKnownLink( $lo, wfMsg( "logout" ), $q ); + $s[] = $this->linkKnown( + $lo, + wfMsg( 'logout' ), + array(), + $q + ); } else { - $s[] = $this->makeKnownLink( $li, wfMsg( "login" ), $q ); + $s[] = $this->linkKnown( + $li, + wfMsg( 'login' ), + array(), + $q + ); } return $wgLang->pipeList( $s ); @@ -162,19 +190,18 @@ class SkinCologneBlue extends Skin { * Compute the sidebar * @access private */ - function quickBar() - { - global $wgOut, $wgTitle, $wgUser, $wgLang, $wgContLang, $wgEnableUploads; + function quickBar(){ + global $wgOut, $wgUser, $wgEnableUploads; - $tns=$wgTitle->getNamespace(); + $tns = $this->mTitle->getNamespace(); $s = "\n
"; - $sep = "
"; - $s .= $this->menuHead( "qbfind" ); + $sep = '
'; + $s .= $this->menuHead( 'qbfind' ); $s .= $this->searchForm(); - $s .= $this->menuHead( "qbbrowse" ); + $s .= $this->menuHead( 'qbbrowse' ); # Use the first heading from the Monobook sidebar as the "browse" section $bar = $this->buildSidebar(); @@ -191,46 +218,49 @@ class SkinCologneBlue extends Skin { } if ( $wgOut->isArticle() ) { - $s .= $this->menuHead( "qbedit" ); - $s .= "" . $this->editThisPage() . ""; + $s .= $this->menuHead( 'qbedit' ); + $s .= '' . $this->editThisPage() . ''; - $s .= $sep . $this->makeKnownLink( wfMsgForContent( "edithelppage" ), wfMsg( "edithelp" ) ); + $s .= $sep . $this->linkKnown( + Title::newFromText( wfMsgForContent( 'edithelppage' ) ), + wfMsg( 'edithelp' ) + ); if( $wgUser->isLoggedIn() ) { $s .= $sep . $this->moveThisPage(); } - if ( $wgUser->isAllowed('delete') ) { + if ( $wgUser->isAllowed( 'delete' ) ) { $dtp = $this->deleteThisPage(); - if ( "" != $dtp ) { + if ( $dtp != '' ) { $s .= $sep . $dtp; } } - if ( $wgUser->isAllowed('protect') ) { + if ( $wgUser->isAllowed( 'protect' ) ) { $ptp = $this->protectThisPage(); - if ( "" != $ptp ) { + if ( $ptp != '' ) { $s .= $sep . $ptp; } } $s .= $sep; - $s .= $this->menuHead( "qbpageoptions" ); + $s .= $this->menuHead( 'qbpageoptions' ); $s .= $this->talkLink() - . $sep . $this->commentLink() - . $sep . $this->printableLink(); + . $sep . $this->commentLink() + . $sep . $this->printableLink(); if ( $wgUser->isLoggedIn() ) { $s .= $sep . $this->watchThisPage(); } $s .= $sep; - $s .= $this->menuHead("qbpageinfo") - . $this->historyLink() - . $sep . $this->whatLinksHere() - . $sep . $this->watchPageLinksLink(); + $s .= $this->menuHead( 'qbpageinfo' ) + . $this->historyLink() + . $sep . $this->whatLinksHere() + . $sep . $this->watchPageLinksLink(); if( $tns == NS_USER || $tns == NS_USER_TALK ) { - $id=User::idFromName($wgTitle->getText()); - if ($id != 0) { + $id = User::idFromName( $this->mTitle->getText() ); + if( $id != 0 ) { $s .= $sep . $this->userContribsLink(); if( $this->showEmailUser( $id ) ) { $s .= $sep . $this->emailUserLink(); @@ -240,72 +270,92 @@ class SkinCologneBlue extends Skin { $s .= $sep; } - $s .= $this->menuHead( "qbmyoptions" ); + $s .= $this->menuHead( 'qbmyoptions' ); if ( $wgUser->isLoggedIn() ) { $name = $wgUser->getName(); - $tl = $this->makeKnownLinkObj( $wgUser->getTalkPage(), - wfMsg( 'mytalk' ) ); + $tl = $this->link( + $wgUser->getTalkPage(), + wfMsg( 'mytalk' ), + array(), + array(), + array( 'known', 'noclasses' ) + ); if ( $wgUser->getNewtalk() ) { - $tl .= " *"; + $tl .= ' *'; } - $s .= $this->makeKnownLinkObj( $wgUser->getUserPage(), - wfMsg( "mypage" ) ) - . $sep . $tl - . $sep . $this->specialLink( "watchlist" ) - . $sep . $this->makeKnownLinkObj( SpecialPage::getSafeTitleFor( "Contributions", $wgUser->getName() ), - wfMsg( "mycontris" ) ) - . $sep . $this->specialLink( "preferences" ) - . $sep . $this->specialLink( "userlogout" ); + $s .= $this->link( + $wgUser->getUserPage(), + wfMsg( 'mypage' ), + array(), + array(), + array( 'known', 'noclasses' ) + ) . $sep . $tl . $sep . $this->specialLink( 'watchlist' ) + . $sep . + $this->link( + SpecialPage::getSafeTitleFor( 'Contributions', $wgUser->getName() ), + wfMsg( 'mycontris' ), + array(), + array(), + array( 'known', 'noclasses' ) + ) . $sep . $this->specialLink( 'preferences' ) + . $sep . $this->specialLink( 'userlogout' ); } else { - $s .= $this->specialLink( "userlogin" ); + $s .= $this->specialLink( 'userlogin' ); } - $s .= $this->menuHead( "qbspecialpages" ) - . $this->specialLink( "newpages" ) - . $sep . $this->specialLink( "listfiles" ) - . $sep . $this->specialLink( "statistics" ); + $s .= $this->menuHead( 'qbspecialpages' ) + . $this->specialLink( 'newpages' ) + . $sep . $this->specialLink( 'listfiles' ) + . $sep . $this->specialLink( 'statistics' ); if ( $wgUser->isLoggedIn() && $wgEnableUploads ) { - $s .= $sep . $this->specialLink( "upload" ); + $s .= $sep . $this->specialLink( 'upload' ); } + global $wgSiteSupportPage; - if( $wgSiteSupportPage) { - $s .= $sep."" - .wfMsg( "sitesupport" ).""; + + if( $wgSiteSupportPage ) { + $s .= $sep . '' + . wfMsg( 'sitesupport' ) . ''; } - $s .= $sep . $this->makeKnownLinkObj( + $s .= $sep . $this->link( SpecialPage::getTitleFor( 'Specialpages' ), - wfMsg( 'moredotdotdot' ) ); + wfMsg( 'moredotdotdot' ), + array(), + array(), + array( 'known', 'noclasses' ) + ); $s .= $sep . "\n
\n"; return $s; } - function menuHead( $key ) - { + function menuHead( $key ) { $s = "\n
" . wfMsg( $key ) . "
"; return $s; } - function searchForm( $label = "" ) - { + function searchForm( $label = '' ) { global $wgRequest, $wgUseTwoButtonsSearchForm; $search = $wgRequest->getText( 'search' ); $action = $this->escapeSearchLink(); $s = "
searchboxes}\" method=\"get\" class=\"inline\" action=\"$action\">"; - if ( "" != $label ) { $s .= "{$label}: "; } + if( $label != '' ) { + $s .= "{$label}: "; + } $s .= "searchboxes}\" class=\"mw-searchInput\" name=\"search\" size=\"14\" value=\"" - . htmlspecialchars(substr($search,0,256)) . "\" />
" - . "searchboxes}\" class=\"searchButton\" name=\"go\" value=\"" . htmlspecialchars( wfMsg( "searcharticle" ) ) . "\" />"; - - if ($wgUseTwoButtonsSearchForm) - $s .= "searchboxes}\" class=\"searchButton\" name=\"fulltext\" value=\"" . htmlspecialchars( wfMsg( "search" ) ) . "\" />\n"; - else - $s .= '
\n"; - + . htmlspecialchars( substr( $search, 0, 256 ) ) . "\" />
" + . "searchboxes}\" class=\"searchButton\" name=\"go\" value=\"" . htmlspecialchars( wfMsg( 'searcharticle' ) ) . "\" />"; + + if( $wgUseTwoButtonsSearchForm ) { + $s .= "searchboxes}\" class=\"searchButton\" name=\"fulltext\" value=\"" . htmlspecialchars( wfMsg( 'search' ) ) . "\" />\n"; + } else { + $s .= '
\n"; + } + $s .= '
'; // Ensure unique id's for search boxes made after the first @@ -314,5 +364,3 @@ class SkinCologneBlue extends Skin { return $s; } } - - -- cgit v1.2.3-54-g00ecf