ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
ilUIHookProcessor Class Reference

UI interface hook processor. More...

+ Collaboration diagram for ilUIHookProcessor:

Public Member Functions

 __construct ($a_comp, $a_part, $a_pars)
 Constructor. More...
 
 replaced ()
 Should HTML be replaced completely? More...
 
 getHTML ($html)
 Get HTML. More...
 

Data Fields

 $append = array()
 
 $prepend = array()
 
 $replace = ""
 

Detailed Description

UI interface hook processor.

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Version
$Id$

Definition at line 12 of file class.ilUIHookProcessor.php.

Constructor & Destructor Documentation

◆ __construct()

ilUIHookProcessor::__construct (   $a_comp,
  $a_part,
  $a_pars 
)

Constructor.

Parameters

Definition at line 24 of file class.ilUIHookProcessor.php.

References ilUIHookPluginGUI\APPEND, ilPluginAdmin\getPluginObject(), IL_COMP_SERVICE, ilUIHookPluginGUI\KEEP, ilUIHookPluginGUI\PREPEND, ilUIHookPluginGUI\REPLACE, and replaced().

25  {
26  global $ilPluginAdmin;
27 
28  include_once("./Services/UIComponent/classes/class.ilUIHookPluginGUI.php");
29 
30  // user interface hook [uihk]
31  $pl_names = $ilPluginAdmin->getActivePluginsForSlot(IL_COMP_SERVICE, "UIComponent", "uihk");
32  $this->replaced = false;
33  foreach ($pl_names as $pl)
34  {
35  $ui_plugin = ilPluginAdmin::getPluginObject(IL_COMP_SERVICE, "UIComponent", "uihk", $pl);
36  $gui_class = $ui_plugin->getUIClassInstance();
37  $resp = $gui_class->getHTML($a_comp, $a_part, $a_pars);
38 
39  if ($resp["mode"] != ilUIHookPluginGUI::KEEP)
40  {
41  switch($resp["mode"])
42  {
44  $this->prepend[] = $resp["html"];
45  break;
46 
48  $this->append[] = $resp["html"];
49  break;
50 
52  if (!$this->replaced)
53  {
54  $this->replace = $resp["html"];
55  $this->replaced = true;
56  }
57  break;
58  }
59  }
60  }
61  }
replaced()
Should HTML be replaced completely?
static getPluginObject($a_ctype, $a_cname, $a_slot_id, $a_pname)
Get Plugin Object.
const IL_COMP_SERVICE
+ Here is the call graph for this function:

Member Function Documentation

◆ getHTML()

ilUIHookProcessor::getHTML (   $html)

Get HTML.

Parameters
string$htmlhtml
Returns
string html

Definition at line 79 of file class.ilUIHookProcessor.php.

References $html, $replace, and replaced().

80  {
81  if ($this->replaced)
82  {
84  }
85  foreach ($this->append as $a)
86  {
87  $html.= $a;
88  }
89  foreach ($this->prepend as $p)
90  {
91  $html = $p.$html;
92  }
93  return $html;
94  }
replaced()
Should HTML be replaced completely?
$html
Definition: example_001.php:87
+ Here is the call graph for this function:

◆ replaced()

ilUIHookProcessor::replaced ( )

Should HTML be replaced completely?

Returns

Definition at line 68 of file class.ilUIHookProcessor.php.

Referenced by __construct(), and getHTML().

69  {
70  return $this->replaced;
71  }
+ Here is the caller graph for this function:

Field Documentation

◆ $append

ilUIHookProcessor::$append = array()

Definition at line 14 of file class.ilUIHookProcessor.php.

◆ $prepend

ilUIHookProcessor::$prepend = array()

Definition at line 15 of file class.ilUIHookProcessor.php.

◆ $replace

ilUIHookProcessor::$replace = ""

Definition at line 16 of file class.ilUIHookProcessor.php.

Referenced by getHTML().


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