You are here

public function ThemeAdminForm::buildForm in Zircon Profile 8

Same name and namespace in other branches
  1. 8.0 core/modules/system/src/Form/ThemeAdminForm.php \Drupal\system\Form\ThemeAdminForm::buildForm()

Form constructor.

Parameters

array $form: An associative array containing the structure of the form.

\Drupal\Core\Form\FormStateInterface $form_state: The current state of the form.

Return value

array The form structure.

Overrides ConfigFormBase::buildForm

File

core/modules/system/src/Form/ThemeAdminForm.php, line 34
Contains \Drupal\system\Form\ThemeAdminForm.

Class

ThemeAdminForm
Form to select the administration theme.

Namespace

Drupal\system\Form

Code

public function buildForm(array $form, FormStateInterface $form_state, array $theme_options = NULL) {

  // Administration theme settings.
  $form['admin_theme'] = array(
    '#type' => 'details',
    '#title' => $this
      ->t('Administration theme'),
    '#open' => TRUE,
  );
  $form['admin_theme']['admin_theme'] = array(
    '#type' => 'select',
    '#options' => array(
      0 => $this
        ->t('Default theme'),
    ) + $theme_options,
    '#title' => $this
      ->t('Administration theme'),
    '#description' => $this
      ->t('Choose "Default theme" to always use the same theme as the rest of the site.'),
    '#default_value' => $this
      ->config('system.theme')
      ->get('admin'),
  );
  $form['admin_theme']['actions'] = array(
    '#type' => 'actions',
  );
  $form['admin_theme']['actions']['submit'] = array(
    '#type' => 'submit',
    '#value' => $this
      ->t('Save configuration'),
    '#button_type' => 'primary',
  );
  return $form;
}