r26058 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r26057‎ | r26058 | r26059 >
Date:04:43, 24 September 2007
Author:simetrical
Status:old
Tags:
Comment:
(bug 5412) Add feed links for the site (i.e., Recentchanges) to all pages.
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/includes/OutputPage.php (modified) (history)
  • /trunk/phase3/includes/SpecialRecentchanges.php (modified) (history)
  • /trunk/phase3/languages/messages/MessagesEn.php (modified) (history)

Diff [purge]

Index: trunk/phase3/includes/SpecialRecentchanges.php
@@ -220,8 +220,6 @@
221221 }
222222
223223 // And now for the content
224 - $wgOut->setSyndicated( true );
225 -
226224 $list = ChangesList::newFromUser( $wgUser );
227225
228226 if ( $wgAllowCategorizedRecentChanges ) {
Index: trunk/phase3/includes/OutputPage.php
@@ -1277,12 +1277,31 @@
12781278 }
12791279 $ret .= " />\n";
12801280 }
 1281+
 1282+ # Recent changes feed should appear on every page
 1283+ global $wgSitename;
 1284+ $rctitle = SpecialPage::getTitleFor( 'Recentchanges' );
 1285+ $link = $rctitle->escapeFullURL( 'feed=rss' );
 1286+ $title = wfMsg( 'site-rss-feed', $wgSitename );
 1287+ $ret .= "<link rel='alternate' type='application/rss+xml' title='$title' href='$link' />\n";
 1288+ $link = $rctitle->escapeFullURL( 'feed=atom' );
 1289+ $title = wfMsg( 'site-atom-feed', $wgSitename );
 1290+ $ret .= "<link rel='alternate' type='application/atom+xml' title='$title' href='$link' />\n";
 1291+
12811292 if( $this->isSyndicated() ) {
12821293 # FIXME: centralize the mime-type and name information in Feed.php
12831294 $link = $wgRequest->escapeAppendQuery( 'feed=rss' );
1284 - $ret .= "<link rel='alternate' type='application/rss+xml' title='RSS 2.0' href='$link' />\n";
 1295+ # Use the page name for the title (accessed through $wgTitle since
 1296+ # there's no other way). In principle, this could lead to issues
 1297+ # with having the same name for different feeds corresponding to
 1298+ # the same page, but we can't avoid that at this low a level.
 1299+ global $wgTitle;
 1300+ $pagetitle = $wgTitle->getPrefixedText();
 1301+ $title = wfMsg( 'page-rss-feed', $pagetitle );
 1302+ $ret .= "<link rel='alternate' type='application/rss+xml' title='$title' href='$link' />\n";
12851303 $link = $wgRequest->escapeAppendQuery( 'feed=atom' );
1286 - $ret .= "<link rel='alternate' type='application/atom+xml' title='Atom 1.0' href='$link' />\n";
 1304+ $title = wfMsg( 'page-atom-feed', $pagetitle );
 1305+ $ret .= "<link rel='alternate' type='application/atom+xml' title='$title' href='$link' />\n";
12871306 }
12881307
12891308 return $ret;
Index: trunk/phase3/languages/messages/MessagesEn.php
@@ -706,6 +706,10 @@
707707 'restorelink' => '{{PLURAL:$1|one deleted edit|$1 deleted edits}}',
708708 'feedlinks' => 'Feed:',
709709 'feed-invalid' => 'Invalid subscription feed type.',
 710+'site-rss-feed' => '$1 RSS Feed',
 711+'site-atom-feed' => '$1 Atom Feed',
 712+'page-rss-feed' => '"$1" RSS Feed',
 713+'page-atom-feed' => '"$1" Atom Feed',
710714 'feed-atom' => 'Atom', # only translate this message to other languages if you have to change it
711715 'feed-rss' => 'RSS', # only translate this message to other languages if you have to change it
712716 'sitenotice' => '-', # the equivalent to wgSiteNotice; don't translate or duplicate this message to other languages
Index: trunk/phase3/RELEASE-NOTES
@@ -27,6 +27,7 @@
2828 * (bug 11136) If using Postgres, search path is explicitly set if wgDBmwschema is
2929 not set to 'mediawiki', allowing multiple mediawiki instances per user.
3030 * (bug 11151) Add descriptive <title> to revision history page
 31+* (bug 5412) Add feed links for the site to all pages
3132
3233 === Bug fixes in 1.12 ===
3334

Follow-up revisions

RevisionCommit summaryAuthorDate
r26077Clean up r26058, r26059 a bit...brion18:25, 24 September 2007
r26135Merged revisions 26012-26133 via svnmerge from...david21:15, 25 September 2007
r28647* Fix regression -- missing feed links in sidebar on Special:Recentchanges...brion01:33, 19 December 2007

Status & tagging log