You are here

AdminForm.php in Openlayers 8.4

File

src/Form/AdminForm.php
View source
<?php

namespace Drupal\openlayers\Form;

use Drupal\Core\Form\ConfigFormBase;
use Drupal\Core\Form\FormStateInterface;

/**
 * Contains the Admin Form for the Openlayers module.
 */
class AdminForm extends ConfigFormBase {

  /**
   * {@inheritdoc}
   */
  protected function getEditableConfigNames() {
    return [
      'openlayers.adminsettings',
    ];
  }

  /**
   * {@inheritdoc}
   */
  public function getFormId() {
    return 'openlayers_admin_form';
  }

  /**
   * {@inheritdoc}
   */
  public function buildForm(array $form, FormStateInterface $form_state) {
    $form['main'] = [
      '#type' => 'markup',
      '#markup' => $this
        ->t('TODO: Main admin screen'),
    ];
    $form['actions']['reset'] = [
      '#type' => 'submit',
      '#value' => $this
        ->t('Reset to defaults'),
      '#name' => 'reset',
      '#button_type' => 'primary',
      '#weight' => 10,
    ];
    return parent::buildForm($form, $form_state);
  }

  /**
   * {@inheritdoc}
   */
  public function submitForm(array &$form, FormStateInterface $form_state) {
  }

}

Classes

Namesort descending Description
AdminForm Contains the Admin Form for the Openlayers module.