X-Git-Url: http://git.heureux-cyclage.org/?a=blobdiff_plain;f=skins%2FCologneBlue.php;h=64a18f4fea39533c92248298de7df606389914b1;hb=1b70ac7ff7b1b770d39242af5cba5c04a8b641fe;hp=5a3f910a1cc8a85358d59b30eae57ba60fc1d056;hpb=ce5b47b2c409045672b9f3e65d6aa066f7746b06;p=lhc%2Fweb%2Fwiklou.git diff --git a/skins/CologneBlue.php b/skins/CologneBlue.php index 5a3f910a1c..64a18f4fea 100644 --- a/skins/CologneBlue.php +++ b/skins/CologneBlue.php @@ -1,10 +1,10 @@ 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"; @@ -68,41 +63,49 @@ class SkinCologneBlue extends Skin { return $s; } - function doAfterContent() - { - global $wgOut; + 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; } - function doGetUserStyles() { - global $wgOut; - $s = parent::doGetUserStyles(); + function reallyGenerateUserStylesheet() { + $s = parent::reallyGenerateUserStylesheet(); $qb = $this->qbSetting(); if ( 2 == $qb ) { # Right @@ -126,70 +129,82 @@ class SkinCologneBlue extends Skin { } function sysLinks() { - global $wgUser, $wgContLang, $wgTitle; - $li = $wgContLang->specialPage("Userlogin"); - $lo = $wgContLang->specialPage("Userlogout"); + global $wgUser, $wgLang, $wgContLang; + $li = $wgContLang->specialPage( 'Userlogin' ); + $lo = $wgContLang->specialPage( '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 = "" . - $this->makeKnownLink( wfMsgForContent( "mainpage" ), wfMsg( "mainpage" ) ) - . " | " . - $this->makeKnownLink( wfMsgForContent( "aboutpage" ), wfMsg( "about" ) ) - . " | " . - $this->makeKnownLink( wfMsgForContent( "helppage" ), wfMsg( "help" ) ) - . " | " . - $this->makeKnownLink( wfMsgForContent( "faqpage" ), wfMsg("faq") ) - . " | " . - $this->specialLink( "specialpages" ) . " | "; + $s = array( + $this->mainPageLink(), + $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 */ + if( $this->variantLinks() ) { + $s[] = $this->variantLinks(); + } + if( $this->extensionTabLinks() ) { + $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 ); - } - - /* show links to different language variants */ - global $wgDisableLangConversion; - $variants = $wgContLang->getVariants(); - if( !$wgDisableLangConversion && sizeof( $variants ) > 1 ) { - $actstr = ''; - foreach( $variants as $code ) { - $varname = $wgContLang->getVariantname( $code ); - if( $varname == 'disable' ) - continue; - $s .= ' | ' . $varname . ''; - } + $s[] = $this->linkKnown( + $li, + wfMsg( 'login' ), + array(), + $q + ); } - return $s; + return $wgLang->pipeList( $s ); } /** * 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(); + unset( $bar['SEARCH'] ); + unset( $bar['LANGUAGES'] ); + unset( $bar['TOOLBOX'] ); $browseLinks = reset( $bar ); foreach ( $browseLinks as $link ) { @@ -200,29 +215,32 @@ 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(); @@ -232,14 +250,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( $this->mTitle->getText() ); + if( $id != 0 ) { $s .= $sep . $this->userContribsLink(); if( $this->showEmailUser( $id ) ) { $s .= $sep . $this->emailUserLink(); @@ -249,68 +267,94 @@ 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 .= " *"; } - $s .= $this->makeKnownLinkObj( $wgUser->getUserPage(), - wfMsg( "mypage" ) ) + $s .= $this->link( + $wgUser->getUserPage(), + wfMsg( 'mypage' ), + array(), + array(), + array( 'known', 'noclasses' ) + ) . $sep . $tl - . $sep . $this->specialLink( "watchlist" ) - . $sep . $this->makeKnownLinkObj( Title::makeTitle( NS_SPECIAL, "Contributions" ), - wfMsg( "mycontris" ), "target=" . wfUrlencode($wgUser->getName() ) ) - . $sep . $this->specialLink( "preferences" ) - . $sep . $this->specialLink( "userlogout" ); + . $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( "imagelist" ) - . $sep . $this->specialLink( "statistics" ) - . $sep . $this->bugReportsLink(); + $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( - Title::makeTitle( NS_SPECIAL, 'Specialpages' ), - wfMsg( 'moredotdotdot' ) ); + $s .= $sep . $this->link( + SpecialPage::getTitleFor( 'Specialpages' ), + 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 = "" ) - { - global $wgRequest; + 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" ) ) . "\" />" - . "searchboxes}\" class=\"searchButton\" name=\"fulltext\" value=\"" . htmlspecialchars( wfMsg( "search" ) ) . "\" />
"; + . 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 $this->searchboxes = $this->searchboxes == '' ? 2 : $this->searchboxes + 1; @@ -318,5 +362,3 @@ class SkinCologneBlue extends Skin { return $s; } } - -?>