|
Revision 21, 0.9 kB
(checked in by admin, 18 years ago)
|
|
|
| Line | |
|---|
| 1 | <?php |
|---|
| 2 | |
|---|
| 3 | /** |
|---|
| 4 | * XHTML 1.1 Image Module provides basic image embedding. |
|---|
| 5 | * @note There is specialized code for removing empty images in |
|---|
| 6 | * HTMLPurifier_Strategy_RemoveForeignElements |
|---|
| 7 | */ |
|---|
| 8 | class HTMLPurifier_HTMLModule_Image extends HTMLPurifier_HTMLModule |
|---|
| 9 | { |
|---|
| 10 | |
|---|
| 11 | public $name = 'Image'; |
|---|
| 12 | |
|---|
| 13 | public function __construct() { |
|---|
| 14 | $img = $this->addElement( |
|---|
| 15 | 'img', 'Inline', 'Empty', 'Common', |
|---|
| 16 | array( |
|---|
| 17 | 'alt*' => 'Text', |
|---|
| 18 | 'height' => 'Length', |
|---|
| 19 | 'longdesc' => 'URI', |
|---|
| 20 | 'src*' => new HTMLPurifier_AttrDef_URI(true), // embedded |
|---|
| 21 | 'width' => 'Length' |
|---|
| 22 | ) |
|---|
| 23 | ); |
|---|
| 24 | // kind of strange, but splitting things up would be inefficient |
|---|
| 25 | $img->attr_transform_pre[] = |
|---|
| 26 | $img->attr_transform_post[] = |
|---|
| 27 | new HTMLPurifier_AttrTransform_ImgRequired(); |
|---|
| 28 | } |
|---|
| 29 | |
|---|
| 30 | } |
|---|
| 31 | |
|---|