mirror of
https://github.com/silverstripe/silverstripe-reports
synced 2024-10-22 11:05:53 +02:00
FEATURE: If there is no Name set, but there is an author, use the author's name (from r89650)
git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@89827 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
780338c6d7
commit
de82c4620a
@ -45,6 +45,14 @@ class PageComment extends DataObject {
|
||||
return $this->Parent()->Link() . '#PageComment_'. $this->ID;
|
||||
}
|
||||
|
||||
function getRSSName() {
|
||||
if($this->Name) {
|
||||
return $this->Name;
|
||||
} elseif($this->Author()) {
|
||||
return $this->Author()->getName();
|
||||
}
|
||||
}
|
||||
|
||||
function ParsedBBCode(){
|
||||
$parser = new BBCodeParser($this->Comment);
|
||||
return $parser->parse();
|
||||
@ -95,7 +103,7 @@ class PageComment extends DataObject {
|
||||
function RSSTitle() {
|
||||
return sprintf(
|
||||
_t('PageComment.COMMENTBY', "Comment by '%s' on %s", PR_MEDIUM, 'Name, Page Title'),
|
||||
Convert::raw2xml($this->Name),
|
||||
Convert::raw2xml($this->getRSSName()),
|
||||
$this->Parent()->Title
|
||||
);
|
||||
}
|
||||
@ -173,7 +181,7 @@ class PageComment_Controller extends Controller {
|
||||
$comments = new DataObjectSet();
|
||||
}
|
||||
|
||||
$rss = new RSSFeed($comments, "home/", "Page comments", "", "RSSTitle", "Comment", "Name");
|
||||
$rss = new RSSFeed($comments, "home/", "Page comments", "", "RSSTitle", "Comment", "RSSName");
|
||||
$rss->outputToBrowser();
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user