From 0ffd5375e594828086e7007adb14945e91b73bb9 Mon Sep 17 00:00:00 2001 From: Jack Phoenix Date: Sun, 29 Mar 2009 15:01:35 +0000 Subject: [PATCH] cleanup to CologneBlue.php --- skins/CologneBlue.php | 161 +++++++++++++++++++++--------------------- 1 file changed, 79 insertions(+), 82 deletions(-) diff --git a/skins/CologneBlue.php b/skins/CologneBlue.php index c650cbee6a..e3dc1b4c60 100644 --- a/skins/CologneBlue.php +++ b/skins/CologneBlue.php @@ -1,6 +1,6 @@ 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 .= "
"; + $s .= '
' . $this->pageTitleLinks(); + $s .= '
'; $s .= "
\n"; @@ -64,37 +63,38 @@ class SkinCologneBlue extends Skin { return $s; } - function doAfterContent() - { + function doAfterContent(){ global $wgOut, $wgLang; $s = "\n

\n"; $s .= "\n\n
\n"; - if ( 0 != $qb ) { $s .= $this->quickBar(); } + if ( 0 != $qb ) { + $s .= $this->quickBar(); + } return $s; } @@ -124,22 +124,22 @@ class SkinCologneBlue extends Skin { function sysLinks() { global $wgUser, $wgLang, $wgContLang, $wgTitle; - $li = $wgContLang->specialPage("Userlogin"); - $lo = $wgContLang->specialPage("Userlogout"); + $li = $wgContLang->specialPage( 'Userlogin' ); + $lo = $wgContLang->specialPage( 'Userlogout' ); $rt = $wgTitle->getPrefixedURL(); if ( 0 == strcasecmp( urlencode( $lo ), $rt ) ) { - $q = ""; + $q = ''; } else { $q = "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->makeKnownLink( wfMsgForContent( 'aboutpage' ), wfMsg( 'about' ) ), + $this->makeKnownLink( wfMsgForContent( 'helppage' ), wfMsg( 'help' ) ), + $this->makeKnownLink( wfMsgForContent( 'faqpage' ), wfMsg( 'faq' ) ), + $this->specialLink( 'specialpages' ) ); /* show links to different language variants */ @@ -150,9 +150,9 @@ class SkinCologneBlue extends Skin { $s[] = $this->extensionTabLinks(); } if ( $wgUser->isLoggedIn() ) { - $s[] = $this->makeKnownLink( $lo, wfMsg( "logout" ), $q ); + $s[] = $this->makeKnownLink( $lo, wfMsg( 'logout' ), $q ); } else { - $s[] = $this->makeKnownLink( $li, wfMsg( "login" ), $q ); + $s[] = $this->makeKnownLink( $li, wfMsg( 'login' ), $q ); } return $wgLang->pipeList( $s ); @@ -162,19 +162,18 @@ class SkinCologneBlue extends Skin { * Compute the sidebar * @access private */ - function quickBar() - { - global $wgOut, $wgTitle, $wgUser, $wgLang, $wgContLang, $wgEnableUploads; + function quickBar(){ + global $wgOut, $wgTitle, $wgUser, $wgEnableUploads; - $tns=$wgTitle->getNamespace(); + $tns = $wgTitle->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,29 +190,29 @@ 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->makeKnownLink( 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(); @@ -223,14 +222,14 @@ class SkinCologneBlue extends Skin { $s .= $sep; - $s .= $this->menuHead("qbpageinfo") + $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( $wgTitle->getText() ); + if( $id != 0 ) { $s .= $sep . $this->userContribsLink(); if( $this->showEmailUser( $id ) ) { $s .= $sep . $this->emailUserLink(); @@ -240,7 +239,7 @@ 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(), @@ -250,28 +249,28 @@ class SkinCologneBlue extends Skin { } $s .= $this->makeKnownLinkObj( $wgUser->getUserPage(), - wfMsg( "mypage" ) ) + 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" ); + . $sep . $this->specialLink( 'watchlist' ) + . $sep . $this->makeKnownLinkObj( SpecialPage::getSafeTitleFor( 'Contributions', $wgUser->getName() ), + wfMsg( 'mycontris' ) ) + . $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( @@ -282,30 +281,30 @@ class SkinCologneBlue extends Skin { 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" ) ) . "\" />"; + . 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"; + if( $wgUseTwoButtonsSearchForm ) + $s .= "searchboxes}\" class=\"searchButton\" name=\"fulltext\" value=\"" . htmlspecialchars( wfMsg( 'search' ) ) . "\" />\n"; else - $s .= '
\n"; - + $s .= '
\n"; + $s .= '
'; // Ensure unique id's for search boxes made after the first @@ -313,6 +312,4 @@ class SkinCologneBlue extends Skin { return $s; } -} - - +} \ No newline at end of file -- 2.20.1