You are here

public function AbstractOptionalModule::buildForm in Thunder 8.2

Same name and namespace in other branches
  1. 8.3 src/Plugin/Thunder/OptionalModule/AbstractOptionalModule.php \Drupal\thunder\Plugin\Thunder\OptionalModule\AbstractOptionalModule::buildForm()
  2. 8.4 src/Plugin/Thunder/OptionalModule/AbstractOptionalModule.php \Drupal\thunder\Plugin\Thunder\OptionalModule\AbstractOptionalModule::buildForm()
8 calls to AbstractOptionalModule::buildForm()
Adsense::buildForm in src/Plugin/Thunder/OptionalModule/Adsense.php
AMP::buildForm in src/Plugin/Thunder/OptionalModule/AMP.php
GoogleAnalytics::buildForm in src/Plugin/Thunder/OptionalModule/GoogleAnalytics.php
Harbourmaster::buildForm in src/Plugin/Thunder/OptionalModule/Harbourmaster.php
IvwIntegration::buildForm in src/Plugin/Thunder/OptionalModule/IvwIntegration.php

... See full list

8 methods override AbstractOptionalModule::buildForm()
Adsense::buildForm in src/Plugin/Thunder/OptionalModule/Adsense.php
AMP::buildForm in src/Plugin/Thunder/OptionalModule/AMP.php
GoogleAnalytics::buildForm in src/Plugin/Thunder/OptionalModule/GoogleAnalytics.php
Harbourmaster::buildForm in src/Plugin/Thunder/OptionalModule/Harbourmaster.php
IvwIntegration::buildForm in src/Plugin/Thunder/OptionalModule/IvwIntegration.php

... See full list

File

src/Plugin/Thunder/OptionalModule/AbstractOptionalModule.php, line 68

Class

AbstractOptionalModule
Class AbstractOptionalModule.

Namespace

Drupal\thunder\Plugin\Thunder\OptionalModule

Code

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

  // Check if this method is overridden.
  $reflection = new \ReflectionClass($this);
  foreach ($reflection
    ->getMethods() as $method) {
    if ($method->name == 'buildForm') {
      if ($method->class != get_class($this)) {
        return $form;
      }
    }
  }
  $form[$this
    ->getBaseId()] = [
    '#type' => 'details',
    '#title' => $this->pluginDefinition['label'],
    '#open' => TRUE,
    '#states' => [
      'visible' => [
        ':input[name="install_modules_' . $this
          ->getBaseId() . '"]' => [
          'checked' => TRUE,
        ],
      ],
    ],
  ];
  return $form;
}