public function MatomoBase::buildSettingsForm in Dashboards with Layout Builder 8
Same name and namespace in other branches
- 2.0.x modules/dashboards_matomo/src/Plugin/Dashboard/MatomoBase.php \Drupal\dashboards_matomo\Plugin\Dashboard\MatomoBase::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
2 calls to MatomoBase::buildSettingsForm()
- TopUrls::buildSettingsForm in modules/
dashboards_matomo/ src/ Plugin/ Dashboard/ TopUrls.php - Build render array.
- VisitStatistic::buildSettingsForm in modules/
dashboards_matomo/ src/ Plugin/ Dashboard/ VisitStatistic.php - Build render array.
2 methods override MatomoBase::buildSettingsForm()
- TopUrls::buildSettingsForm in modules/
dashboards_matomo/ src/ Plugin/ Dashboard/ TopUrls.php - Build render array.
- VisitStatistic::buildSettingsForm in modules/
dashboards_matomo/ src/ Plugin/ Dashboard/ VisitStatistic.php - Build render array.
File
- modules/
dashboards_matomo/ src/ Plugin/ Dashboard/ MatomoBase.php, line 239
Class
- MatomoBase
- Base class for matomo plugins.
Namespace
Drupal\dashboards_matomo\Plugin\DashboardCode
public function buildSettingsForm(array $form, FormStateInterface $form_state, array $configuration) : array {
$form['period'] = [
'#type' => 'select',
'#options' => [
'day' => $this
->t('Day'),
'week' => $this
->t('Week'),
'month' => $this
->t('Month'),
'year' => $this
->t('Year'),
],
'#default_value' => isset($configuration['period']) ? $configuration['period'] : 'day',
];
$form['date'] = [
'#type' => 'select',
'#options' => [
'last_seven_days' => $this
->t('Last seven days'),
'this_week' => $this
->t('This week'),
'this_month' => $this
->t('This month'),
'last_three_months' => $this
->t('Last 3 months'),
'last_six_months' => $this
->t('Last 6 months'),
'year' => $this
->t('This year'),
],
'#default_value' => isset($configuration['date']) ? $configuration['date'] : 'today',
];
$form['chart_type'] = [
'#type' => 'select',
'#options' => $this
->getAllowedStyles(),
'#default_value' => isset($configuration['chart_type']) ? $configuration['chart_type'] : 'bar',
];
$form['legend'] = [
'#type' => 'checkbox',
'#title' => $this
->t('Show legend'),
'#default_value' => isset($configuration['legend']) ? $configuration['legend'] : 0,
];
return $form;
}