0
0
mirror of https://github.com/ezyang/htmlpurifier.git synced 2024-12-22 16:31:53 +00:00

Add documentation.

git-svn-id: http://htmlpurifier.org/svnroot/htmlpurifier/trunk@727 48356398-32a2-884e-a903-53898d9a118a
This commit is contained in:
Edward Z. Yang 2007-02-05 05:23:20 +00:00
parent 64ee756b7a
commit dac7ac1eae
2 changed files with 31 additions and 1 deletions

View File

@ -10,12 +10,33 @@ require_once 'HTMLPurifier/ChildDef/StrictBlockquote.php'; // transform
class HTMLPurifier_ContentSets
{
/**
* List of content set strings (pipe seperators) indexed by name.
* @public
*/
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();
/**
* Synchronized list of defined content sets (keys of info)
*/
var $keys = array();
/**
* Synchronized list of defined content values (values of info)
*/
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) {
// populate content_sets based on module hints
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) {
$content_model = $def->content_model;
if (is_string($content_model)) {

View File

@ -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->content_sets->setup($this->modules);
$this->info_content_sets = $this->content_sets->lookup;