(bug 5412) Add feed links for the site (i.e., Recentchanges) to all pages.
authorAryeh Gregor <simetrical@users.mediawiki.org>
Mon, 24 Sep 2007 04:43:23 +0000 (04:43 +0000)
committerAryeh Gregor <simetrical@users.mediawiki.org>
Mon, 24 Sep 2007 04:43:23 +0000 (04:43 +0000)
RELEASE-NOTES
includes/OutputPage.php
includes/SpecialRecentchanges.php
languages/messages/MessagesEn.php

index 4445e08..2c5fe6a 100644 (file)
@@ -27,6 +27,7 @@ it from source control: http://www.mediawiki.org/wiki/Download_from_SVN
 * (bug 11136) If using Postgres, search path is explicitly set if wgDBmwschema is 
   not set to 'mediawiki', allowing multiple mediawiki instances per user.
 * (bug 11151) Add descriptive <title> to revision history page
+* (bug 5412) Add feed links for the site to all pages
 
 === Bug fixes in 1.12 ===
 
index 60cf395..9fa2d40 100644 (file)
@@ -1277,12 +1277,31 @@ class OutputPage {
                        }
                        $ret .= " />\n";
                }
+               
+               # Recent changes feed should appear on every page
+               global $wgSitename;
+               $rctitle = SpecialPage::getTitleFor( 'Recentchanges' );
+               $link = $rctitle->escapeFullURL( 'feed=rss' );
+               $title = wfMsg( 'site-rss-feed', $wgSitename );
+               $ret .= "<link rel='alternate' type='application/rss+xml' title='$title' href='$link' />\n";
+               $link = $rctitle->escapeFullURL( 'feed=atom' );
+               $title = wfMsg( 'site-atom-feed', $wgSitename );
+               $ret .= "<link rel='alternate' type='application/atom+xml' title='$title' href='$link' />\n";
+
                if( $this->isSyndicated() ) {
                        # FIXME: centralize the mime-type and name information in Feed.php
                        $link = $wgRequest->escapeAppendQuery( 'feed=rss' );
-                       $ret .= "<link rel='alternate' type='application/rss+xml' title='RSS 2.0' href='$link' />\n";
+                       # Use the page name for the title (accessed through $wgTitle since
+                       # there's no other way).  In principle, this could lead to issues
+                       # with having the same name for different feeds corresponding to
+                       # the same page, but we can't avoid that at this low a level.
+                       global $wgTitle;
+                       $pagetitle = $wgTitle->getPrefixedText();
+                       $title = wfMsg( 'page-rss-feed', $pagetitle );
+                       $ret .= "<link rel='alternate' type='application/rss+xml' title='$title' href='$link' />\n";
                        $link = $wgRequest->escapeAppendQuery( 'feed=atom' );
-                       $ret .= "<link rel='alternate' type='application/atom+xml' title='Atom 1.0' href='$link' />\n";
+                       $title = wfMsg( 'page-atom-feed', $pagetitle );
+                       $ret .= "<link rel='alternate' type='application/atom+xml' title='$title' href='$link' />\n";
                }
 
                return $ret;
index 2d70209..2744cd8 100644 (file)
@@ -220,8 +220,6 @@ function wfSpecialRecentchanges( $par, $specialPage ) {
                }
 
                // And now for the content
-               $wgOut->setSyndicated( true );
-
                $list = ChangesList::newFromUser( $wgUser );
                
                if ( $wgAllowCategorizedRecentChanges ) {
index 0d01970..bb35d61 100644 (file)
@@ -706,6 +706,10 @@ XHTML id names.
 'restorelink'             => '{{PLURAL:$1|one deleted edit|$1 deleted edits}}',
 'feedlinks'               => 'Feed:',
 'feed-invalid'            => 'Invalid subscription feed type.',
+'site-rss-feed'           => '$1 RSS Feed',
+'site-atom-feed'          => '$1 Atom Feed',
+'page-rss-feed'           => '"$1" RSS Feed',
+'page-atom-feed'          => '"$1" Atom Feed',
 'feed-atom'               => 'Atom', # only translate this message to other languages if you have to change it
 'feed-rss'                => 'RSS', # only translate this message to other languages if you have to change it
 'sitenotice'              => '-', # the equivalent to wgSiteNotice; don't translate or duplicate this message to other languages