You are here

protected function FeaturesEditForm::domDecodeOptions in Features 8.3

Same name and namespace in other branches
  1. 8.4 modules/features_ui/src/Form/FeaturesEditForm.php \Drupal\features_ui\Form\FeaturesEditForm::domDecodeOptions()

Decodes an array of option values that have been encoded by features_dom_encode_options().

Parameters

array $options: The key to encode.

bool $keys_only: Whether to decode only the keys.

Return value

array An array of encoded options.

2 calls to FeaturesEditForm::domDecodeOptions()
FeaturesEditForm::buildComponentList in modules/features_ui/src/Form/FeaturesEditForm.php
Returns the render array elements for the Components selection on the Edit form.
FeaturesEditForm::getComponentList in modules/features_ui/src/Form/FeaturesEditForm.php
Returns the full feature export array based upon user selections in form_state.

File

modules/features_ui/src/Form/FeaturesEditForm.php, line 1133

Class

FeaturesEditForm
Defines the features settings form.

Namespace

Drupal\features_ui\Form

Code

protected function domDecodeOptions(array $options, $keys_only = FALSE) {
  $replacements = array_flip($this
    ->domEncodeMap());
  $encoded = [];
  foreach ($options as $key => $value) {
    $encoded[strtr($key, $replacements)] = $keys_only ? $value : strtr($value, $replacements);
  }
  return $encoded;
}