144 public function addElement($element,
$type, $contents, $attr_includes = array(), $attr = array())
146 $this->elements[] = $element;
148 list($content_model_type, $content_model) = $this->
parseContents($contents);
162 if (!is_string($contents)) {
163 $this->
info[$element]->child = $contents;
165 return $this->
info[$element];
176 if (!isset($this->
info[$element])) {
177 $this->elements[] = $element;
179 $this->
info[$element]->standalone =
false;
181 trigger_error(
"Definition for $element already exists in module, cannot redefine");
183 return $this->
info[$element];
194 if (!isset($this->content_sets[
$type])) {
195 $this->content_sets[
$type] =
'';
197 $this->content_sets[
$type] .=
' | ';
199 $this->content_sets[
$type] .= $element;
214 if (!is_string($contents)) {
215 return array(null, null);
220 return array(
'empty',
'');
222 return array(
'optional',
'Inline | #PCDATA');
224 return array(
'optional',
'Flow | #PCDATA');
226 list($content_model_type, $content_model) = explode(
':', $contents);
227 $content_model_type = strtolower(trim($content_model_type));
228 $content_model = trim($content_model);
229 return array($content_model_type, $content_model);
240 if (!is_array($attr_includes)) {
241 if (empty($attr_includes)) {
242 $attr_includes = array();
244 $attr_includes = array($attr_includes);
247 $attr[0] = $attr_includes;
260 if (is_string(
$list)) {
261 $list = func_get_args();
264 foreach (
$list as $value) {
265 if (is_null($value)) {
$safe
Boolean flag whether or not this module is safe.
$attr_collections
Associative array of attribute collection names to attribute collection additions.
if(isset($_REQUEST['delete'])) $list
addBlankElement($element)
Convenience function that creates a totally blank, non-standalone element.
$defines_child_def
Boolean flag that indicates whether or not getChildDef is implemented.
makeLookup($list)
Convenience function that generates a lookup table with boolean true as value.
getChildDef($def)
Retrieves a proper HTMLPurifier_ChildDef subclass based on content_model and content_model_type membe...
addElementToContentSet($element, $type)
Convenience function that registers an element to a content set.
$elements
Informally, a list of elements this module changes.
mergeInAttrIncludes(&$attr, $attr_includes)
Convenience function that merges a list of attribute includes into an attribute array.
$info_tag_transform
Associative array of deprecated tag name to HTMLPurifier_TagTransform.
$info_attr_transform_post
List of HTMLPurifier_AttrTransform to be performed after validation.
setup($config)
Lazy load construction of the module after determining whether or not it's needed, and also when a finalized configuration object is available.
parseContents($contents)
Convenience function that transforms single-string contents into separate content model and content m...
Structure that stores an HTML element definition.
$info_injector
List of HTMLPurifier_Injector to be performed during well-formedness fixing.
addElement($element, $type, $contents, $attr_includes=array(), $attr=array())
Convenience function that sets up a new element.
$info_attr_transform_pre
List of HTMLPurifier_AttrTransform to be performed before validation.
Represents an XHTML 1.1 module, with information on elements, tags and attributes.
$name
Short unique string identifier of the module.
$info
Associative array of element names to element definitions.
static create($content_model, $content_model_type, $attr)
Low-level factory constructor for creating new standalone element defs.
$content_sets
Associative array of content set names to content set additions.