From 9099fa14744d82c1a850121174356f1074685a0f Mon Sep 17 00:00:00 2001 From: Andrew O'Neil Date: Tue, 7 Aug 2007 23:18:30 +0000 Subject: [PATCH] Allow setting of moderation in _config git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@39719 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- code/sitefeatures/PageComment.php | 4 ++++ code/sitefeatures/PageCommentInterface.php | 2 ++ 2 files changed, 6 insertions(+) diff --git a/code/sitefeatures/PageComment.php b/code/sitefeatures/PageComment.php index e774d741..5b775e67 100755 --- a/code/sitefeatures/PageComment.php +++ b/code/sitefeatures/PageComment.php @@ -151,6 +151,10 @@ class PageComment extends DataObject { static function enableModeration() { self::$moderate = true; } + + static function moderationEnabled() { + return self::moderate; + } } ?> \ No newline at end of file diff --git a/code/sitefeatures/PageCommentInterface.php b/code/sitefeatures/PageCommentInterface.php index df565534..db8bda03 100755 --- a/code/sitefeatures/PageCommentInterface.php +++ b/code/sitefeatures/PageCommentInterface.php @@ -140,6 +140,8 @@ class PageCommentInterface_Form extends Form { $comment->IsSpam = false; $comment->write(); + $comment->NeedsModeration = PageComment::moderationEnable(); + if(Director::is_ajax()) { echo $comment->renderWith('PageCommentInterface_singlecomment'); } else {