You are here

function quickedit_field_attach_view_alter in Quick Edit 7

Implements hook_field_attach_view_alter().

File

./quickedit.module, line 341
Provides in-place content editing functionality for fields.

Code

function quickedit_field_attach_view_alter(&$output, $context) {

  // Special case for this special mode.
  if ($context['display'] == 'quickedit-render-without-transformation-filters') {
    $children = element_children($output);
    $field = reset($children);
    $langcode = $output[$field]['#language'];
    foreach (array_keys($output[$field]['#items']) as $item) {
      $text = $output[$field]['#items'][$item]['value'];
      $format_id = $output[$field]['#items'][$item]['format'];
      $wrapped_and_untransformed = check_markup2($text, $format_id, $langcode, FALSE, array(
        FILTER_TYPE_TRANSFORM_REVERSIBLE,
        FILTER_TYPE_TRANSFORM_IRREVERSIBLE,
      ));
      $output[$field][$item]['#markup'] = $wrapped_and_untransformed;
    }
  }
}