From eb267e2492628ee6313c38a3c45793d09be0bd3f Mon Sep 17 00:00:00 2001 From: Zheng Zhu Date: Sun, 26 Sep 2004 01:50:26 +0000 Subject: [PATCH] some more UI related fix --- includes/Skin.php | 10 +++++----- includes/SkinPHPTal.php | 4 ++-- skins/CologneBlue.php | 30 +++++++++++++++--------------- skins/WikimediaWiki.php | 24 ++++++++++++------------ 4 files changed, 34 insertions(+), 34 deletions(-) diff --git a/includes/Skin.php b/includes/Skin.php index d24cac352d..91b49f860b 100644 --- a/includes/Skin.php +++ b/includes/Skin.php @@ -587,10 +587,10 @@ class Skin { $action = $wgRequest->getText( 'action' ); $s = $this->printableLink(); - if ( wfMsg ( 'disclaimers' ) != '-' ) + if ( wfMsgForContent ( 'disclaimers' ) != '-' ) $s .= ' | ' . $this->makeKnownLink( wfMsgForContent( 'disclaimerpage' ), - wfMsg( 'disclaimers' ) ) ; + wfMsgForContent( 'disclaimers' ) ) ; if ( $wgOut->isArticleRelated() ) { if ( $wgTitle->getNamespace() == Namespace::getImage() ) { @@ -887,7 +887,7 @@ class Skin { $oldid = $wgRequest->getVal( 'oldid' ); $diff = $wgRequest->getVal( 'diff' ); - if ( !is_null( $oldid ) && is_null( $diff ) && wfMsg( 'history_copyright' ) !== '-' ) { + if ( !is_null( $oldid ) && is_null( $diff ) && wfMsgForContent( 'history_copyright' ) !== '-' ) { $msg = 'history_copyright'; } else { $msg = 'copyright'; @@ -902,7 +902,7 @@ class Skin { # Give up now return $out; } - $out .= wfMsg( $msg, $link ); + $out .= wfMsgForContent( $msg, $link ); return $out; } @@ -986,7 +986,7 @@ class Skin { } // only show watchlist link if logged in - if ( wfMsg ( 'currentevents' ) != '-' ) + if ( wfMsgForContent ( 'currentevents' ) != '-' ) $s .= $sep . $this->makeKnownLink( wfMsgForContent( 'currentevents' ), '' ) ; $s .= "\n

"; $articleExists = $wgTitle->getArticleId(); diff --git a/includes/SkinPHPTal.php b/includes/SkinPHPTal.php index 1956891b38..fee3ea0961 100644 --- a/includes/SkinPHPTal.php +++ b/includes/SkinPHPTal.php @@ -527,8 +527,8 @@ class SkinPHPTal extends Skin { $nav_urls['mainpage'] = array('href' => htmlspecialchars( $this->makeI18nUrl('mainpage'))); $nav_urls['randompage'] = array('href' => htmlspecialchars( $this->makeSpecialUrl('Randompage'))); $nav_urls['recentchanges'] = array('href' => htmlspecialchars( $this->makeSpecialUrl('Recentchanges'))); - $nav_urls['currentevents'] = (wfMsg('currentevents') != '-') ? array('href' => htmlspecialchars( $this->makeI18nUrl('currentevents'))) : false; - $nav_urls['portal'] = (wfMsg('portal') != '-') ? array('href' => htmlspecialchars( $this->makeI18nUrl('portal-url'))) : false; + $nav_urls['currentevents'] = (wfMsgForContent('currentevents') != '-') ? array('href' => htmlspecialchars( $this->makeI18nUrl('currentevents'))) : false; + $nav_urls['portal'] = (wfMsgForContent('portal') != '-') ? array('href' => htmlspecialchars( $this->makeI18nUrl('portal-url'))) : false; $nav_urls['bugreports'] = array('href' => htmlspecialchars( $this->makeI18nUrl('bugreportspage'))); // $nav_urls['sitesupport'] = array('href' => htmlspecialchars( $this->makeI18nUrl('sitesupportpage'))); $nav_urls['sitesupport'] = array('href' => htmlspecialchars( $wgSiteSupportPage)); diff --git a/skins/CologneBlue.php b/skins/CologneBlue.php index 64501b713c..33b854f63d 100644 --- a/skins/CologneBlue.php +++ b/skins/CologneBlue.php @@ -78,7 +78,7 @@ class SkinCologneBlue extends Skin { $s .= ""; $s .= $this->bottomLinks(); - $s .= "\n
" . $this->makeKnownLink( wfMsg( "mainpage" ) ) . " | " + $s .= "\n
" . $this->makeKnownLink( wfMsgForContent( "mainpage" ) ) . " | " . $this->aboutLink() . " | " . $this->searchForm( wfMsg( "qbfind" ) ); @@ -116,9 +116,9 @@ class SkinCologneBlue extends Skin { } function sysLinks() { - global $wgUser, $wgLang, $wgTitle; - $li = $wgLang->specialPage("Userlogin"); - $lo = $wgLang->specialPage("Userlogout"); + global $wgUser, $wgContLang, $wgTitle; + $li = $wgContLang->specialPage("Userlogin"); + $lo = $wgContLang->specialPage("Userlogout"); $rt = $wgTitle->getPrefixedURL(); if ( 0 == strcasecmp( urlencode( $lo ), $rt ) ) { @@ -128,13 +128,13 @@ class SkinCologneBlue extends Skin { } $s = "" . - $this->makeKnownLink( wfMsg( "mainpage" ), wfMsg( "mainpage" ) ) + $this->makeKnownLink( wfMsgForContent( "mainpage" ), wfMsg( "mainpage" ) ) . " | " . - $this->makeKnownLink( wfMsg( "aboutpage" ), wfMsg( "about" ) ) + $this->makeKnownLink( wfMsgForContent( "aboutpage" ), wfMsg( "about" ) ) . " | " . - $this->makeKnownLink( wfMsg( "helppage" ), wfMsg( "help" ) ) + $this->makeKnownLink( wfMsgForContent( "helppage" ), wfMsg( "help" ) ) . " | " . - $this->makeKnownLink( wfMsg( "faqpage" ), wfMsg("faq") ) + $this->makeKnownLink( wfMsgForContent( "faqpage" ), wfMsg("faq") ) . " | " . $this->specialLink( "specialpages" ) . " | "; @@ -152,7 +152,7 @@ class SkinCologneBlue extends Skin { function quickBar() { - global $wgOut, $wgTitle, $wgUser, $wgLang, $wgDisableUploads; + global $wgOut, $wgTitle, $wgUser, $wgLang, $wgContLang, $wgDisableUploads; $tns=$wgTitle->getNamespace(); @@ -166,14 +166,14 @@ class SkinCologneBlue extends Skin { . $this->mainPageLink() . $sep . $this->specialLink( "recentchanges" ) . $sep . $this->specialLink( "randompage" ); - if ( wfMsg ( "currentevents" ) != "-" ) $s .= $sep . $this->makeKnownLink( wfMsg( "currentevents" ), "" ) ; + if ( wfMsgForContent ( "currentevents" ) != "-" ) $s .= $sep . $this->makeKnownLink( wfMsgForContent( "currentevents" ), "" ) ; $s .= "\n"; if ( $wgOut->isArticle() ) { $s .= $this->menuHead( "qbedit" ); $s .= "" . $this->editThisPage() . ""; - $s .= $sep . $this->makeKnownLink( wfMsg( "edithelppage" ), wfMsg( "edithelp" ) ); + $s .= $sep . $this->makeKnownLink( wfMsgForContent( "edithelppage" ), wfMsg( "edithelp" ) ); if ( 0 != $wgUser->getID() ) { $s .= $sep . $this->moveThisPage(); @@ -220,16 +220,16 @@ class SkinCologneBlue extends Skin { $s .= $this->menuHead( "qbmyoptions" ); if ( 0 != $wgUser->getID() ) { $name = $wgUser->getName(); - $tl = $this->makeKnownLink( $wgLang->getNsText( + $tl = $this->makeKnownLink( $wgContLang->getNsText( Namespace::getTalk( Namespace::getUser() ) ) . ":{$name}", wfMsg( "mytalk" ) ); if ( 0 != $wgUser->getNewtalk() ) { $tl .= " *"; } - $s .= $this->makeKnownLink( $wgLang->getNsText( + $s .= $this->makeKnownLink( $wgContLang->getNsText( Namespace::getUser() ) . ":{$name}", wfMsg( "mypage" ) ) . $sep . $tl . $sep . $this->specialLink( "watchlist" ) - . $sep . $this->makeKnownLink( $wgLang->specialPage( "Contributions" ), + . $sep . $this->makeKnownLink( $wgContLang->specialPage( "Contributions" ), wfMsg( "mycontris" ), "target=" . wfUrlencode($wgUser->getName() ) ) . $sep . $this->specialLink( "preferences" ) . $sep . $this->specialLink( "userlogout" ); @@ -251,7 +251,7 @@ class SkinCologneBlue extends Skin { .wfMsg( "sitesupport" ).""; } - $s .= $sep . $this->makeKnownLink( $wgLang->specialPage( "Specialpages" ), wfMsg("moredotdotdot") ); + $s .= $sep . $this->makeKnownLink( $wgContLang->specialPage( "Specialpages" ), wfMsg("moredotdotdot") ); $s .= $sep . "\n\n"; return $s; diff --git a/skins/WikimediaWiki.php b/skins/WikimediaWiki.php index 2977ac4c5f..3e125b34c2 100644 --- a/skins/WikimediaWiki.php +++ b/skins/WikimediaWiki.php @@ -40,13 +40,13 @@ class SkinWikimediawiki extends SkinMonoBook { // XXX: remove htmlspecialchars when tal:attributes works with i18n:attributes $nav_urls = array(); $nav_urls['mainpage'] = array('href' => htmlspecialchars( $this->makeI18nUrl('mainpage'))); - $nav_urls['randompage'] = (wfMsg('randompage') != '-') ? array('href' => htmlspecialchars( $this->makeSpecialUrl('Randompage'))) : false; - $nav_urls['recentchanges'] = (wfMsg('recentchanges') != '-') ? array('href' => htmlspecialchars( $this->makeSpecialUrl('Recentchanges'))) : false; + $nav_urls['randompage'] = (wfMsgForContent('randompage') != '-') ? array('href' => htmlspecialchars( $this->makeSpecialUrl('Randompage'))) : false; + $nav_urls['recentchanges'] = (wfMsgForContent('recentchanges') != '-') ? array('href' => htmlspecialchars( $this->makeSpecialUrl('Recentchanges'))) : false; $nav_urls['whatlinkshere'] = array('href' => htmlspecialchars( $this->makeSpecialUrl('Whatlinkshere', 'target='.urlencode( $this->thispage )))); - $nav_urls['currentevents'] = (wfMsg('currentevents') != '-') ? array('href' => htmlspecialchars( $this->makeI18nUrl('currentevents'))) : false; - $nav_urls['portal'] = (wfMsg('portal') != '-') ? array('href' => htmlspecialchars( $this->makeI18nUrl('portal-url'))) : false; + $nav_urls['currentevents'] = (wfMsgForContent('currentevents') != '-') ? array('href' => htmlspecialchars( $this->makeI18nUrl('currentevents'))) : false; + $nav_urls['portal'] = (wfMsgForContent('portal') != '-') ? array('href' => htmlspecialchars( $this->makeI18nUrl('portal-url'))) : false; $nav_urls['recentchangeslinked'] = array('href' => htmlspecialchars( $this->makeSpecialUrl('Recentchangeslinked', 'target='.urlencode( $this->thispage )))); - $nav_urls['bugreports'] = (wfMsg('bugreports') != '-') ? array('href' => htmlspecialchars( $this->makeI18nUrl('bugreportspage'))) : false; + $nav_urls['bugreports'] = (wfMsgForContent('bugreports') != '-') ? array('href' => htmlspecialchars( $this->makeI18nUrl('bugreportspage'))) : false; $nav_urls['sitesupport'] = array('href' => htmlspecialchars( $wgSiteSupportPage)); $nav_urls['help'] = array('href' => htmlspecialchars( $this->makeI18nUrl('helppage'))); $nav_urls['upload'] = array('href' => htmlspecialchars( $this->makeSpecialUrl('Upload'))); @@ -54,13 +54,13 @@ class SkinWikimediawiki extends SkinMonoBook { # Specific for mediawiki.org menu - $nav_urls['aboutmediawiki'] = (wfMsg('aboutmediawiki') != '-') ? array('href' => htmlspecialchars( $this->makeI18nUrl('aboutmediawiki-url'))) : false; - $nav_urls['projects'] = (wfMsg('projects') != '-') ? array('href' => htmlspecialchars( $this->makeI18nUrl('projects-url'))) : false; - $nav_urls['membership'] = (wfMsg('membership') != '-') ? array('href' => htmlspecialchars( $this->makeI18nUrl('membership-url'))) : false; - $nav_urls['pressroom'] = (wfMsg('pressroom') != '-') ? array('href' => htmlspecialchars( $this->makeI18nUrl('pressroom-url'))) : false; - $nav_urls['software'] = (wfMsg('software') != '-') ? array('href' => htmlspecialchars( $this->makeI18nUrl('software-url'))) : false; - $nav_urls['localchapters'] = (wfMsg('localchapters') != '-') ? array('href' => htmlspecialchars( $this->makeI18nUrl('localchapters-url'))) : false; - $nav_urls['contactus'] = (wfMsg('contactus') != '-') ? array('href' => htmlspecialchars( $this->makeI18nUrl('contactus-url'))) : false; + $nav_urls['aboutmediawiki'] = (wfMsgForContent('aboutmediawiki') != '-') ? array('href' => htmlspecialchars( $this->makeI18nUrl('aboutmediawiki-url'))) : false; + $nav_urls['projects'] = (wfMsgForContent('projects') != '-') ? array('href' => htmlspecialchars( $this->makeI18nUrl('projects-url'))) : false; + $nav_urls['membership'] = (wfMsgForContent('membership') != '-') ? array('href' => htmlspecialchars( $this->makeI18nUrl('membership-url'))) : false; + $nav_urls['pressroom'] = (wfMsgForContent('pressroom') != '-') ? array('href' => htmlspecialchars( $this->makeI18nUrl('pressroom-url'))) : false; + $nav_urls['software'] = (wfMsgForContent('software') != '-') ? array('href' => htmlspecialchars( $this->makeI18nUrl('software-url'))) : false; + $nav_urls['localchapters'] = (wfMsgForContent('localchapters') != '-') ? array('href' => htmlspecialchars( $this->makeI18nUrl('localchapters-url'))) : false; + $nav_urls['contactus'] = (wfMsgForContent('contactus') != '-') ? array('href' => htmlspecialchars( $this->makeI18nUrl('contactus-url'))) : false; if( $wgTitle->getNamespace() == NS_USER || $wgTitle->getNamespace() == NS_USER_TALK ) { $id = User::idFromName($wgTitle->getText()); -- 2.20.1