ILIAS  release_4-3 Revision
 All Data Structures Namespaces Files Functions Variables Groups Pages
class.ilHtmlForumPostPurifier.php
Go to the documentation of this file.
1 <?php
2 /* Copyright (c) 1998-2009 ILIAS open source, Extended GPL, see docs/LICENSE */
3 
4 require_once 'Services/Html/classes/class.ilHtmlPurifierAbstractLibWrapper.php';
5 
14 {
24  public static $_type = 'frm_post';
25 
32  public function __construct()
33  {
35  }
36 
44  protected function getPurifierConfigInstance()
45  {
46  include_once 'Services/AdvancedEditing/classes/class.ilObjAdvancedEditing.php';
47 
49  $config->set('HTML.DefinitionID', 'ilias forum post');
50  $config->set('HTML.DefinitionRev', 1);
51  $config->set('Cache.SerializerPath', ilHtmlPurifierAbstractLibWrapper::_getCacheDirectory());
52  $config->set('HTML.Doctype', 'XHTML 1.0 Strict');
53 
54  $tags = ilObjAdvancedEditing::_getUsedHTMLTags(self::$_type);
55  $tags = $this->makeElementListTinyMceCompliant($tags);
56  $config->set('HTML.AllowedElements', $this->removeUnsupportedElements($tags));
57  $config->set('HTML.ForbiddenAttributes', 'div@style');
58 
59  if ($def = $config->maybeGetRawHTMLDefinition()) {
60  $def->addAttribute('a', 'target', 'Enum#_blank,_self,_target,_top');
61  }
62 
63  return $config;
64  }
65 }
66 ?>