ILIAS  release_4-4 Revision
HTMLPurifier_TagTransform_Simple Class Reference

Simple transformation, just change tag name to something else, and possibly add some styling. More...

+ Inheritance diagram for HTMLPurifier_TagTransform_Simple:
+ Collaboration diagram for HTMLPurifier_TagTransform_Simple:

Public Member Functions

 __construct ($transform_to, $style=null)
 
 transform ($tag, $config, $context)
 
- Public Member Functions inherited from HTMLPurifier_TagTransform
 transform ($tag, $config, $context)
 Transforms the obsolete tag into the valid tag. More...
 

Protected Attributes

 $style
 

Additional Inherited Members

- Data Fields inherited from HTMLPurifier_TagTransform
 $transform_to
 Tag name to transform the tag to. More...
 
- Protected Member Functions inherited from HTMLPurifier_TagTransform
 prependCSS (&$attr, $css)
 Prepends CSS properties to the style attribute, creating the attribute if it doesn't exist. More...
 

Detailed Description

Simple transformation, just change tag name to something else, and possibly add some styling.

This will cover most of the deprecated tag cases.

Definition at line 8 of file Simple.php.

Constructor & Destructor Documentation

◆ __construct()

HTMLPurifier_TagTransform_Simple::__construct (   $transform_to,
  $style = null 
)
Parameters
$transform_toTag name to transform to.
$styleCSS style to add to the tag

Definition at line 17 of file Simple.php.

References $style, and HTMLPurifier_TagTransform\$transform_to.

17  {
18  $this->transform_to = $transform_to;
19  $this->style = $style;
20  }
$transform_to
Tag name to transform the tag to.

Member Function Documentation

◆ transform()

HTMLPurifier_TagTransform_Simple::transform (   $tag,
  $config,
  $context 
)

Definition at line 22 of file Simple.php.

References HTMLPurifier_TagTransform\$transform_to, and HTMLPurifier_TagTransform\prependCSS().

22  {
23  $new_tag = clone $tag;
24  $new_tag->name = $this->transform_to;
25  if (!is_null($this->style) &&
26  ($new_tag instanceof HTMLPurifier_Token_Start || $new_tag instanceof HTMLPurifier_Token_Empty)
27  ) {
28  $this->prependCSS($new_tag->attr, $this->style);
29  }
30  return $new_tag;
31  }
Concrete start token class.
Definition: Start.php:6
prependCSS(&$attr, $css)
Prepends CSS properties to the style attribute, creating the attribute if it doesn't exist...
Concrete empty token class.
Definition: Empty.php:6
$transform_to
Tag name to transform the tag to.
+ Here is the call graph for this function:

Field Documentation

◆ $style

HTMLPurifier_TagTransform_Simple::$style
protected

Definition at line 11 of file Simple.php.

Referenced by __construct().


The documentation for this class was generated from the following file: