2007-02-04 16:35:40 +00:00
|
|
|
<?php
|
|
|
|
|
|
|
|
require_once 'HTMLPurifier/HTMLModule.php';
|
|
|
|
|
2007-02-04 20:09:35 +00:00
|
|
|
require_once 'HTMLPurifier/AttrDef/URI.php';
|
|
|
|
require_once 'HTMLPurifier/AttrTransform/ImgRequired.php';
|
|
|
|
|
2007-02-04 16:35:40 +00:00
|
|
|
/**
|
|
|
|
* XHTML 1.1 Image Module provides basic image embedding.
|
2007-02-04 20:09:35 +00:00
|
|
|
* @note There is specialized code for removing empty images in
|
|
|
|
* HTMLPurifier_Strategy_RemoveForeignElements
|
2007-02-04 16:35:40 +00:00
|
|
|
*/
|
|
|
|
class HTMLPurifier_HTMLModule_Image extends HTMLPurifier_HTMLModule
|
|
|
|
{
|
|
|
|
|
2007-02-14 22:30:17 +00:00
|
|
|
var $name = 'Image';
|
2007-02-04 16:35:40 +00:00
|
|
|
var $elements = array('img');
|
|
|
|
var $content_sets = array('Inline' => 'img');
|
|
|
|
|
|
|
|
function HTMLPurifier_HTMLModule_Image() {
|
2007-05-12 20:44:47 +00:00
|
|
|
$img =& $this->addElement(
|
2007-05-09 22:01:07 +00:00
|
|
|
'img', true, 'Inline', 'Empty', 'Common',
|
|
|
|
array(
|
|
|
|
'alt' => 'Text',
|
|
|
|
'height' => 'Length',
|
|
|
|
'longdesc' => 'URI',
|
|
|
|
'src' => new HTMLPurifier_AttrDef_URI(true), // embedded
|
|
|
|
'width' => 'Length'
|
|
|
|
)
|
2007-02-04 16:35:40 +00:00
|
|
|
);
|
2007-05-12 20:44:47 +00:00
|
|
|
$img->attr_transform_post[] =
|
2007-02-04 16:35:40 +00:00
|
|
|
new HTMLPurifier_AttrTransform_ImgRequired();
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
?>
|