ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
class.ilAssHtmlPurifier.php
Go to the documentation of this file.
1<?php
2/* Copyright (c) 1998-2013 ILIAS open source, Extended GPL, see docs/LICENSE */
3
4require_once 'Services/Html/classes/class.ilHtmlPurifierAbstractLibWrapper.php';
5
13{
14 protected function getPurifierType()
15 {
16 return 'assessment';
17 }
18
22 protected function getPurifierConfigInstance()
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 }
37
38 private function getAllowedElements()
39 {
40 $allowedElements = $this->getElementsUsedForAdvancedEditing();
41
42 $allowedElements = $this->makeElementListTinyMceCompliant($allowedElements);
43 $allowedElements = $this->removeUnsupportedElements($allowedElements);
44
45 return $allowedElements;
46 }
47
49 {
50 include_once 'Services/AdvancedEditing/classes/class.ilObjAdvancedEditing.php';
52 }
53}
static createDefault()
Convenience constructor that creates a default configuration object.
Definition: Config.php:154
Abstract class wrapping the HTMLPurifier instance.
removeUnsupportedElements($a_array)
Removes all unsupported elements.
static _getCacheDirectory()
Get the directory for HTMLPurifier cache files.
& _getUsedHTMLTags($a_module="")
Returns an array of all allowed HTML tags for text editing.