You are here

function linkit_element_info_alter in Linkit 7.3

Same name and namespace in other branches
  1. 7 linkit.module \linkit_element_info_alter()
  2. 7.2 linkit.module \linkit_element_info_alter()

Implements hook_element_info_alter().

File

./linkit.module, line 363
Main file for Linkit module.

Code

function linkit_element_info_alter(&$types) {

  // Append a after_build function for the field integration.
  foreach (linkit_get_allowed_field_elements() as $element) {
    if (isset($types[$element])) {
      $types[$element]['#after_build'][] = 'linkit_field_element_after_build';
    }
  }

  // Used when using ckeditor module.
  if (isset($types['text_format']['#pre_render']) && is_array($types['text_format']['#pre_render'])) {
    if (in_array('ckeditor_pre_render_text_format', $types['text_format']['#pre_render'])) {
      $types['text_format']['#pre_render'][] = 'linkit_pre_render_editor_element';
    }
  }

  // Used when using wysiwyg module.
  if (isset($types['text_format']['#pre_render']) && is_array($types['text_format']['#pre_render'])) {
    if (in_array('wysiwyg_pre_render_text_format', $types['text_format']['#pre_render'])) {
      $types['text_format']['#process'][] = 'linkit_pre_render_editor_element';
    }
  }
}