You are here

function features_dom_encode_options in Features 6

Same name and namespace in other branches
  1. 7.2 features.admin.inc \features_dom_encode_options()
  2. 7 features.admin.inc \features_dom_encode_options()

Make a Drupal options array safe for usage with jQuery DOM selectors. Encodes known bad characters into __[ordinal]__ so that they may be safely referenced by JS behaviors.

1 call to features_dom_encode_options()
features_export_form in ./features.admin.inc
Form callback for features export form. Acts as a router based on the form_state.

File

./features.admin.inc, line 779

Code

function features_dom_encode_options($options = array(), $keys_only = TRUE) {
  $replacements = features_dom_encode_map();
  $encoded = array();
  foreach ($options as $key => $value) {
    $encoded[strtr($key, $replacements)] = $keys_only ? $value : strtr($value, $replacements);
  }
  return $encoded;
}