You are here

function _ckeditor_filter_process_recursive in CKEditor Filter 7

Recursive call to process html block

1 call to _ckeditor_filter_process_recursive()
_ckeditor_filter_process in ./ckeditor_filter.module
Process callback for filter.

File

./ckeditor_filter.module, line 95
Provides an input filter that allows site administrators configure which HTML elements, attributes and style properties are allowed.

Code

function _ckeditor_filter_process_recursive($e, $elements, $special_cases, $attributes, $styles_regex) {

  // we have an element
  if (!empty($e)) {

    // if the tag isn't in our elements, clear
    if ($e->tag != 'root') {
      _ckeditor_filter_process_elements($e, $elements, $special_cases);
    }

    // we have attributes
    if ($all_attributes = $e
      ->getAllAttributes()) {

      // process attributes
      _ckeditor_filter_process_attributes($e, $all_attributes, $attributes);

      // process styles
      _ckeditor_filter_process_styles($e, $styles_regex);
    }

    // process children iteratively
    if (method_exists($e, 'children')) {
      $children = $e
        ->children();
      foreach ($children as $child) {
        _ckeditor_filter_process_recursive($child, $elements, $special_cases, $attributes, $styles_regex);
      }
    }
  }
}