ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
HTMLPurifier_AttrTransform_BoolToCSS Class Reference

Pre-transform that changes converts a boolean attribute to fixed CSS. More...

+ Inheritance diagram for HTMLPurifier_AttrTransform_BoolToCSS:
+ Collaboration diagram for HTMLPurifier_AttrTransform_BoolToCSS:

Public Member Functions

 __construct ($attr, $css)
 
 transform ($attr, $config, $context)
 
- Public Member Functions inherited from HTMLPurifier_AttrTransform
 transform ($attr, $config, $context)
 Abstract: makes changes to the attributes dependent on multiple values. More...
 
 prependCSS (&$attr, $css)
 Prepends CSS properties to the style attribute, creating the attribute if it doesn't exist. More...
 
 confiscateAttr (&$attr, $key)
 Retrieves and removes an attribute. More...
 

Protected Attributes

 $attr
 Name of boolean attribute that is trigger. More...
 
 $css
 CSS declarations to add to style, needs trailing semicolon. More...
 

Detailed Description

Pre-transform that changes converts a boolean attribute to fixed CSS.

Definition at line 6 of file BoolToCSS.php.

Constructor & Destructor Documentation

◆ __construct()

HTMLPurifier_AttrTransform_BoolToCSS::__construct (   $attr,
  $css 
)
Parameters
string$attrattribute name to convert from
string$cssCSS declarations to add to style (needs semicolon)

Definition at line 24 of file BoolToCSS.php.

References $attr, and $css.

25  {
26  $this->attr = $attr;
27  $this->css = $css;
28  }
$attr
Name of boolean attribute that is trigger.
Definition: BoolToCSS.php:12
$css
CSS declarations to add to style, needs trailing semicolon.
Definition: BoolToCSS.php:18

Member Function Documentation

◆ transform()

HTMLPurifier_AttrTransform_BoolToCSS::transform (   $attr,
  $config,
  $context 
)
Parameters
array$attr
HTMLPurifier_Config$config
HTMLPurifier_Context$context
Returns
array

Definition at line 36 of file BoolToCSS.php.

References $attr, and HTMLPurifier_AttrTransform\prependCSS().

37  {
38  if (!isset($attr[$this->attr])) {
39  return $attr;
40  }
41  unset($attr[$this->attr]);
42  $this->prependCSS($attr, $this->css);
43  return $attr;
44  }
$attr
Name of boolean attribute that is trigger.
Definition: BoolToCSS.php:12
prependCSS(&$attr, $css)
Prepends CSS properties to the style attribute, creating the attribute if it doesn't exist...
+ Here is the call graph for this function:

Field Documentation

◆ $attr

HTMLPurifier_AttrTransform_BoolToCSS::$attr
protected

Name of boolean attribute that is trigger.

string

Definition at line 12 of file BoolToCSS.php.

Referenced by __construct(), and transform().

◆ $css

HTMLPurifier_AttrTransform_BoolToCSS::$css
protected

CSS declarations to add to style, needs trailing semicolon.

string

Definition at line 18 of file BoolToCSS.php.

Referenced by __construct().


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