ILIAS  release_5-2 Revision v5.2.25-18-g3f80b82851
HTMLPurifier_HTMLModule_Scripting Class Reference

XHTML 1.1 Scripting module, defines elements that are used to contain information pertaining to executable scripts or the lack of support for executable scripts. More...

+ Inheritance diagram for HTMLPurifier_HTMLModule_Scripting:
+ Collaboration diagram for HTMLPurifier_HTMLModule_Scripting:

Public Member Functions

 setup ($config)
 
- Public Member Functions inherited from HTMLPurifier_HTMLModule
 getChildDef ($def)
 Retrieves a proper HTMLPurifier_ChildDef subclass based on content_model and content_model_type member variables of the HTMLPurifier_ElementDef class. More...
 
 addElement ($element, $type, $contents, $attr_includes=array(), $attr=array())
 Convenience function that sets up a new element. More...
 
 addBlankElement ($element)
 Convenience function that creates a totally blank, non-standalone element. More...
 
 addElementToContentSet ($element, $type)
 Convenience function that registers an element to a content set. More...
 
 parseContents ($contents)
 Convenience function that transforms single-string contents into separate content model and content model type. More...
 
 mergeInAttrIncludes (&$attr, $attr_includes)
 Convenience function that merges a list of attribute includes into an attribute array. More...
 
 makeLookup ($list)
 Convenience function that generates a lookup table with boolean true as value. More...
 
 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. More...
 

Data Fields

 $name = 'Scripting'
 string More...
 
 $elements = array('script', 'noscript')
 array More...
 
 $content_sets = array('Block' => 'script | noscript', 'Inline' => 'script | noscript')
 array More...
 
 $safe = false
 bool More...
 
- Data Fields inherited from HTMLPurifier_HTMLModule
 $name
 Short unique string identifier of the module. More...
 
 $elements = array()
 Informally, a list of elements this module changes. More...
 
 $info = array()
 Associative array of element names to element definitions. More...
 
 $content_sets = array()
 Associative array of content set names to content set additions. More...
 
 $attr_collections = array()
 Associative array of attribute collection names to attribute collection additions. More...
 
 $info_tag_transform = array()
 Associative array of deprecated tag name to HTMLPurifier_TagTransform. More...
 
 $info_attr_transform_pre = array()
 List of HTMLPurifier_AttrTransform to be performed before validation. More...
 
 $info_attr_transform_post = array()
 List of HTMLPurifier_AttrTransform to be performed after validation. More...
 
 $info_injector = array()
 List of HTMLPurifier_Injector to be performed during well-formedness fixing. More...
 
 $defines_child_def = false
 Boolean flag that indicates whether or not getChildDef is implemented. More...
 
 $safe = true
 Boolean flag whether or not this module is safe. More...
 

Detailed Description

XHTML 1.1 Scripting module, defines elements that are used to contain information pertaining to executable scripts or the lack of support for executable scripts.

Note
This module does not contain inline scripting elements

Definition at line 16 of file Scripting.php.

Member Function Documentation

◆ setup()

HTMLPurifier_HTMLModule_Scripting::setup (   $config)
Parameters
HTMLPurifier_Config$config

Definition at line 41 of file Scripting.php.

References array.

42  {
43  // TODO: create custom child-definition for noscript that
44  // auto-wraps stray #PCDATA in a similar manner to
45  // blockquote's custom definition (we would use it but
46  // blockquote's contents are optional while noscript's contents
47  // are required)
48 
49  // TODO: convert this to new syntax, main problem is getting
50  // both content sets working
51 
52  // In theory, this could be safe, but I don't see any reason to
53  // allow it.
54  $this->info['noscript'] = new HTMLPurifier_ElementDef();
55  $this->info['noscript']->attr = array(0 => array('Common'));
56  $this->info['noscript']->content_model = 'Heading | List | Block';
57  $this->info['noscript']->content_model_type = 'required';
58 
59  $this->info['script'] = new HTMLPurifier_ElementDef();
60  $this->info['script']->attr = array(
61  'defer' => new HTMLPurifier_AttrDef_Enum(array('defer')),
62  'src' => new HTMLPurifier_AttrDef_URI(true),
63  'type' => new HTMLPurifier_AttrDef_Enum(array('text/javascript'))
64  );
65  $this->info['script']->content_model = '#PCDATA';
66  $this->info['script']->content_model_type = 'optional';
67  $this->info['script']->attr_transform_pre[] =
68  $this->info['script']->attr_transform_post[] =
70  }
Structure that stores an HTML element definition.
Definition: ElementDef.php:11
Create styles array
The data for the language used.
Validates a keyword against a list of valid values.
Definition: Enum.php:10
Implements required attribute stipulation for <script>
Validates a URI as defined by RFC 3986.
Definition: URI.php:7

Field Documentation

◆ $content_sets

HTMLPurifier_HTMLModule_Scripting::$content_sets = array('Block' => 'script | noscript', 'Inline' => 'script | noscript')

array

Definition at line 31 of file Scripting.php.

◆ $elements

HTMLPurifier_HTMLModule_Scripting::$elements = array('script', 'noscript')

array

Definition at line 26 of file Scripting.php.

◆ $name

HTMLPurifier_HTMLModule_Scripting::$name = 'Scripting'

string

Definition at line 21 of file Scripting.php.

◆ $safe

HTMLPurifier_HTMLModule_Scripting::$safe = false

bool

Definition at line 36 of file Scripting.php.


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