mirror of
https://github.com/ezyang/htmlpurifier.git
synced 2025-01-08 23:11:52 +00:00
Add documentation.
git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@727 48356398-32a2-884e-a903-53898d9a118a
This commit is contained in:
parent
64ee756b7a
commit
dac7ac1eae
@ -10,12 +10,33 @@ require_once 'HTMLPurifier/ChildDef/StrictBlockquote.php'; // transform
|
|||||||
class HTMLPurifier_ContentSets
|
class HTMLPurifier_ContentSets
|
||||||
{
|
{
|
||||||
|
|
||||||
|
/**
|
||||||
|
* List of content set strings (pipe seperators) indexed by name.
|
||||||
|
* @public
|
||||||
|
*/
|
||||||
var $info = array();
|
var $info = array();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* List of content set lookups (element => true) indexed by name.
|
||||||
|
* @note This is in HTMLPurifier_HTMLDefinition->info_content_sets
|
||||||
|
* @public
|
||||||
|
*/
|
||||||
var $lookup = array();
|
var $lookup = array();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Synchronized list of defined content sets (keys of info)
|
||||||
|
*/
|
||||||
var $keys = array();
|
var $keys = array();
|
||||||
|
/**
|
||||||
|
* Synchronized list of defined content values (values of info)
|
||||||
|
*/
|
||||||
var $values = array();
|
var $values = array();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Merges in module's content sets, expands identifiers in the content
|
||||||
|
* sets and populates the keys, values and lookup member variables.
|
||||||
|
* @param $modules List of HTMLPurifier_HTMLModule
|
||||||
|
*/
|
||||||
function setup($modules) {
|
function setup($modules) {
|
||||||
// populate content_sets based on module hints
|
// populate content_sets based on module hints
|
||||||
foreach ($modules as $module_i => $module) {
|
foreach ($modules as $module_i => $module) {
|
||||||
@ -50,6 +71,11 @@ class HTMLPurifier_ContentSets
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Accepts a definition; generates and assigns a ChildDef for it
|
||||||
|
* @param $def HTMLPurifier_ElementDef reference
|
||||||
|
* @param $module Module that defined the ElementDef
|
||||||
|
*/
|
||||||
function generateChildDef(&$def, $module) {
|
function generateChildDef(&$def, $module) {
|
||||||
$content_model = $def->content_model;
|
$content_model = $def->content_model;
|
||||||
if (is_string($content_model)) {
|
if (is_string($content_model)) {
|
||||||
|
@ -284,7 +284,11 @@ class HTMLPurifier_HTMLDefinition
|
|||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function setupInfo() {
|
/**
|
||||||
|
* Sets up the info array.
|
||||||
|
* @param $config Instance of HTMLPurifier_Config
|
||||||
|
*/
|
||||||
|
function setupInfo($config) {
|
||||||
$this->attr_collections->setup($this->attr_types, $this->modules);
|
$this->attr_collections->setup($this->attr_types, $this->modules);
|
||||||
$this->content_sets->setup($this->modules);
|
$this->content_sets->setup($this->modules);
|
||||||
$this->info_content_sets = $this->content_sets->lookup;
|
$this->info_content_sets = $this->content_sets->lookup;
|
||||||
|
Loading…
Reference in New Issue
Block a user