ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
HTMLPurifier_ChildDef_StrictBlockquote Class Reference

Takes the contents of blockquote when in strict and reformats for validation. More...

+ Inheritance diagram for HTMLPurifier_ChildDef_StrictBlockquote:
+ Collaboration diagram for HTMLPurifier_ChildDef_StrictBlockquote:

Public Member Functions

 getAllowedElements ($config)
 validateChildren ($children, $config, $context)
- Public Member Functions inherited from HTMLPurifier_ChildDef_Required
 __construct ($elements)

Data Fields

 $allow_empty = true
 bool
 $type = 'strictblockquote'
 string
- Data Fields inherited from HTMLPurifier_ChildDef_Required
 $elements = array()
 Lookup table of allowed elements.
 $allow_empty = false
 bool
 $type = 'required'
 string
- Data Fields inherited from HTMLPurifier_ChildDef
 $type
 Type of child definition, usually right-most part of class name lowercase.
 $allow_empty
 Indicates whether or not an empty array of children is okay.
 $elements = array()
 Lookup array of all elements that this definition could possibly allow.

Protected Attributes

 $real_elements
 array
 $fake_elements
 array
 $init = false
 bool
- Protected Attributes inherited from HTMLPurifier_ChildDef_Required
 $whitespace = false
 Whether or not the last passed node was all whitespace.

Private Member Functions

 init ($config)

Detailed Description

Takes the contents of blockquote when in strict and reformats for validation.

Definition at line 6 of file StrictBlockquote.php.

Member Function Documentation

HTMLPurifier_ChildDef_StrictBlockquote::getAllowedElements (   $config)
Parameters
HTMLPurifier_Config$config
Returns
array
Note
We don't want MakeWellFormed to auto-close inline elements since they might be allowed.

Reimplemented from HTMLPurifier_ChildDef.

Definition at line 39 of file StrictBlockquote.php.

References $fake_elements, and init().

{
$this->init($config);
}

+ Here is the call graph for this function:

HTMLPurifier_ChildDef_StrictBlockquote::init (   $config)
private
Parameters
HTMLPurifier_Config$config

Definition at line 97 of file StrictBlockquote.php.

References HTMLPurifier_ChildDef_Required\$elements.

Referenced by getAllowedElements(), and validateChildren().

{
if (!$this->init) {
$def = $config->getHTMLDefinition();
// allow all inline elements
$this->real_elements = $this->elements;
$this->fake_elements = $def->info_content_sets['Flow'];
$this->fake_elements['#PCDATA'] = true;
$this->init = true;
}
}

+ Here is the caller graph for this function:

HTMLPurifier_ChildDef_StrictBlockquote::validateChildren (   $children,
  $config,
  $context 
)
Parameters
array$children
HTMLPurifier_Config$config
HTMLPurifier_Context$context
Returns
array

Reimplemented from HTMLPurifier_ChildDef_Required.

Definition at line 51 of file StrictBlockquote.php.

References $fake_elements, $real_elements, $result, $ret, and init().

{
$this->init($config);
// trick the parent class into thinking it allows more
$this->elements = $this->fake_elements;
$result = parent::validateChildren($children, $config, $context);
$this->elements = $this->real_elements;
if ($result === false) {
return array();
}
if ($result === true) {
$result = $children;
}
$def = $config->getHTMLDefinition();
$block_wrap_name = $def->info_block_wrapper;
$block_wrap = false;
$ret = array();
foreach ($result as $node) {
if ($block_wrap === false) {
if (($node instanceof HTMLPurifier_Node_Text && !$node->is_whitespace) ||
($node instanceof HTMLPurifier_Node_Element && !isset($this->elements[$node->name]))) {
$block_wrap = new HTMLPurifier_Node_Element($def->info_block_wrapper);
$ret[] = $block_wrap;
}
} else {
if ($node instanceof HTMLPurifier_Node_Element && isset($this->elements[$node->name])) {
$block_wrap = false;
}
}
if ($block_wrap) {
$block_wrap->children[] = $node;
} else {
$ret[] = $node;
}
}
return $ret;
}

+ Here is the call graph for this function:

Field Documentation

HTMLPurifier_ChildDef_StrictBlockquote::$allow_empty = true

bool

Definition at line 21 of file StrictBlockquote.php.

HTMLPurifier_ChildDef_StrictBlockquote::$fake_elements
protected

array

Definition at line 16 of file StrictBlockquote.php.

Referenced by getAllowedElements(), and validateChildren().

HTMLPurifier_ChildDef_StrictBlockquote::$init = false
protected

bool

Definition at line 31 of file StrictBlockquote.php.

HTMLPurifier_ChildDef_StrictBlockquote::$real_elements
protected

array

Definition at line 11 of file StrictBlockquote.php.

Referenced by validateChildren().

HTMLPurifier_ChildDef_StrictBlockquote::$type = 'strictblockquote'

string

Definition at line 26 of file StrictBlockquote.php.


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