You are here

public function WebformManagedFileBase::isEnabled in Webform 6.x

Same name and namespace in other branches
  1. 8.5 src/Plugin/WebformElement/WebformManagedFileBase.php \Drupal\webform\Plugin\WebformElement\WebformManagedFileBase::isEnabled()

Checks if the element is enabled.

Return value

bool TRUE if the element is enabled.

Overrides WebformElementBase::isEnabled

File

src/Plugin/WebformElement/WebformManagedFileBase.php, line 151

Class

WebformManagedFileBase
Provides a base class webform 'managed_file' elements.

Namespace

Drupal\webform\Plugin\WebformElement

Code

public function isEnabled() {
  if (!parent::isEnabled()) {
    return FALSE;
  }

  // Disable File element is there are no visible stream wrappers.
  $scheme_options = static::getVisibleStreamWrappers();
  return empty($scheme_options) ? FALSE : TRUE;
}