public function UnpublishByKeywordComment::form

Form constructor.

Parameters

array $form: An associative array containing the structure of the form.

array $form_state: An associative array containing the current state of the form.

Return value

array The form structure.

Overrides ConfigurableActionInterface::form

File

drupal/core/modules/comment/lib/Drupal/comment/Plugin/Action/UnpublishByKeywordComment.php, line 52
Contains \Drupal\comment\Plugin\Action\UnpublishByKeywordComment.

Class

UnpublishByKeywordComment
Unpublishes a comment containing certain keywords.

Namespace

Drupal\comment\Plugin\Action

Code

public function form(array $form, array &$form_state) {
  $form['keywords'] = array(
    '#title' => t('Keywords'),
    '#type' => 'textarea',
    '#description' => t('The comment will be unpublished if it contains any of the phrases above. Use a case-sensitive, comma-separated list of phrases. Example: funny, bungee jumping, "Company, Inc."'),
    '#default_value' => drupal_implode_tags($this->configuration['keywords']),
  );
  return $form;
}