ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
All Data Structures Namespaces Files Functions Variables Modules Pages
ilWebDAVMountInstructionsDocumentPurifier Class Reference
+ Inheritance diagram for ilWebDAVMountInstructionsDocumentPurifier:
+ Collaboration diagram for ilWebDAVMountInstructionsDocumentPurifier:

Public Member Functions

 __construct (array $allowedTags=null, string $cacheDirectory=null)
 ilTermsOfServiceDocumentHtmlPurifier constructor. More...
 
- Public Member Functions inherited from ilHtmlPurifierAbstractLibWrapper
 __construct ()
 ilHtmlPurifierAbstractLibWrapper constructor. More...
 
 purify (string $html)
 
 purifyArray (array $htmlCollection)
 

Protected Member Functions

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

Protected Attributes

 $cacheDirectory = ''
 
- Protected Attributes inherited from ilHtmlPurifierAbstractLibWrapper
 $purifier
 

Private Attributes

 $allowedTags = []
 

Additional Inherited Members

- Static Public Member Functions inherited from ilHtmlPurifierAbstractLibWrapper
static _getCacheDirectory ()
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilWebDAVMountInstructionsDocumentPurifier::__construct ( array  $allowedTags = null,
string  $cacheDirectory = null 
)

ilTermsOfServiceDocumentHtmlPurifier constructor.

Parameters
array | null$allowedTags
string$cacheDirectory

Definition at line 17 of file class.ilWebDAVMountInstructionsDocumentPurifier.php.

References $allowedTags, $cacheDirectory, ILIAS\GlobalScreen\Provider\__construct(), ilHtmlPurifierAbstractLibWrapper\_getCacheDirectory(), and ilObjAdvancedEditing\_getUsedHTMLTags().

18  {
19  if (null === $cacheDirectory) {
21  }
22  $this->cacheDirectory = $cacheDirectory;
23 
24  if (null === $allowedTags) {
26  }
27  $this->allowedTags = $allowedTags;
28 
30  $this->allowedTags = $allowedTags;
31  }
static _getUsedHTMLTags($a_module="")
Returns an array of all allowed HTML tags for text editing.
__construct(Container $dic, ilPlugin $plugin)
+ Here is the call graph for this function:

Member Function Documentation

◆ getPurifierConfigInstance()

ilWebDAVMountInstructionsDocumentPurifier::getPurifierConfigInstance ( )
protected

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

References $allowedTags, $config, ilHtmlPurifierAbstractLibWrapper\makeElementListTinyMceCompliant(), and ilHtmlPurifierAbstractLibWrapper\removeUnsupportedElements().

36  : HTMLPurifier_Config
37  {
38  $config = HTMLPurifier_Config::createDefault();
39  $config->set('HTML.DefinitionID', 'ilias termsofservice document');
40  $config->set('HTML.DefinitionRev', 1);
41  $config->set('HTML.TargetBlank', true);
42  $config->set('Cache.SerializerPath', $this->cacheDirectory);
43  $config->set('HTML.Doctype', 'XHTML 1.0 Strict');
44 
45  $tags = $this->allowedTags;
46  $tags = $this->makeElementListTinyMceCompliant($tags);
47 
48  $tags[] = 'b';
49  $tags[] = 'i';
50 
51  $config->set('HTML.AllowedElements', $this->removeUnsupportedElements($tags));
52  $config->set('HTML.ForbiddenAttributes', 'div@style');
53 
54  if ($def = $config->maybeGetRawHTMLDefinition()) {
55  $def->addAttribute('a', 'target', 'Enum#_blank,_self,_target,_top');
56  }
57 
58  return $config;
59  }
if(!array_key_exists('PATH_INFO', $_SERVER)) $config
Definition: metadata.php:68
removeUnsupportedElements(array $elements)
Removes all unsupported elements.
+ Here is the call graph for this function:

Field Documentation

◆ $allowedTags

ilWebDAVMountInstructionsDocumentPurifier::$allowedTags = []
private

◆ $cacheDirectory

ilWebDAVMountInstructionsDocumentPurifier::$cacheDirectory = ''
protected

Definition at line 10 of file class.ilWebDAVMountInstructionsDocumentPurifier.php.

Referenced by __construct().


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