You are here

public function Account::buildSettingsForm in Dashboards with Layout Builder 8

Same name and namespace in other branches
  1. 2.0.x src/Plugin/Dashboard/Account.php \Drupal\dashboards\Plugin\Dashboard\Account::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

src/Plugin/Dashboard/Account.php, line 82

Class

Account
Show account info.

Namespace

Drupal\dashboards\Plugin\Dashboard

Code

public function buildSettingsForm(array $form, FormStateInterface $form_state, array $configuration) : array {
  $form['view_mode'] = [
    '#type' => 'select',
    '#options' => $this->entityDisplayRepository
      ->getViewModeOptions('user'),
    '#default_value' => isset($configuration['view_mode']) ? $configuration['view_mode'] : FALSE,
  ];
  return $form;
}