You are here

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

Same name and namespace in other branches
  1. 8 modules/dashboards_matomo/src/Plugin/Dashboard/VisitStatistic.php \Drupal\dashboards_matomo\Plugin\Dashboard\VisitStatistic::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 MatomoBase::buildSettingsForm

File

modules/dashboards_matomo/src/Plugin/Dashboard/VisitStatistic.php, line 40

Class

VisitStatistic
Show account info.

Namespace

Drupal\dashboards_matomo\Plugin\Dashboard

Code

public function buildSettingsForm(array $form, FormStateInterface $form_state, array $configuration) : array {
  $form = parent::buildSettingsForm($form, $form_state, $configuration);
  $form['fields'] = [
    '#type' => 'checkboxes',
    '#options' => $this
      ->getChartColumns(),
    '#multiple' => TRUE,
    '#default_value' => $configuration['fields'],
    '#title' => $this
      ->t('Stats to show'),
  ];
  return $form;
}