ILIAS  release_4-4 Revision
All Data Structures Namespaces Files Functions Variables Modules Pages
TokenFactory.php
Go to the documentation of this file.
1 <?php
2 
15 {
16 
21  // p stands for prototype
23 
27  public function __construct() {
28  $this->p_start = new HTMLPurifier_Token_Start('', array());
29  $this->p_end = new HTMLPurifier_Token_End('');
30  $this->p_empty = new HTMLPurifier_Token_Empty('', array());
31  $this->p_text = new HTMLPurifier_Token_Text('');
32  $this->p_comment= new HTMLPurifier_Token_Comment('');
33  }
34 
41  public function createStart($name, $attr = array()) {
42  $p = clone $this->p_start;
43  $p->__construct($name, $attr);
44  return $p;
45  }
46 
52  public function createEnd($name) {
53  $p = clone $this->p_end;
54  $p->__construct($name);
55  return $p;
56  }
57 
64  public function createEmpty($name, $attr = array()) {
65  $p = clone $this->p_empty;
66  $p->__construct($name, $attr);
67  return $p;
68  }
69 
75  public function createText($data) {
76  $p = clone $this->p_text;
77  $p->__construct($data);
78  return $p;
79  }
80 
86  public function createComment($data) {
87  $p = clone $this->p_comment;
88  $p->__construct($data);
89  return $p;
90  }
91 
92 }
93 
94 // vim: et sw=4 sts=4
createComment($data)
Creates a HTMLPurifier_Token_Comment.
Concrete end token class.
Definition: End.php:10
createEnd($name)
Creates a HTMLPurifier_Token_End.
Concrete start token class.
Definition: Start.php:6
Factory for token generation.
createText($data)
Creates a HTMLPurifier_Token_Text.
__construct()
Generates blank prototypes for cloning.
$p_start
Prototypes that will be cloned.
Concrete empty token class.
Definition: Empty.php:6
while($lm_rec=$ilDB->fetchAssoc($lm_set)) $data
createEmpty($name, $attr=array())
Creates a HTMLPurifier_Token_Empty.
Concrete text token class.
Definition: Text.php:12
Concrete comment token class.
Definition: Comment.php:6
createStart($name, $attr=array())
Creates a HTMLPurifier_Token_Start.