ILIAS  Release_5_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
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 
4 require_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 }