ILIAS  release_7 Revision v7.30-3-g800a261c036
All Data Structures Namespaces Files Functions Variables Modules Pages
ilAssHtmlPurifier Class Reference
+ Inheritance diagram for ilAssHtmlPurifier:
+ Collaboration diagram for ilAssHtmlPurifier:

Protected Member Functions

 getPurifierType ()
 
 getPurifierConfigInstance ()
 
- Protected Member Functions inherited from ilHtmlPurifierAbstractLibWrapper
 getPurifierConfigInstance ()
 
 setPurifier (HTMLPurifier $purifier)
 
 getPurifier ()
 
 removeUnsupportedElements (array $elements)
 Removes all unsupported elements. More...
 
 makeElementListTinyMceCompliant (array $elements)
 

Private Member Functions

 getAllowedElements ()
 
 getElementsUsedForAdvancedEditing ()
 

Additional Inherited Members

- Public Member Functions inherited from ilHtmlPurifierAbstractLibWrapper
 __construct ()
 ilHtmlPurifierAbstractLibWrapper constructor. More...
 
 purify (string $html)
 
 purifyArray (array $htmlCollection)
 
- Static Public Member Functions inherited from ilHtmlPurifierAbstractLibWrapper
static _getCacheDirectory ()
 
- Protected Attributes inherited from ilHtmlPurifierAbstractLibWrapper
 $purifier
 

Detailed Description

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

Member Function Documentation

◆ getAllowedElements()

ilAssHtmlPurifier::getAllowedElements ( )
private

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

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

Referenced by getPurifierConfigInstance().

48  {
49  $allowedElements = $this->getElementsUsedForAdvancedEditing();
50 
51  $allowedElements = $this->makeElementListTinyMceCompliant($allowedElements);
52  $allowedElements = $this->removeUnsupportedElements($allowedElements);
53 
54  return $allowedElements;
55  }
removeUnsupportedElements(array $elements)
Removes all unsupported elements.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getElementsUsedForAdvancedEditing()

ilAssHtmlPurifier::getElementsUsedForAdvancedEditing ( )
private

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

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

Referenced by getAllowedElements().

58  {
59  include_once 'Services/AdvancedEditing/classes/class.ilObjAdvancedEditing.php';
61  }
static _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()

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

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

References $config, ilHtmlPurifierAbstractLibWrapper\_getCacheDirectory(), getAllowedElements(), and getPurifierType().

22  : HTMLPurifier_Config
23  {
24  $config = HTMLPurifier_Config::createDefault();
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  $config->autoFinalize = false;
32  $config->set(
33  'URI.AllowedSchemes',
34  array_merge(
35  $config->get('URI.AllowedSchemes'),
36  ['data' => true]
37  )
38  );
39  $config->autoFinalize = true;
40  if ($def = $config->maybeGetRawHTMLDefinition()) {
41  $def->addAttribute('a', 'target', 'Enum#_blank,_self,_target,_top');
42  }
43 
44  return $config;
45  }
if(!array_key_exists('PATH_INFO', $_SERVER)) $config
Definition: metadata.php:68
+ Here is the call graph for this function:

◆ getPurifierType()

ilAssHtmlPurifier::getPurifierType ( )
protected

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

Referenced by getElementsUsedForAdvancedEditing(), and getPurifierConfigInstance().

15  {
16  return 'assessment';
17  }
+ Here is the caller graph for this function:

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