From: Evan Prodromou Date: Fri, 8 Oct 2004 22:00:51 +0000 (+0000) Subject: Fixed problems with hiding certain links (portal, currentevents, X-Git-Tag: 1.5.0alpha1~1627 X-Git-Url: https://git.cyclocoop.org/%7B%24admin_url%7Dmembres/modifier.php?a=commitdiff_plain;h=3f399900754d4fcda37090a357e4df1107fefe6a;p=lhc%2Fweb%2Fwiklou.git Fixed problems with hiding certain links (portal, currentevents, disclaimers). Corrected help text in Language.php -- it said to set the values to '', but the code used '-'. Fixed Skin.php so it checks for '-' for disclaimers. Also, fixed SkinPHPTal.php so it checks for '-' anywhere it can show up -- in buildNavigationUrls and buildNavUrls. --- diff --git a/includes/Skin.php b/includes/Skin.php index a30d198c10..ea445b7b6c 100644 --- a/includes/Skin.php +++ b/includes/Skin.php @@ -544,10 +544,7 @@ class Skin { $action = $wgRequest->getText( 'action' ); $s = $this->printableLink(); - if ( wfMsgForContent ( 'disclaimers' ) != '-' ) - $s .= ' | ' . $this->makeKnownLink( - wfMsgForContent( 'disclaimerpage' ), - wfMsgForContent( 'disclaimers' ) ) ; + $s .= $this->disclaimerLink(); # may be empty if ( $wgOut->isArticleRelated() ) { if ( $wgTitle->getNamespace() == Namespace::getImage() ) { @@ -979,9 +976,13 @@ class Skin { function disclaimerLink() { - $s = $this->makeKnownLink( wfMsgForContent( 'disclaimerpage' ), - wfMsg( 'disclaimers' ) ); - return $s; + $disclaimers = wfMsg( 'disclaimers' ); + if ($disclaimers == '-') { + return ""; + } else { + return $this->makeKnownLink( wfMsgForContent( 'disclaimerpage' ), + $disclaimers ); + } } function editThisPage() { diff --git a/includes/SkinPHPTal.php b/includes/SkinPHPTal.php index 65f3c5115b..0dd02bd720 100644 --- a/includes/SkinPHPTal.php +++ b/includes/SkinPHPTal.php @@ -559,11 +559,13 @@ class SkinPHPTal extends Skin { global $wgNavigationLinks; $result = array(); foreach ( $wgNavigationLinks as $link ) { - $result[] = array( - 'text' => wfMsg( $link['text'] ), - 'href' => $this->makeInternalOrExternalUrl( wfMsgForContent( $link['href'] ) ), - 'id' => 'n-'.$link['text'] - ); + if (wfMsg( $link['text'] ) != '-') { + $result[] = array( + 'text' => wfMsg( $link['text'] ), + 'href' => $this->makeInternalOrExternalUrl( wfMsgForContent( $link['href'] ) ), + 'id' => 'n-'.$link['text'] + ); + } } return $result; } @@ -583,8 +585,16 @@ class SkinPHPTal extends Skin { $nav_urls['mainpage'] = array('href' => $this->makeI18nUrl('mainpage')); $nav_urls['randompage'] = array('href' => $this->makeSpecialUrl('Randompage')); $nav_urls['recentchanges'] = array('href' => $this->makeSpecialUrl('Recentchanges')); - $nav_urls['currentevents'] = (wfMsg('currentevents') != '-') ? array('href' => $this->makeI18nUrl('currentevents')) : false; - $nav_urls['portal'] = (wfMsg('portal') != '-') ? array('href' => $this->makeI18nUrl('portal-url')) : false; + $ce = wfMsg('currentevents'); + wfDebug("Got to before here"); + if (strcmp($ce, '-') != 0) { + wfDebug("GOT TO HERE"); + $nav_urls['currentevents'] = array('href' => $this->makeI18nUrl('currentevents')); + } + $portal = wfMsg('portal'); + if (strcmp($portal, '-') != 0) { + $nav_urls['portal'] = array('href' => $this->makeI18nUrl('portal-url')); + } $nav_urls['bugreports'] = array('href' => $this->makeI18nUrl('bugreportspage')); // $nav_urls['sitesupport'] = array('href' => $this->makeI18nUrl('sitesupportpage')); $nav_urls['sitesupport'] = array('href' => $wgSiteSupportPage); diff --git a/languages/Language.php b/languages/Language.php index 19ac874274..f5ecd4d23d 100644 --- a/languages/Language.php +++ b/languages/Language.php @@ -222,16 +222,6 @@ $wgLanguageNamesEn =& $wgLanguageNames; # hyphen (-). If you need more characters, you may be able to change # the regex in MagicWord::initRegex -# NOTE: To turn off "Current Events" in the sidebar, -# set "currentevents" => "" - -# NOTE: To turn off "Disclaimers" in the title links, -# set "disclaimers" => "" - -# NOTE: To turn off "Community portal" in the title links, -# set "portal" => "" - - # required for copyrightwarning global $wgRightsText; @@ -304,6 +294,10 @@ global $wgRightsText; 'mainpagetext' => 'Wiki software successfully installed.', "mainpagedocfooter" => "Please see [http://meta.wikipedia.org/wiki/MediaWiki_i18n documentation on customizing the interface] and the [http://meta.wikipedia.org/wiki/MediaWiki_User%27s_Guide User's Guide] for usage and configuration help.", + +# NOTE: To turn off "Community portal" in the title links, +# set "portal" => "-" + 'portal' => 'Community portal', 'portal-url' => '{{ns:4}}:Community Portal', 'about' => 'About', @@ -335,10 +329,18 @@ and the [http://meta.wikipedia.org/wiki/MediaWiki_User%27s_Guide User's Guide] f 'mytalk' => 'My talk', 'anontalk' => 'Talk for this IP', 'navigation' => 'Navigation', + +# NOTE: To turn off "Current Events" in the sidebar, +# set "currentevents" => "-" + 'currentevents' => 'Current events', 'currentevents-url' => 'Current events', + +# NOTE: To turn off "Disclaimers" in the title links, +# set "disclaimers" => "-" + 'disclaimers' => 'Disclaimers', -"disclaimerpage" => "{{ns:4}}:General_disclaimer", +"disclaimerpage" => "{{ns:4}}:General_disclaimer", "errorpagetitle" => "Error", "returnto" => "Return to $1.", "tagline" => "From {{SITENAME}}",