ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilHtmlPurifierFactory Class Reference

Factory for creating purifier instances. More...

+ Collaboration diagram for ilHtmlPurifierFactory:

Static Public Member Functions

static _getInstanceByType ($a_type)
 Factory method for creating purifier instances. More...
 

Detailed Description

Factory for creating purifier instances.

Author
Michael Jansen mjans.nosp@m.en@d.nosp@m.ataba.nosp@m.y.de
Version
$Id$

Definition at line 11 of file class.ilHtmlPurifierFactory.php.

Member Function Documentation

◆ _getInstanceByType()

static ilHtmlPurifierFactory::_getInstanceByType (   $a_type)
static

Factory method for creating purifier instances.

public

Parameters
string$a_typetype for the concrete purifier instance
Returns
ilHtmlPurifierInterface A purifier instance
Exceptions
ilHtmlPurifierNotFoundException

Definition at line 23 of file class.ilHtmlPurifierFactory.php.

References $a_type, and $DIC.

Referenced by ilObjForumGUI\getCensorshipFormHTML(), assQuestion\getHtmlQuestionContentPurifier(), assQuestion\getHtmlUserSolutionPurifier(), and ilObjForumGUI\initTopicCreateForm().

24  {
25  global $DIC;
26 
27  switch ($a_type) {
28  case 'frm_post':
29  require_once 'Services/Html/classes/class.ilHtmlForumPostPurifier.php';
30  return new ilHtmlForumPostPurifier();
31  break;
32 
33  case 'qpl_usersolution':
34  require_once 'Modules/TestQuestionPool/classes/class.ilAssHtmlUserSolutionPurifier.php';
35  return new ilAssHtmlUserSolutionPurifier();
36  break;
37  }
38 
39  require_once 'Services/Html/exceptions/class.ilHtmlPurifierNotFoundException.php';
40  throw new ilHtmlPurifierNotFoundException(sprintf($DIC->language()->txt('frm_purifier_not_implemented_for_type_x'), $a_type));
41  }
Concrete class for sanitizing html of forum posts.
global $DIC
Definition: saml.php:7
Class for html related exception handling in ILIAS.
$a_type
Definition: workflow.php:92
+ Here is the caller graph for this function:

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