Fixed problems with hiding certain links (portal, currentevents,
authorEvan Prodromou <evanprodromou@users.mediawiki.org>
Fri, 8 Oct 2004 22:00:51 +0000 (22:00 +0000)
committerEvan Prodromou <evanprodromou@users.mediawiki.org>
Fri, 8 Oct 2004 22:00:51 +0000 (22:00 +0000)
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.

includes/Skin.php
includes/SkinPHPTal.php
languages/Language.php

index a30d198..ea445b7 100644 (file)
@@ -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() {
index 65f3c51..0dd02bd 100644 (file)
@@ -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);
index 19ac874..f5ecd4d 100644 (file)
@@ -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}}",