/** * Save comment. * @param $args array * @param $request object */ function saveComment($args, $request) { $articleId = (int) $request->getUserVar('articleId'); $commentId = (int) $request->getUserVar('commentId'); $this->addCheck(new HandlerValidatorSubmissionComment($this, $commentId)); $this->validate($request, $articleId); $this->setupTemplate(true); // If the user pressed the "Save and email" button, then email the comment. $emailComment = $request->getUserVar('saveAndEmail') != null ? true : false; LayoutEditorAction::saveComment($this->submission, $this->comment, $emailComment, $request); // Redirect back to initial comments page if ($this->comment->getCommentType() == COMMENT_TYPE_LAYOUT) { $request->redirect(null, null, 'viewLayoutComments', $articleId); } else { if ($this->comment->getCommentType() == COMMENT_TYPE_PROOFREAD) { $request->redirect(null, null, 'viewProofreadComments', $articleId); } } }
/** * Save comment. */ function saveComment() { LayoutEditorHandler::validate(); LayoutEditorHandler::setupTemplate(true); $articleId = Request::getUserVar('articleId'); $commentId = Request::getUserVar('commentId'); // If the user pressed the "Save and email" button, then email the comment. $emailComment = Request::getUserVar('saveAndEmail') != null ? true : false; list($journal, $submission) = SubmissionLayoutHandler::validate($articleId); list($comment) = SubmissionCommentsHandler::validate($commentId); LayoutEditorAction::saveComment($submission, $comment, $emailComment); // Redirect back to initial comments page if ($comment->getCommentType() == COMMENT_TYPE_LAYOUT) { Request::redirect(null, null, 'viewLayoutComments', $articleId); } else { if ($comment->getCommentType() == COMMENT_TYPE_PROOFREAD) { Request::redirect(null, null, 'viewProofreadComments', $articleId); } } }