r5332 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r5331‎ | r5332 | r5333 >
Date:17:42, 20 September 2004
Author:hashar
Status:old
Tags:
Comment:
Fix http://bugzilla.wikipedia.org/show_bug.cgi?id=511 . Stop showing whatlinkshere and relatedchanges links for special pages.
Modified paths:
  • /trunk/phase3/includes/SkinPHPTal.php (modified) (history)
  • /trunk/phase3/skins/Amethyst.pt (modified) (history)
  • /trunk/phase3/skins/MonoBook.pt (modified) (history)

Diff [purge]

Index: trunk/phase3/skins/Amethyst.pt
@@ -97,9 +97,9 @@
9898 <h5 i18n:translate="string:toolbox">Toolbox</h5>
9999 <div class="pBody">
100100 <ul>
101 - <li id="t-whatlinkshere"><a href="${nav_urls/whatlinkshere/href}"
 101+ <li id="t-whatlinkshere" tal:condition="notspecialpage"><a href="${nav_urls/whatlinkshere/href}"
102102 i18n:translate="string:whatlinkshere">What links here</a></li>
103 - <li id="t-recentchangeslinked"><a href="${nav_urls/recentchangeslinked/href}"
 103+ <li id="t-recentchangeslinked" tal:condition="notspecialpage"><a href="${nav_urls/recentchangeslinked/href}"
104104 i18n:translate="string:recentchangeslinked">Related Changes</a></li>
105105 <li tal:condition="feeds" id="feedlinks">
106106 <span i18n:translate="string:feedlinks">Feeds:</span>
Index: trunk/phase3/skins/MonoBook.pt
@@ -97,9 +97,9 @@
9898 <h5 i18n:translate="string:toolbox">Toolbox</h5>
9999 <div class="pBody">
100100 <ul>
101 - <li id="t-whatlinkshere"><a href="${nav_urls/whatlinkshere/href}"
 101+ <li id="t-whatlinkshere" tal:condition="notspecialpage"><a href="${nav_urls/whatlinkshere/href}"
102102 i18n:translate="string:whatlinkshere">What links here</a></li>
103 - <li id="t-recentchangeslinked"><a href="${nav_urls/recentchangeslinked/href}"
 103+ <li id="t-recentchangeslinked" tal:condition="notspecialpage"><a href="${nav_urls/recentchangeslinked/href}"
104104 i18n:translate="string:recentchangeslinked">Related Changes</a></li>
105105 <li tal:condition="feeds" id="feedlinks">
106106 <span i18n:translate="string:feedlinks">Feeds:</span>
Index: trunk/phase3/includes/SkinPHPTal.php
@@ -172,6 +172,7 @@
173173 $tpl->setRef( 'stylename', $this->stylename );
174174 $tpl->setRef( 'loggedin', $this->loggedin );
175175 $tpl->set('nsclass', 'ns-'.$wgTitle->getNamespace());
 176+ $tpl->set('notspecialpage', $wgTitle->getNamespace() != NS_SPECIAL);
176177 /* XXX currently unused, might get useful later
177178 $tpl->set( "editable", ($wgTitle->getNamespace() != NS_SPECIAL ) );
178179 $tpl->set( "exists", $wgTitle->getArticleID() != 0 );
@@ -526,10 +527,8 @@
527528 $nav_urls['mainpage'] = array('href' => htmlspecialchars( $this->makeI18nUrl('mainpage')));
528529 $nav_urls['randompage'] = array('href' => htmlspecialchars( $this->makeSpecialUrl('Randompage')));
529530 $nav_urls['recentchanges'] = array('href' => htmlspecialchars( $this->makeSpecialUrl('Recentchanges')));
530 - $nav_urls['whatlinkshere'] = array('href' => htmlspecialchars( $this->makeSpecialUrl('Whatlinkshere', 'target='.urlencode( $this->thispage ))));
531531 $nav_urls['currentevents'] = (wfMsg('currentevents') != '-') ? array('href' => htmlspecialchars( $this->makeI18nUrl('currentevents'))) : false;
532532 $nav_urls['portal'] = (wfMsg('portal') != '-') ? array('href' => htmlspecialchars( $this->makeI18nUrl('portal-url'))) : false;
533 - $nav_urls['recentchangeslinked'] = array('href' => htmlspecialchars( $this->makeSpecialUrl('Recentchangeslinked', 'target='.urlencode( $this->thispage ))));
534533 $nav_urls['bugreports'] = array('href' => htmlspecialchars( $this->makeI18nUrl('bugreportspage')));
535534 // $nav_urls['sitesupport'] = array('href' => htmlspecialchars( $this->makeI18nUrl('sitesupportpage')));
536535 $nav_urls['sitesupport'] = array('href' => htmlspecialchars( $wgSiteSupportPage));
@@ -539,6 +538,11 @@
540539 }
541540 $nav_urls['specialpages'] = array('href' => htmlspecialchars( $this->makeSpecialUrl('Specialpages')));
542541
 542+ if( $wgTitle->getNamespace() != NS_SPECIAL) {
 543+ $nav_urls['whatlinkshere'] = array('href' => htmlspecialchars( $this->makeSpecialUrl('Whatlinkshere', 'target='.urlencode( $this->thispage ))));
 544+ $nav_urls['recentchangeslinked'] = array('href' => htmlspecialchars( $this->makeSpecialUrl('Recentchangeslinked', 'target='.urlencode( $this->thispage ))));
 545+ }
 546+
543547 if( $wgTitle->getNamespace() == NS_USER || $wgTitle->getNamespace() == NS_USER_TALK ) {
544548 $id = User::idFromName($wgTitle->getText());
545549 $ip = User::isIP($wgTitle->getText());
@@ -560,7 +564,6 @@
561565 }
562566 }
563567
564 -
565568 return $nav_urls;
566569 }
567570

Status & tagging log