1 comment.test | CommentHelperCase::setCommentPreview($mode) |
Sets the value governing the previewing mode for the comment form.
Parameters
int $mode: The preview mode: BACKDROP_DISABLED, BACKDROP_OPTIONAL or BACKDROP_REQUIRED.
File
- core/
modules/ comment/ tests/ comment.test, line 223 - Tests for the Comment module.
Class
Code
function setCommentPreview($mode) {
switch ($mode) {
case BACKDROP_DISABLED:
$mode_text = 'disabled';
break;
case BACKDROP_OPTIONAL:
$mode_text = 'optional';
break;
case BACKDROP_REQUIRED:
$mode_text = 'required';
break;
}
$this->setCommentSettings('comment_preview', $mode, format_string('Comment preview @mode_text.', array('@mode_text' => $mode_text)));
}