You are here

html_entity_encode.inc in Feeds Tamper 6

Same filename and directory in other branches
  1. 7 plugins/html_entity_encode.inc

File

plugins/html_entity_encode.inc
View source
<?php

/**
 * @file
 * Encode HTML entities.
 */
$plugin = array(
  'form' => 'feeds_tamper_html_entity_encode_form',
  'callback' => 'feeds_tamper_html_entity_encode_callback',
  'name' => 'HTML entity encode',
  'multi' => 'loop',
  'category' => 'HTML',
);
function feeds_tamper_html_entity_encode_form($importer, $element_key, $settings) {
  $form = array();
  $form['html'] = array(
    '#value' => t('This will convert all HTML special characters such as &gt; and &amp; to &amp;gt; and &amp;apm;.'),
  );
  return $form;
}
function feeds_tamper_html_entity_encode_callback($source, $item_key, $element_key, &$field, $settings) {
  $field = check_plain($field);
}