ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
ilAssHtmlPurifier Class Reference
+ Inheritance diagram for ilAssHtmlPurifier:
+ Collaboration diagram for ilAssHtmlPurifier:

Protected Member Functions

 getPurifierType ()
 
 getPurifierConfigInstance ()
 
- Protected Member Functions inherited from ilHtmlPurifierAbstractLibWrapper
 getPurifierConfigInstance ()
 Has to be implemented by subclasses to build the HTMLPurifier_Config instance with object specific configurations. More...
 
 setPurifier (HTMLPurifier $oPurifier)
 Set the purifier by subclass. More...
 
 getPurifier ()
 Get the purifier. More...
 
 removeUnsupportedElements ($a_array)
 Removes all unsupported elements. More...
 
 makeElementListTinyMceCompliant ($elements)
 

Private Member Functions

 getAllowedElements ()
 
 getElementsUsedForAdvancedEditing ()
 

Additional Inherited Members

- Public Member Functions inherited from ilHtmlPurifierAbstractLibWrapper
 __construct ()
 Constructor. More...
 
 purify ($a_html, $a_config=null)
 Filters an HTML snippet/document to be XSS-free and standards-compliant. More...
 
 purifyArray (Array $a_array_of_html, $a_config=null)
 Filters an array of HTML snippets/documents to be XSS-free and standards-compliant. More...
 
- Public Member Functions inherited from ilHtmlPurifierInterface
 purify ($a_html)
 Filters an HTML snippet/document to be XSS-free and standards-compliant. More...
 
 purifyArray (Array $a_array_of_html)
 Filters an array of HTML snippets/documents to be XSS-free and standards-compliant. More...
 
- Static Public Member Functions inherited from ilHtmlPurifierAbstractLibWrapper
static _getCacheDirectory ()
 Get the directory for HTMLPurifier cache files. More...
 
- Protected Attributes inherited from ilHtmlPurifierAbstractLibWrapper
 $oPurifier = null
 

Detailed Description

Definition at line 12 of file class.ilAssHtmlPurifier.php.

Member Function Documentation

◆ getAllowedElements()

ilAssHtmlPurifier::getAllowedElements ( )
private

Definition at line 38 of file class.ilAssHtmlPurifier.php.

39 {
40 $allowedElements = $this->getElementsUsedForAdvancedEditing();
41
42 $allowedElements = $this->makeElementListTinyMceCompliant($allowedElements);
43 $allowedElements = $this->removeUnsupportedElements($allowedElements);
44
45 return $allowedElements;
46 }
removeUnsupportedElements($a_array)
Removes all unsupported elements.

References getElementsUsedForAdvancedEditing(), ilHtmlPurifierAbstractLibWrapper\makeElementListTinyMceCompliant(), and ilHtmlPurifierAbstractLibWrapper\removeUnsupportedElements().

Referenced by getPurifierConfigInstance().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getElementsUsedForAdvancedEditing()

ilAssHtmlPurifier::getElementsUsedForAdvancedEditing ( )
private

Definition at line 48 of file class.ilAssHtmlPurifier.php.

49 {
50 include_once 'Services/AdvancedEditing/classes/class.ilObjAdvancedEditing.php';
52 }
& _getUsedHTMLTags($a_module="")
Returns an array of all allowed HTML tags for text editing.

References ilObjAdvancedEditing\_getUsedHTMLTags(), and getPurifierType().

Referenced by getAllowedElements().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getPurifierConfigInstance()

ilAssHtmlPurifier::getPurifierConfigInstance ( )
protected
Returns
HTMLPurifier_Config Instance of HTMLPurifier_Config

Reimplemented from ilHtmlPurifierAbstractLibWrapper.

Definition at line 22 of file class.ilAssHtmlPurifier.php.

23 {
25 $config->set('HTML.DefinitionID', $this->getPurifierType());
26 $config->set('HTML.DefinitionRev', 1);
27 $config->set('Cache.SerializerPath', ilHtmlPurifierAbstractLibWrapper::_getCacheDirectory());
28 $config->set('HTML.Doctype', 'XHTML 1.0 Strict');
29 $config->set('HTML.AllowedElements', $this->getAllowedElements());
30 $config->set('HTML.ForbiddenAttributes', 'div@style');
31 if ($def = $config->maybeGetRawHTMLDefinition()) {
32 $def->addAttribute('a', 'target', 'Enum#_blank,_self,_target,_top');
33 }
34
35 return $config;
36 }
static createDefault()
Convenience constructor that creates a default configuration object.
Definition: Config.php:154
static _getCacheDirectory()
Get the directory for HTMLPurifier cache files.

References ilHtmlPurifierAbstractLibWrapper\_getCacheDirectory(), HTMLPurifier_Config\createDefault(), getAllowedElements(), and getPurifierType().

+ Here is the call graph for this function:

◆ getPurifierType()

ilAssHtmlPurifier::getPurifierType ( )
protected

Definition at line 14 of file class.ilAssHtmlPurifier.php.

15 {
16 return 'assessment';
17 }

Referenced by getElementsUsedForAdvancedEditing(), and getPurifierConfigInstance().

+ Here is the caller graph for this function:

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