Merge commit 'catalyst/MOODLE_19_STABLE' into mdl19-linuxchix
[moodle-linuxchix.git] / lib / htmlpurifier / HTMLPurifier / HTMLModule / Image.php
blob64ce2a09a61099eb371e87e177e2f3316629328e
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';
18 function HTMLPurifier_HTMLModule_Image() {
19 $img =& $this->addElement(
20 'img', true, 'Inline', 'Empty', 'Common',
21 array(
22 'alt*' => 'Text',
23 'height' => 'Length',
24 'longdesc' => 'URI',
25 'src*' => new HTMLPurifier_AttrDef_URI(true), // embedded
26 'width' => 'Length'
29 // kind of strange, but splitting things up would be inefficient
30 $img->attr_transform_pre[] =
31 $img->attr_transform_post[] =
32 new HTMLPurifier_AttrTransform_ImgRequired();