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() {
|
|
|
|
$this->info['img'] = new HTMLPurifier_ElementDef();
|
|
|
|
$this->info['img']->attr = array(
|
|
|
|
0 => array('Common'),
|
|
|
|
'alt' => 'Text',
|
|
|
|
'height' => 'Length',
|
|
|
|
'longdesc' => 'URI',
|
|
|
|
'src' => new HTMLPurifier_AttrDef_URI(true), // embedded
|
|
|
|
'width' => 'Length'
|
|
|
|
);
|
|
|
|
$this->info['img']->content_model_type = 'empty';
|
|
|
|
$this->info['img']->attr_transform_post[] =
|
|
|
|
new HTMLPurifier_AttrTransform_ImgRequired();
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
?>
|