ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
class.ilUIHookProcessor.php
Go to the documentation of this file.
1 <?php
2 
3 /* Copyright (c) 1998-2011 ILIAS open source, Extended GPL, see docs/LICENSE */
4 
13 {
17  protected $plugin_admin;
18 
19  public $append = array();
20  public $prepend = array();
21  public $replace = "";
22 
29  public function __construct($a_comp, $a_part, $a_pars)
30  {
31  global $DIC;
32 
33  $this->plugin_admin = $DIC["ilPluginAdmin"];
34  $ilPluginAdmin = $DIC["ilPluginAdmin"];
35 
36  include_once("./Services/UIComponent/classes/class.ilUIHookPluginGUI.php");
37 
38  // user interface hook [uihk]
39  $pl_names = $ilPluginAdmin->getActivePluginsForSlot(IL_COMP_SERVICE, "UIComponent", "uihk");
40  $this->replaced = false;
41  foreach ($pl_names as $pl) {
42  $ui_plugin = ilPluginAdmin::getPluginObject(IL_COMP_SERVICE, "UIComponent", "uihk", $pl);
43  $gui_class = $ui_plugin->getUIClassInstance();
44  $resp = $gui_class->getHTML($a_comp, $a_part, $a_pars);
45 
46  if ($resp["mode"] != ilUIHookPluginGUI::KEEP) {
47  switch ($resp["mode"]) {
49  $this->prepend[] = $resp["html"];
50  break;
51 
53  $this->append[] = $resp["html"];
54  break;
55 
57  if (!$this->replaced) {
58  $this->replace = $resp["html"];
59  $this->replaced = true;
60  }
61  break;
62  }
63  }
64  }
65  }
66 
72  public function replaced()
73  {
74  return $this->replaced;
75  }
76 
83  public function getHTML($html)
84  {
85  if ($this->replaced) {
87  }
88  foreach ($this->append as $a) {
89  $html.= $a;
90  }
91  foreach ($this->prepend as $p) {
92  $html = $p . $html;
93  }
94  return $html;
95  }
96 }
global $DIC
Definition: saml.php:7
replaced()
Should HTML be replaced completely?
__construct($a_comp, $a_part, $a_pars)
Constructor.
static getPluginObject($a_ctype, $a_cname, $a_slot_id, $a_pname)
Get Plugin Object.
Create styles array
The data for the language used.
$html
Definition: example_001.php:87
const IL_COMP_SERVICE