Allow setting of moderation in _config

git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@39719 467b73ca-7a2a-4603-9d3b-597d59a354a9
This commit is contained in:
Andrew O'Neil 2007-08-07 23:18:30 +00:00
parent 12069c6a96
commit 9099fa1474
2 changed files with 6 additions and 0 deletions

View File

@ -151,6 +151,10 @@ class PageComment extends DataObject {
static function enableModeration() {
self::$moderate = true;
}
static function moderationEnabled() {
return self::moderate;
}
}
?>

View File

@ -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 {