From 1c48ef7b6131ccdac38151429a7c460773cafa1f Mon Sep 17 00:00:00 2001 From: Sam Minnee Date: Wed, 13 Oct 2010 04:19:06 +0000 Subject: [PATCH] MINOR: added moderation message for non-ajax mode (from r103555) git-svn-id: svn://svn.silverstripe.com/silverstripe/open/modules/cms/trunk@112171 467b73ca-7a2a-4603-9d3b-597d59a354a9 --- code/sitefeatures/PageCommentInterface.php | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/code/sitefeatures/PageCommentInterface.php b/code/sitefeatures/PageCommentInterface.php index 3ea5a374..8d091acb 100755 --- a/code/sitefeatures/PageCommentInterface.php +++ b/code/sitefeatures/PageCommentInterface.php @@ -330,13 +330,19 @@ class PageCommentInterface_Form extends Form { $comment->write(); Cookie::set("PageCommentInterface_Comment", ''); + + $moderationMsg = _t('PageCommentInterface_Form.AWAITINGMODERATION', "Your comment has been submitted and is now awaiting moderation."); + if($this->controller->isAjax()) { if($comment->NeedsModeration){ - echo _t('PageCommentInterface_Form.AWAITINGMODERATION', "Your comment has been submitted and is now awaiting moderation."); + echo $moderationMsg; } else{ echo $comment->renderWith('PageCommentInterface_singlecomment'); } } else { + if($comment->NeedsModeration){ + $this->sessionMessage($moderationMsg, 'good'); + } // since it is not ajax redirect user down to their comment since it has been posted // get the pages url off the comments parent ID. if($comment->ParentID) {