You are here

function _advanced_text_formatter_validate_allowed_html in Advanced Text Formatter 7

Same name and namespace in other branches
  1. 8 advanced_text_formatter.module \_advanced_text_formatter_validate_allowed_html()
  2. 2.1.x advanced_text_formatter.module \_advanced_text_formatter_validate_allowed_html()
  3. 2.0.x advanced_text_formatter.module \_advanced_text_formatter_validate_allowed_html()

Change tags from string to array to speed up the formatter view.

Parameters

array $element: Form element.

array $form_state: Form state.

1 string reference to '_advanced_text_formatter_validate_allowed_html'
advanced_text_formatter_field_formatter_settings_form in ./advanced_text_formatter.module
Implements hook_field_formatter_settings_form().

File

./advanced_text_formatter.module, line 579
Advanced Text Formatter

Code

function _advanced_text_formatter_validate_allowed_html($element, &$form_state) {
  $tags = array();
  $value = isset($element['#value']) ? trim($element['#value']) : '';
  if (!empty($value)) {
    $tags = preg_split('/\\s+|<|>/', $value, -1, PREG_SPLIT_NO_EMPTY);
  }
  drupal_array_set_nested_value($form_state['values'], $element['#parents'], $tags);
}