If not specified it will default to $wgScriptPath/extensions
* Added $wgCountTotalSearchHits to make search UI display total number of hits
with some search engines.
+* Added $wgAdvertisedFeedTypes to decide what feed types (RSS, Atom, both, or
+ neither) MediaWiki advertises. Default is array( 'rss' ), so Atom is no
+ longer advertised by default (but it still works).
=== New features in 1.16 ===
*/
$wgOverrideSiteFeed = array();
+/**
+ * Which feed types should we provide by default? This can include 'rss',
+ * 'atom', neither, or both.
+ */
+$wgAdvertisedFeedTypes = array( 'rss' );
+
/**
* Additional namespaces. If the namespaces defined in Language.php and
* Namespace.php are insufficient, you can create new ones here, for example,
}
public function setFeedAppendQuery( $val ) {
- global $wgFeedClasses;
+ global $wgFeedClasses, $wgAdvertisedFeedTypes;
$this->mFeedLinks = array();
- foreach( $wgFeedClasses as $type => $class ) {
+ foreach ( $wgAdvertisedFeedTypes as $type ) {
$query = "feed=$type";
- if ( is_string( $val ) )
+ if ( is_string( $val ) ) {
$query .= '&' . $val;
+ }
$this->mFeedLinks[$type] = $this->getTitle()->getLocalURL( $query );
}
}
$tags[] = $this->feedLink(
$format,
$link,
- wfMsg( "page-{$format}-feed", $this->getTitle()->getPrefixedText() ) ); # Used messages: 'page-rss-feed' and 'page-atom-feed' (for an easier grep)
+ # Used messages: 'page-rss-feed' and 'page-atom-feed' (for an easier grep)
+ wfMsg( "page-{$format}-feed", $this->getTitle()->getPrefixedText() ) );
}
# Recent changes feed should appear on every page (except recentchanges,
# or "Breaking news" one). For this, we see if $wgOverrideSiteFeed is defined.
# If so, use it instead.
- global $wgOverrideSiteFeed, $wgSitename, $wgFeedClasses;
+ global $wgOverrideSiteFeed, $wgSitename, $wgFeedClasses, $wgAdvertisedFeedTypes;
$rctitle = SpecialPage::getTitleFor( 'Recentchanges' );
if ( $wgOverrideSiteFeed ) {
htmlspecialchars( $feedUrl ),
wfMsg( "site-{$type}-feed", $wgSitename ) );
}
- }
- else if ( $this->getTitle()->getPrefixedText() != $rctitle->getPrefixedText() ) {
- foreach( $wgFeedClasses as $format => $class ) {
+ } elseif ( $this->getTitle()->getPrefixedText() != $rctitle->getPrefixedText() ) {
+ foreach ( $wgAdvertisedFeedTypes as $format ) {
$tags[] = $this->feedLink(
$format,
$rctitle->getLocalURL( "feed={$format}" ),