mirror of
https://github.com/silverstripe/silverstripe-reports
synced 2024-10-22 11:05:53 +02:00
Merged revisions 52296 via svnmerge from
http://svn.silverstripe.com/open/modules/cms/branches/2.2.2 ........ r52296 | aoneil | 2008-04-08 12:28:37 +1200 (Tue, 08 Apr 2008) | 2 lines Fix pagecomment links and feeds ........ git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@53496 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
parent
83db9bfa3b
commit
e395446f66
@ -17,6 +17,8 @@ Director::addRules(50, array(
|
|||||||
'admin/bulkload/$Action/$ID/$OtherID' => 'BulkLoaderAdmin',
|
'admin/bulkload/$Action/$ID/$OtherID' => 'BulkLoaderAdmin',
|
||||||
'admin/ImageEditor/$Action' => 'ImageEditor',
|
'admin/ImageEditor/$Action' => 'ImageEditor',
|
||||||
'admin/$Action/$ID/$OtherID' => 'CMSMain',
|
'admin/$Action/$ID/$OtherID' => 'CMSMain',
|
||||||
|
'unsubscribe/$Email/$MailingList' => 'Unsubscribe_Controller',
|
||||||
|
'PageComment/$Action/$ID' => 'PageComment_Controller'
|
||||||
));
|
));
|
||||||
|
|
||||||
// Built-in modules
|
// Built-in modules
|
||||||
|
@ -51,20 +51,6 @@ class PageComment extends DataObject {
|
|||||||
return "PageComment/deletecomment/$this->ID";
|
return "PageComment/deletecomment/$this->ID";
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
function deletecomment() {
|
|
||||||
if(Permission::check('CMS_ACCESS_CMSMain')) {
|
|
||||||
$comment = DataObject::get_by_id("PageComment", $this->urlParams['ID']);
|
|
||||||
if($comment) {
|
|
||||||
$comment->delete();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if(Director::is_ajax()) {
|
|
||||||
echo "";
|
|
||||||
} else {
|
|
||||||
Director::redirectBack();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
function SpamLink() {
|
function SpamLink() {
|
||||||
$member = Member::currentUser();
|
$member = Member::currentUser();
|
||||||
@ -95,6 +81,68 @@ 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),
|
||||||
|
$this->Parent()->Title
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
function PageTitle() {
|
||||||
|
return $this->Parent()->Title;
|
||||||
|
}
|
||||||
|
|
||||||
|
static function enableModeration() {
|
||||||
|
self::$moderate = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
static function moderationEnabled() {
|
||||||
|
return self::$moderate;
|
||||||
|
}
|
||||||
|
|
||||||
|
static function enableBBCode() {
|
||||||
|
self::$bbcode = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
static function bbCodeEnabled() {
|
||||||
|
return self::$bbcode;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
class PageComment_Controller extends Controller {
|
||||||
|
function rss() {
|
||||||
|
$parentcheck = isset($_REQUEST['pageid']) ? "ParentID = " . (int) $_REQUEST['pageid'] : "ParentID > 0";
|
||||||
|
$comments = DataObject::get("PageComment", "$parentcheck AND IsSpam=0", "Created DESC", "", 10);
|
||||||
|
if(!isset($comments)) {
|
||||||
|
$comments = new DataObjectSet();
|
||||||
|
}
|
||||||
|
|
||||||
|
$rss = new RSSFeed($comments, "home/", "Page comments", "", "RSSTitle", "Comment", "Name");
|
||||||
|
$rss->outputToBrowser();
|
||||||
|
}
|
||||||
|
|
||||||
|
function deletecomment() {
|
||||||
|
if(Permission::check('CMS_ACCESS_CMSMain')) {
|
||||||
|
$comment = DataObject::get_by_id("PageComment", $this->urlParams['ID']);
|
||||||
|
if($comment) {
|
||||||
|
$comment->delete();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if(Director::is_ajax()) {
|
||||||
|
echo "";
|
||||||
|
} else {
|
||||||
|
Director::redirectBack();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
function approve() {
|
function approve() {
|
||||||
if(Permission::check('CMS_ACCESS_CMSMain')) {
|
if(Permission::check('CMS_ACCESS_CMSMain')) {
|
||||||
$comment = DataObject::get_by_id("PageComment", $this->urlParams['ID']);
|
$comment = DataObject::get_by_id("PageComment", $this->urlParams['ID']);
|
||||||
@ -174,47 +222,6 @@ 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),
|
|
||||||
$this->Parent()->Title
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
function rss() {
|
|
||||||
$parentcheck = isset($_REQUEST['pageid']) ? "ParentID = " . (int) $_REQUEST['pageid'] : "ParentID > 0";
|
|
||||||
$comments = DataObject::get("PageComment", "$parentcheck AND IsSpam=0", "Created DESC", "", 10);
|
|
||||||
if(!isset($comments)) {
|
|
||||||
$comments = new DataObjectSet();
|
|
||||||
}
|
|
||||||
|
|
||||||
$rss = new RSSFeed($comments, "home/", "Page comments", "", "RSSTitle", "Comment", "Name");
|
|
||||||
$rss->outputToBrowser();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
function PageTitle() {
|
|
||||||
return $this->Parent()->Title;
|
|
||||||
}
|
|
||||||
|
|
||||||
static function enableModeration() {
|
|
||||||
self::$moderate = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
static function moderationEnabled() {
|
|
||||||
return self::$moderate;
|
|
||||||
}
|
|
||||||
|
|
||||||
static function enableBBCode() {
|
|
||||||
self::$bbcode = true;
|
|
||||||
}
|
|
||||||
|
|
||||||
static function bbCodeEnabled() {
|
|
||||||
return self::$bbcode;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
||||||
|
Loading…
Reference in New Issue
Block a user