Fix http://bugzilla.wikipedia.org/show_bug.cgi?id=511 . Stop showing whatlinkshere...
authorAntoine Musso <hashar@users.mediawiki.org>
Mon, 20 Sep 2004 17:42:12 +0000 (17:42 +0000)
committerAntoine Musso <hashar@users.mediawiki.org>
Mon, 20 Sep 2004 17:42:12 +0000 (17:42 +0000)
includes/SkinPHPTal.php
skins/Amethyst.pt
skins/MonoBook.pt

index 0a5fe47..cc8e451 100644 (file)
@@ -172,6 +172,7 @@ class SkinPHPTal extends Skin {
                $tpl->setRef( 'stylename', $this->stylename );
                $tpl->setRef( 'loggedin', $this->loggedin );
                $tpl->set('nsclass', 'ns-'.$wgTitle->getNamespace());
+               $tpl->set('notspecialpage', $wgTitle->getNamespace() != NS_SPECIAL);
                /* XXX currently unused, might get useful later
                $tpl->set( "editable", ($wgTitle->getNamespace() != NS_SPECIAL ) );
                $tpl->set( "exists", $wgTitle->getArticleID() != 0 );
@@ -526,10 +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['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['recentchangeslinked'] = array('href' => htmlspecialchars( $this->makeSpecialUrl('Recentchangeslinked', 'target='.urlencode( $this->thispage ))));
                $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));
@@ -539,6 +538,11 @@ class SkinPHPTal extends Skin {
                }
                $nav_urls['specialpages'] = array('href' => htmlspecialchars( $this->makeSpecialUrl('Specialpages')));
 
+               if( $wgTitle->getNamespace() != NS_SPECIAL) {
+               $nav_urls['whatlinkshere'] = array('href' => htmlspecialchars( $this->makeSpecialUrl('Whatlinkshere', 'target='.urlencode( $this->thispage ))));
+               $nav_urls['recentchangeslinked'] = array('href' => htmlspecialchars( $this->makeSpecialUrl('Recentchangeslinked', 'target='.urlencode( $this->thispage ))));
+               }
+
                if( $wgTitle->getNamespace() == NS_USER || $wgTitle->getNamespace() == NS_USER_TALK ) {
                        $id = User::idFromName($wgTitle->getText());
                        $ip = User::isIP($wgTitle->getText());
@@ -560,7 +564,6 @@ class SkinPHPTal extends Skin {
                        }
                }
 
-
                return $nav_urls;
        }
 
index edacf4c..199ddf8 100644 (file)
@@ -97,9 +97,9 @@
          <h5 i18n:translate="string:toolbox">Toolbox</h5>
          <div class="pBody">
            <ul>
-             <li id="t-whatlinkshere"><a href="${nav_urls/whatlinkshere/href}"
+             <li id="t-whatlinkshere" tal:condition="notspecialpage"><a href="${nav_urls/whatlinkshere/href}"
                i18n:translate="string:whatlinkshere">What links here</a></li>
-             <li id="t-recentchangeslinked"><a href="${nav_urls/recentchangeslinked/href}"
+             <li id="t-recentchangeslinked" tal:condition="notspecialpage"><a href="${nav_urls/recentchangeslinked/href}"
                i18n:translate="string:recentchangeslinked">Related Changes</a></li>
              <li tal:condition="feeds" id="feedlinks">
              <span i18n:translate="string:feedlinks">Feeds:</span>
index edacf4c..199ddf8 100644 (file)
@@ -97,9 +97,9 @@
          <h5 i18n:translate="string:toolbox">Toolbox</h5>
          <div class="pBody">
            <ul>
-             <li id="t-whatlinkshere"><a href="${nav_urls/whatlinkshere/href}"
+             <li id="t-whatlinkshere" tal:condition="notspecialpage"><a href="${nav_urls/whatlinkshere/href}"
                i18n:translate="string:whatlinkshere">What links here</a></li>
-             <li id="t-recentchangeslinked"><a href="${nav_urls/recentchangeslinked/href}"
+             <li id="t-recentchangeslinked" tal:condition="notspecialpage"><a href="${nav_urls/recentchangeslinked/href}"
                i18n:translate="string:recentchangeslinked">Related Changes</a></li>
              <li tal:condition="feeds" id="feedlinks">
              <span i18n:translate="string:feedlinks">Feeds:</span>