You are here

protected function OptionsBase::getElementSelectorInputsOptions in Webform 6.x

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

Get an element's (sub)inputs selectors as options.

Parameters

array $element: An element.

Return value

array An array of element (sub)input selectors.

Overrides WebformElementBase::getElementSelectorInputsOptions

2 calls to OptionsBase::getElementSelectorInputsOptions()
OptionsBase::getElementSelectorOptions in src/Plugin/WebformElement/OptionsBase.php
OptionsBase::getElementSelectorSourceValues in src/Plugin/WebformElement/OptionsBase.php
Get an element's selectors source values.
3 methods override OptionsBase::getElementSelectorInputsOptions()
Checkboxes::getElementSelectorInputsOptions in src/Plugin/WebformElement/Checkboxes.php
Get an element's (sub)inputs selectors as options.
WebformOptionsCustom::getElementSelectorInputsOptions in modules/webform_options_custom/src/Plugin/WebformElement/WebformOptionsCustom.php
Get an element's (sub)inputs selectors as options.
WebformToggles::getElementSelectorInputsOptions in modules/webform_toggles/src/Plugin/WebformElement/WebformToggles.php
Get an element's (sub)inputs selectors as options.

File

src/Plugin/WebformElement/OptionsBase.php, line 706

Class

OptionsBase
Provides a base 'options' element.

Namespace

Drupal\webform\Plugin\WebformElement

Code

protected function getElementSelectorInputsOptions(array $element) {
  if ($other_type = $this
    ->getOptionsOtherType()) {
    list($type) = explode(' ', $this
      ->getPluginLabel());
    $title = $this
      ->getAdminLabel($element);
    $name = $other_type;
    $inputs = [];
    $inputs[$name] = $title . ' [' . $type . ']';
    $inputs['other'] = $title . ' [' . $this
      ->t('Other field') . ']';
    return $inputs;
  }
  else {
    return [];
  }
}