ILIAS  release_4-4 Revision
All Data Structures Namespaces Files Functions Variables Modules Pages
ilAssHtmlUserSolutionPurifier Class Reference
+ Inheritance diagram for ilAssHtmlUserSolutionPurifier:
+ Collaboration diagram for ilAssHtmlUserSolutionPurifier:

Data Fields

const TYPE = 'qpl_usersolution'
 

Protected Member Functions

 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.ilAssHtmlUserSolutionPurifier.php.

Member Function Documentation

◆ getAllowedElements()

ilAssHtmlUserSolutionPurifier::getAllowedElements ( )
private

Definition at line 36 of file class.ilAssHtmlUserSolutionPurifier.php.

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

Referenced by getPurifierConfigInstance().

37  {
38  $allowedElements = $this->getElementsUsedForAdvancedEditing();
39 
40  $allowedElements = $this->makeElementListTinyMceCompliant($allowedElements);
41  $allowedElements = $this->removeUnsupportedElements($allowedElements);
42 
43  return $allowedElements;
44  }
removeUnsupportedElements($a_array)
Removes all unsupported elements.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getElementsUsedForAdvancedEditing()

ilAssHtmlUserSolutionPurifier::getElementsUsedForAdvancedEditing ( )
private

Definition at line 46 of file class.ilAssHtmlUserSolutionPurifier.php.

References ilObjAdvancedEditing\_getUsedHTMLTags().

Referenced by getAllowedElements().

47  {
48  include_once 'Services/AdvancedEditing/classes/class.ilObjAdvancedEditing.php';
49  return ilObjAdvancedEditing::_getUsedHTMLTags(self::TYPE);
50  }
& _getUsedHTMLTags($a_module="")
Returns an array of all allowed HTML tags for text editing.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getPurifierConfigInstance()

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

Definition at line 19 of file class.ilAssHtmlUserSolutionPurifier.php.

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

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

Field Documentation

◆ TYPE

const ilAssHtmlUserSolutionPurifier::TYPE = 'qpl_usersolution'

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


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