Projet

Général

Profil

Paste
Télécharger (694 octets) Statistiques
| Branche: | Révision:

root / drupal7 / sites / all / modules / feeds_tamper / plugins / html_entity_decode.inc @ d808fa20

1
<?php
2

    
3
/**
4
 * @file
5
 * Decode HTML entities.
6
 */
7

    
8
$plugin = array(
9
  'form' => 'feeds_tamper_html_entity_decode_form',
10
  'callback' => 'feeds_tamper_html_entity_decode_callback',
11
  'name' => 'HTML entity decode',
12
  'multi' => 'loop',
13
  'category' => 'HTML',
14
);
15

    
16
function feeds_tamper_html_entity_decode_form($importer, $element_key, $settings) {
17
  $form = array();
18
  $form['html'] = array(
19
    '#markup' => t('Convert all HTML entities such as &amp;amp; and &amp;quot; to &amp; and &quot;.'),
20
  );
21
  return $form;
22
}
23

    
24
function feeds_tamper_html_entity_decode_callback($result, $item_key, $element_key, &$field, $settings, $source) {
25
  $field = html_entity_decode($field, ENT_QUOTES, 'UTF-8');
26
}