AMP.php in Thunder 8.4
File
src/Plugin/Thunder/OptionalModule/AMP.php
View source
<?php
namespace Drupal\thunder\Plugin\Thunder\OptionalModule;
use Drupal\Core\Form\FormStateInterface;
class AMP extends AbstractOptionalModule {
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;
}
}