4 * Contains \Drupal\bootstrap\Plugin\Setting\JavaScript\Modals\ModalEnabled.
7 namespace Drupal\bootstrap\Plugin\Setting\JavaScript\Modals;
9 use Drupal\bootstrap\Annotation\BootstrapSetting;
10 use Drupal\bootstrap\Plugin\Setting\SettingBase;
11 use Drupal\bootstrap\Utility\Element;
12 use Drupal\Core\Annotation\Translation;
13 use Drupal\Core\Form\FormStateInterface;
16 * The "modal_enabled" theme setting.
18 * @ingroup plugins_setting
21 * id = "modal_enabled",
23 * title = @Translation("Enable Bootstrap Modals"),
24 * description = @Translation("Enabling this will replace core's jQuery UI Dialog implementations with modals from the Bootstrap Framework."),
28 * "javascript" = @Translation("JavaScript"),
29 * "modals" = @Translation("Modals"),
33 class ModalEnabled extends SettingBase {
38 public function alterFormElement(Element $form, FormStateInterface $form_state, $form_id = NULL) {
39 parent::alterFormElement($form, $form_state, $form_id);
40 $group = $this->getGroupElement($form, $form_state);
41 $group->setProperty('description', t('Modals are streamlined, but flexible, dialog prompts with the minimum required functionality and smart defaults. See <a href=":url" target="_blank">Bootstrap Modals</a> for more documentation.', [
42 ':url' => 'http://getbootstrap.com/javascript/#modals',
49 public function getCacheTags() {
50 return ['rendered', 'library_info'];