class ModalAnimation

The "modal_animation" theme setting.

Plugin annotation

  id = "modal_animation",
  type = "checkbox",
  title = @Translation("animation"),
  description = @Translation("Apply a CSS fade transition to modals."),
  defaultValue = 1,
  groups = {
    "javascript" = @Translation("JavaScript"),
    "modals" = @Translation("Modals"),
    "options" = @Translation("Options"),


Expanded class hierarchy of ModalAnimation

Related topics


class ModalAnimation extends SettingBase {

   * {@inheritdoc}
  public function alterFormElement(Element $form, FormStateInterface $form_state, $form_id = NULL) {
    parent::alterFormElement($form, $form_state, $form_id);
    $group = $this->getGroupElement($form, $form_state);
    $group->note = [
      '#type' => 'container',
      '#weight' => -1,
      '#attributes' => ['class' => ['alert', 'alert-info', 'alert-sm']],
      0 => [
        '#markup' => t('<strong>Note:</strong> jQuery UI dialog options will be mapped to Bootstrap modal options whenever possible, however they always take precedent over any global Bootstrap modal options set here for compatibility reasons.'),
      '#states' => [
        'visible' => [
          ':input[name="modal_enabled"]' => ['checked' => TRUE],
          ':input[name="modal_jquery_ui_bridge"]' => ['checked' => TRUE],
    $group->setProperty('description', t('These are global options. Each modal can independently override desired settings by appending the option name to <code>data-</code>. Example: <code>data-backdrop="false"</code>.'));
    $group->setProperty('states', [
      'visible' => [
        ':input[name="modal_enabled"]' => ['checked' => TRUE],

   * {@inheritdoc}
  public function drupalSettings() {
    return !!$this->theme->getSetting('modal_enabled');



Contains filters are case sensitive
Name Modifiers Type Description
ModalAnimation::alterFormElement public function The alter method to store the code. Overrides SettingBase::alterFormElement
ModalAnimation::drupalSettings public function Determines whether a theme setting should added to drupalSettings. Overrides SettingBase::drupalSettings
PluginBase::$theme protected property The currently set theme object.
PluginBase::__construct public function
SettingBase::$autoUserInterface public static property
SettingBase::access public function Indicates whether a setting is accessible. Overrides SettingInterface::access
SettingBase::alterForm public function The alter method to store the code. Overrides FormInterface::alterForm
SettingBase::autoCreateFormElement public function Indicates whether a form element should be created automatically. Overrides SettingInterface::autoCreateFormElement
SettingBase::getCacheTags public function The cache tags associated with this object. Overrides SettingInterface::getCacheTags
SettingBase::getDefaultValue public function Retrieves the setting's default value. Overrides SettingInterface::getDefaultValue
SettingBase::getDescription public function Retrieves the setting's description, if any. Overrides SettingInterface::getDescription
SettingBase::getElement Deprecated public function Overrides SettingInterface::getElement
SettingBase::getElementProperties public function Retrieves all the form properties from the setting definition.
SettingBase::getGroup Deprecated public function Overrides SettingInterface::getGroup
SettingBase::getGroupElement public function Retrieves the group form element the setting belongs to. Overrides SettingInterface::getGroupElement
SettingBase::getGroups public function Retrieves the setting's groups. Overrides SettingInterface::getGroups
SettingBase::getOptions public function Retrieves the settings options, if set. Overrides SettingInterface::getOptions
SettingBase::getSettingElement public function Retrieves the form element for the setting. Overrides SettingInterface::getSettingElement
SettingBase::getSettingValue protected function Retrieves the setting value used to populate the form.
SettingBase::getTitle public function Retrieves the setting's human-readable title. Overrides SettingInterface::getTitle
SettingBase::processDeprecatedValues public function Retrieves the value from other deprecated settings. Overrides SettingInterface::processDeprecatedValues
SettingBase::submitForm public static function Form submission handler. Overrides FormInterface::submitForm
SettingBase::submitFormElement public static function Form submission handler. Overrides FormInterface::submitFormElement
SettingBase::validateForm public static function Form validation handler. Overrides FormInterface::validateForm
SettingBase::validateFormElement public static function Form validation handler. Overrides FormInterface::validateFormElement