You are here

public function Comments::buildSettingsForm in Dashboards with Layout Builder 2.0.x

Same name and namespace in other branches
  1. 8 modules/dashboards_comments/src/Plugin/Dashboard/Comments.php \Drupal\dashboards_comments\Plugin\Dashboard\Comments::buildSettingsForm()

Build render array.

Parameters

array $form: Default form.

\Drupal\Core\Form\FormStateInterface $form_state: Default form.

array $configuration: Configuration.

Return value

array Return form array.

Overrides DashboardBase::buildSettingsForm

File

modules/dashboards_comments/src/Plugin/Dashboard/Comments.php, line 76

Class

Comments
Plugin for comment reports.

Namespace

Drupal\dashboards_comments\Plugin\Dashboard

Code

public function buildSettingsForm(array $form, FormStateInterface $form_state, array $configuration) : array {
  $options = [
    'totalcount' => $this
      ->t('Total count'),
    'daycount' => $this
      ->t('Dayly count'),
  ];
  $form['count'] = [
    '#type' => 'select',
    '#options' => $options,
    '#default_value' => isset($configuration['count']) ? $configuration['count'] : FALSE,
  ];
  return $form;
}