You are here

function ajax_comments_field_formatter_settings_summary_alter in AJAX Comments 8

Implements hook_field_formatter_settings_summary_alter().

File

./ajax_comments.module, line 370
AJAX comments module file.

Code

function ajax_comments_field_formatter_settings_summary_alter(&$summary, $context) {
  if ($context['field_definition']
    ->getType() === 'comment') {
    $status = \Drupal::service('ajax_comments.field_settings_helper')
      ->isEnabled($context['formatter']);
    if ($status) {
      $summary[] = t('Ajax comments enabled on this field.');
    }
    else {
      $summary[] = t('Ajax comments disabled on this field.');
    }
  }
}