You are here

public function AMP::buildForm in Thunder 8.4

Same name and namespace in other branches
  1. 8.2 src/Plugin/Thunder/OptionalModule/AMP.php \Drupal\thunder\Plugin\Thunder\OptionalModule\AMP::buildForm()
  2. 8.3 src/Plugin/Thunder/OptionalModule/AMP.php \Drupal\thunder\Plugin\Thunder\OptionalModule\AMP::buildForm()

Overrides AbstractOptionalModule::buildForm

File

src/Plugin/Thunder/OptionalModule/AMP.php, line 22

Class

AMP
AMP.

Namespace

Drupal\thunder\Plugin\Thunder\OptionalModule

Code

public function buildForm(array $form, FormStateInterface $form_state) {
  $form = parent::buildForm($form, $form_state);
  if (!class_exists('\\Lullabot\\AMP\\AMP')) {
    $form['thunder_amp']['library_info'] = [
      '#type' => 'item',
      '#description' => $this
        ->t("ATTENTION: Due to licensing issues,\n        you have to download the needed library manually, before activating this module.\n        With composer installed execute the command `composer require lullabot/amp`\n        in the docroot of your installation."),
    ];
  }
  else {
    unset($form['thunder_amp']);
  }
  return $form;
}