mirror of
https://github.com/silverstripe/silverstripe-cms
synced 2024-10-22 08:05:56 +02:00
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:
parent
12069c6a96
commit
9099fa1474
@ -151,6 +151,10 @@ class PageComment extends DataObject {
|
|||||||
static function enableModeration() {
|
static function enableModeration() {
|
||||||
self::$moderate = true;
|
self::$moderate = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static function moderationEnabled() {
|
||||||
|
return self::moderate;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
?>
|
?>
|
@ -140,6 +140,8 @@ class PageCommentInterface_Form extends Form {
|
|||||||
$comment->IsSpam = false;
|
$comment->IsSpam = false;
|
||||||
$comment->write();
|
$comment->write();
|
||||||
|
|
||||||
|
$comment->NeedsModeration = PageComment::moderationEnable();
|
||||||
|
|
||||||
if(Director::is_ajax()) {
|
if(Director::is_ajax()) {
|
||||||
echo $comment->renderWith('PageCommentInterface_singlecomment');
|
echo $comment->renderWith('PageCommentInterface_singlecomment');
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user