2009-05-19 19:32:06 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
/**
|
|
|
|
* A "safe" embed module. See SafeObject. This is a proprietary element.
|
|
|
|
*/
|
|
|
|
class HTMLPurifier_HTMLModule_SafeEmbed extends HTMLPurifier_HTMLModule
|
|
|
|
{
|
|
|
|
|
|
|
|
public $name = 'SafeEmbed';
|
|
|
|
|
|
|
|
public function setup($config) {
|
|
|
|
|
2009-11-27 10:37:41 +01:00
|
|
|
$max = $config->get('HTML.MaxImgLength');
|
2009-05-19 19:32:06 +02:00
|
|
|
$embed = $this->addElement(
|
|
|
|
'embed', 'Inline', 'Empty', 'Common',
|
|
|
|
array(
|
|
|
|
'src*' => 'URI#embedded',
|
|
|
|
'type' => 'Enum#application/x-shockwave-flash',
|
|
|
|
'width' => 'Pixels#' . $max,
|
|
|
|
'height' => 'Pixels#' . $max,
|
|
|
|
'allowscriptaccess' => 'Enum#never',
|
|
|
|
'allownetworking' => 'Enum#internal',
|
2010-04-27 13:15:35 +02:00
|
|
|
'flashvars' => 'Text',
|
2011-03-28 13:46:24 +02:00
|
|
|
'wmode' => 'Enum#window,transparent,opaque',
|
2009-05-19 19:32:06 +02:00
|
|
|
'name' => 'ID',
|
|
|
|
)
|
|
|
|
);
|
|
|
|
$embed->attr_transform_post[] = new HTMLPurifier_AttrTransform_SafeEmbed();
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
// vim: et sw=4 sts=4
|