Moodle  2.2.1
http://www.collinsharper.com
HTMLPurifier_ChildDef_Custom Class Reference
Inheritance diagram for HTMLPurifier_ChildDef_Custom:
Collaboration diagram for HTMLPurifier_ChildDef_Custom:

Public Member Functions

 __construct ($dtd_regex)
 validateChildren ($tokens_of_children, $config, $context)

Data Fields

 $type = 'custom'
 $allow_empty = false
 $dtd_regex

Protected Member Functions

 _compileRegex ()

Detailed Description

Custom validation class, accepts DTD child definitions

Warning:
Currently this class is an all or nothing proposition, that is, it will only give a bool return value.

Definition at line 9 of file Custom.php.


Constructor & Destructor Documentation

__construct ( dtd_regex)
Parameters:
$dtd_regexAllowed child pattern from the DTD

Definition at line 25 of file Custom.php.

Here is the call graph for this function:


Member Function Documentation

_compileRegex ( ) [protected]

Compiles the PCRE regex from a DTD regex ($dtd_regex to $_pcre_regex)

Definition at line 32 of file Custom.php.

Here is the caller graph for this function:

validateChildren ( tokens_of_children,
config,
context 
)

Validates nodes according to definition and returns modification.

Parameters:
$tokens_of_childrenArray of HTMLPurifier_Token
$configHTMLPurifier_Config object
$contextHTMLPurifier_Context object
Returns:
bool true to leave nodes as is
bool false to remove parent node
array of replacement child tokens

Reimplemented from HTMLPurifier_ChildDef.

Definition at line 60 of file Custom.php.


Field Documentation

$allow_empty = false

Bool that indicates whether or not an empty array of children is okay

This is necessary for redundant checking when changes affecting a child node may cause a parent node to now be disallowed.

Reimplemented from HTMLPurifier_ChildDef.

Definition at line 12 of file Custom.php.

$dtd_regex

Allowed child pattern as defined by the DTD

Definition at line 16 of file Custom.php.

$type = 'custom'

Type of child definition, usually right-most part of class name lowercase. Used occasionally in terms of context.

Reimplemented from HTMLPurifier_ChildDef.

Definition at line 11 of file Custom.php.


The documentation for this class was generated from the following file:
 All Data Structures Namespaces Files Functions Variables Enumerations