protected function ParagraphsWidget::isFeatureEnabled

Checks if a widget feature is enabled or not.

Parameters

string $feature: Feature name to check.

Return value

bool TRUE if the feature is enabled, otherwise FALSE.

4 calls to ParagraphsWidget::isFeatureEnabled()
ParagraphsWidget::buildHeaderActions in paragraphs/src/Plugin/Field/FieldWidget/ParagraphsWidget.php
Builds header actions.
ParagraphsWidget::buildModalAddForm in paragraphs/src/Plugin/Field/FieldWidget/ParagraphsWidget.php
Builds an add paragraph button for opening of modal form.
ParagraphsWidget::duplicateButtonAccess in paragraphs/src/Plugin/Field/FieldWidget/ParagraphsWidget.php
Check duplicate button access.
ParagraphsWidget::formElement in paragraphs/src/Plugin/Field/FieldWidget/ParagraphsWidget.php
Uses a similar approach to populate a new translation.

File

paragraphs/src/Plugin/Field/FieldWidget/ParagraphsWidget.php, line 3102

Class

ParagraphsWidget
Plugin implementation of the 'entity_reference_revisions paragraphs' widget.

Namespace

Drupal\paragraphs\Plugin\Field\FieldWidget

Code

protected function isFeatureEnabled($feature) {
  $features = $this
    ->getSetting('features');
  if (!empty($features[$feature])) {
    return TRUE;
  }
  return FALSE;
}