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

Records errors for particular segments of an HTML document such as tokens, attributes or CSS properties. More...

+ Collaboration diagram for HTMLPurifier_ErrorStruct:

Public Member Functions

 getChild ($type, $id)
 
 addError ($severity, $message)
 

Data Fields

const TOKEN = 0
 Possible values for $children first-key. More...
 
const ATTR = 1
 
const CSSPROP = 2
 
 $type
 Type of this struct. More...
 
 $value
 Value of the struct we are recording errors for. More...
 
 $errors = array()
 Errors registered for this structure. More...
 
 $children = array()
 Child ErrorStructs that are from this structure. More...
 

Detailed Description

Records errors for particular segments of an HTML document such as tokens, attributes or CSS properties.

They can contain error structs (which apply to components of what they represent), but their main purpose is to hold errors applying to whatever struct is being used.

Definition at line 9 of file ErrorStruct.php.

Member Function Documentation

◆ addError()

HTMLPurifier_ErrorStruct::addError (   $severity,
  $message 
)
Parameters
int$severity
string$message

Definition at line 68 of file ErrorStruct.php.

References array.

69  {
70  $this->errors[] = array($severity, $message);
71  }
Create styles array
The data for the language used.

◆ getChild()

HTMLPurifier_ErrorStruct::getChild (   $type,
  $id 
)
Parameters
string$type
string$id
Returns
mixed

Definition at line 55 of file ErrorStruct.php.

References $type.

56  {
57  if (!isset($this->children[$type][$id])) {
58  $this->children[$type][$id] = new HTMLPurifier_ErrorStruct();
59  $this->children[$type][$id]->type = $type;
60  }
61  return $this->children[$type][$id];
62  }
Records errors for particular segments of an HTML document such as tokens, attributes or CSS properti...
Definition: ErrorStruct.php:9
$type
Type of this struct.
Definition: ErrorStruct.php:24

Field Documentation

◆ $children

HTMLPurifier_ErrorStruct::$children = array()

Child ErrorStructs that are from this structure.

For example, a TOKEN ErrorStruct would contain ATTR ErrorStructs. This is a multi-dimensional array in structure: [TYPE]['identifier'] array

Definition at line 48 of file ErrorStruct.php.

◆ $errors

HTMLPurifier_ErrorStruct::$errors = array()

Errors registered for this structure.

array

Definition at line 40 of file ErrorStruct.php.

◆ $type

HTMLPurifier_ErrorStruct::$type

Type of this struct.

string

Definition at line 24 of file ErrorStruct.php.

Referenced by getChild().

◆ $value

HTMLPurifier_ErrorStruct::$value

Value of the struct we are recording errors for.

There are various values for this:

  • TOKEN: Instance of HTMLPurifier_Token
  • ATTR: array('attr-name', 'value')
  • CSSPROP: array('prop-name', 'value') mixed

Definition at line 34 of file ErrorStruct.php.

◆ ATTR

const HTMLPurifier_ErrorStruct::ATTR = 1

Definition at line 17 of file ErrorStruct.php.

Referenced by HTMLPurifier_ErrorCollector\send().

◆ CSSPROP

const HTMLPurifier_ErrorStruct::CSSPROP = 2

Definition at line 18 of file ErrorStruct.php.

Referenced by HTMLPurifier_ErrorCollector\send().

◆ TOKEN

const HTMLPurifier_ErrorStruct::TOKEN = 0

Possible values for $children first-key.

Note that top-level structures are automatically token-level.

Definition at line 16 of file ErrorStruct.php.

Referenced by HTMLPurifier_ErrorCollector\send().


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