[1.7.0] Convert Image, Legacy and List to use new format.
[htmlpurifier.git] / library / HTMLPurifier / HTMLModule / Image.php
blobcebe4f41ad309af69a87b56cfa8640e011167e06
1 <?php
3 require_once 'HTMLPurifier/HTMLModule.php';
5 require_once 'HTMLPurifier/AttrDef/URI.php';
6 require_once 'HTMLPurifier/AttrTransform/ImgRequired.php';
8 /**
9 * XHTML 1.1 Image Module provides basic image embedding.
10 * @note There is specialized code for removing empty images in
11 * HTMLPurifier_Strategy_RemoveForeignElements
13 class HTMLPurifier_HTMLModule_Image extends HTMLPurifier_HTMLModule
16 var $name = 'Image';
17 var $elements = array('img');
18 var $content_sets = array('Inline' => 'img');
20 function HTMLPurifier_HTMLModule_Image() {
21 $this->addElement(
22 'img', true, 'Inline', 'Empty', 'Common',
23 array(
24 'alt' => 'Text',
25 'height' => 'Length',
26 'longdesc' => 'URI',
27 'src' => new HTMLPurifier_AttrDef_URI(true), // embedded
28 'width' => 'Length'
31 $this->info['img']->attr_transform_post[] =
32 new HTMLPurifier_AttrTransform_ImgRequired();