Sets the value governing the previewing mode for the comment form.
int $mode: The preview mode: DRUPAL_DISABLED, DRUPAL_OPTIONAL or DRUPAL_REQUIRED.
function setCommentPreview($mode) {
switch ($mode) {
case DRUPAL_DISABLED:
$mode_text = 'disabled';
break;
case DRUPAL_OPTIONAL:
$mode_text = 'optional';
break;
case DRUPAL_REQUIRED:
$mode_text = 'required';
break;
}
$this
->setCommentSettings('comment_preview', $mode, format_string('Comment preview @mode_text.', array(
'@mode_text' => $mode_text,
)));
}