1: <?php
2:
3: /**
4: * Defines a mutation of an obsolete tag into a valid tag.
5: */
6: abstract class HTMLPurifier_TagTransform
7: {
8:
9: /**
10: * Tag name to transform the tag to.
11: */
12: public $transform_to;
13:
14: /**
15: * Transforms the obsolete tag into the valid tag.
16: * @param $tag Tag to be transformed.
17: * @param $config Mandatory HTMLPurifier_Config object
18: * @param $context Mandatory HTMLPurifier_Context object
19: */
20: abstract public function transform($tag, $config, $context);
21:
22: /**
23: * Prepends CSS properties to the style attribute, creating the
24: * attribute if it doesn't exist.
25: * @warning Copied over from AttrTransform, be sure to keep in sync
26: * @param $attr Attribute array to process (passed by reference)
27: * @param $css CSS to prepend
28: */
29: protected function prependCSS(&$attr, $css) {
30: $attr['style'] = isset($attr['style']) ? $attr['style'] : '';
31: $attr['style'] = $css . $attr['style'];
32: }
33:
34: }
35:
36: // vim: et sw=4 sts=4
37: