owner->getClassSettings()) { if($rss = $settings->getRSS()) { RSSFeed::linkToFeed($this->owner->Link() . "rss", $this->owner->Title); Object::addStaticVars($this->owner->class, array ( 'allowed_actions' => array ( 'rss' ) )); } } } /** * A controller action that returns a defined RSS feed for this page */ public function rss() { if($settings = $this->owner->getClassSettings()) { if($rss = $settings->getRSS()) { $component = $rss->getSubject(); if($component != "Children") { $component = singleton($settings->getKey())->getReverseAssociation($component); } if($records = $this->owner->{$component}()) { $r = new RSSFeed($records, $this->owner->Link(), $rss->getTitle(), $rss->getDescription(), $rss->getTitleField(), $rss->getContentField(), $rss->getAuthorField()); $r->outputToBrowser(); return; } } } return Director::redirectBack(); } /** * The link to the RSS feed. Points to {@link rss} * @return string */ public function RSSLink() { if($settings = $this->owner->getClassSettings()) { if($rss = $settings->getRSS()) { return $this->owner->Link('rss'); } } } }