* (bug 12195) Undeleting pages now requires 'undelete' permission
* (bug 11810) Localize displayed semicolons
* (bug 11657) Support for Thai solar calendar
+* (bug 943) RSS feed for Recentchangeslinked
=== Bug fixes in 1.12 ===
var $mIsArticleRelated;
protected $mParserOptions; // lazy initialised, use parserOptions()
var $mShowFeedLinks = false;
+ var $mFeedLinksAppendQuery = false;
var $mEnableClientCache = true;
var $mArticleBodyOnly = false;
public function isPrintable() { return $this->mPrintable; }
public function setSyndicated( $show = true ) { $this->mShowFeedLinks = $show; }
public function isSyndicated() { return $this->mShowFeedLinks; }
+ public function setFeedAppendQuery( $val ) { $this->mFeedLinksAppendQuery = $val; }
+ public function getFeedAppendQuery() { return $this->mFeedLinksAppendQuery; }
public function setOnloadHandler( $js ) { $this->mOnloadHandler = $js; }
public function getOnloadHandler() { return $this->mOnloadHandler; }
public function disable() { $this->mDoNothing = true; }
}
if( $this->isSyndicated() ) {
- # FIXME: centralize the mime-type and name information in Feed.php
# 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;
- $ret .= $this->feedLink(
- 'rss',
- $wgRequest->appendQuery( 'feed=rss' ),
- wfMsg( 'page-rss-feed', $wgTitle->getPrefixedText() ) );
- $ret .= $this->feedLink(
- 'atom',
- $wgRequest->appendQuery( 'feed=atom' ),
- wfMsg( 'page-atom-feed', $wgTitle->getPrefixedText() ) );
+ global $wgTitle, $wgFeedClasses;
+
+ if( is_string( $this->getFeedAppendQuery() ) ) {
+ $appendQuery = "&" . $this->getFeedAppendQuery();
+ } else {
+ $appendQuery = "";
+ }
+
+ foreach( $wgFeedClasses as $format => $class ) {
+ $ret .= $this->feedLink(
+ $format,
+ $wgRequest->appendQuery( "feed=rss{$appendQuery}" ),
+ wfMsg( "page-{$format}-feed", $wgTitle->getPrefixedText() ) );
+ }
}
# Recent changes feed should appear on every page
} else if ( $format == "rss" ) {
$linktext = wfMsg( 'feed-rss' );
}
+ if( is_string( $wgOut->getFeedAppendQuery() ) ) {
+ $appendQuery = "&" . $wgOut->getFeedAppendQuery();
+ } else {
+ $appendQuery = "";
+ }
$feeds[$format] = array(
'text' => $linktext,
- 'href' => $wgRequest->appendQuery( "feed=$format" )
+ 'href' => $wgRequest->appendQuery( "feed={$format}{$appendQuery}" )
);
}
$tpl->setRef( 'feeds', $feeds );
* @param string $par parent page we will look at
*/
function wfSpecialRecentchangeslinked( $par = NULL ) {
- global $wgUser, $wgOut, $wgLang, $wgContLang, $wgRequest;
+ global $wgUser, $wgOut, $wgLang, $wgContLang, $wgRequest, $wgTitle;
$fname = 'wfSpecialRecentchangeslinked';
$days = $wgRequest->getInt( 'days' );
$wgOut->setPageTitle( wfMsg( 'recentchangeslinked-title', $nt->getPrefixedText() ) );
$wgOut->setSubtitle( htmlspecialchars( wfMsg( 'rclsub', $nt->getPrefixedText() ) ) );
+ $wgOut->setSyndicated();
+ $wgOut->setFeedAppendQuery( "target=" . urlencode( $target ) );
if ( ! $days ) {
$days = (int)$wgUser->getOption( 'rcdays', 7 );
$s = $list->beginRecentChangesList();
$count = $dbr->numRows( $res );
+ $rchanges = array();
if ( $count ) {
$counter = 1;
while ( $limit ) {
$rc->counter = $counter++;
$s .= $list->recentChangesLine( $rc , !empty( $obj->wl_user) );
--$limit;
+ $rchanges[] = $obj;
}
} else {
$wgOut->addWikiText( wfMsg('recentchangeslinked-noresult') );
$dbr->freeResult( $res );
$wgOut->addHTML( $s );
+
+ global $wgSitename, $wgFeedClasses, $wgContLanguageCode;
+ $feedFormat = $wgRequest->getVal( 'feed' );
+ if( $feedFormat && isset( $wgFeedClasses[$feedFormat] ) ) {
+ $feedTitle = $wgSitename . ' - ' . wfMsgForContent( 'recentchangeslinked-title', $nt->getPrefixedText() ) . ' [' . $wgContLanguageCode . ']';
+ $feed = new $wgFeedClasses[$feedFormat]( $feedTitle,
+ htmlspecialchars( wfMsgForContent('recentchangeslinked') ), $wgTitle->getFullUrl() );
+
+ require_once( "SpecialRecentchanges.php" );
+ rcDoOutputFeed( $rchanges, $feed );
+
+ $wgOut->disable();
+ $feed->outHeader();
+ foreach( $feedItems as &$item ) {
+ $feed->outItem( $item );
+ }
+ $feed->outFooter();
+ }
}