ILIAS  release_4-3 Revision
 All Data Structures Namespaces Files Functions Variables Groups Pages
class.ilPluginsOverviewTableGUI.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 include_once("Services/Table/classes/class.ilTable2GUI.php");
5 include_once("Services/Component/classes/class.ilComponent.php");
6 
7 
17 {
18  private $mode;
19 
20  function __construct($a_parent_obj, $a_parent_cmd = "")
21  {
22  global $ilCtrl, $lng;
23 
24  $this->mode = $a_mode;
25 
26  parent::__construct($a_parent_obj, $a_parent_cmd);
27 
28  $this->addColumn($lng->txt("cmps_plugin_slot"));
29  $this->addColumn($lng->txt("cmps_plugins"));
30  $this->addColumn($lng->txt("actions"));
31  $this->setEnableHeader(true);
32  $this->setFormAction($ilCtrl->getFormAction($a_parent_obj));
33  $this->setRowTemplate("tpl.plugin_overview_row.html",
34  "Services/Component");
35  $this->getComponents();
36  $this->setLimit(10000);
37 
38  }
39 
43  function getComponents()
44  {
45  include_once("./Services/Component/classes/class.ilModule.php");
47  $slots = array();
48  foreach ($modules as $m)
49  {
51  $m["subdir"]);
52  foreach ($plugin_slots as $ps)
53  {
54  $plugins = array();
55  include_once("./Services/Component/classes/class.ilPluginSlot.php");
56  $slot = new ilPluginSlot(IL_COMP_MODULE, $m["subdir"], $ps["id"]);
57  foreach ($slot->getPluginsInformation() as $p)
58  {
59  $plugins[] = $p;
60  }
61  if (count($plugins) > 0)
62  {
63  $slots[] = array("slot_name" => $slot->getSlotName(),
64  "component_type" => IL_COMP_MODULE,
65  "component_name" => $m["subdir"],
66  "slot_id" => $ps["id"],
67  "plugins" => $plugins);
68  }
69  }
70  }
71  include_once("./Services/Component/classes/class.ilService.php");
73  foreach ($services as $s)
74  {
76  $s["subdir"]);
77  foreach ($plugin_slots as $ps)
78  {
79  $plugins = array();
80  $slot = new ilPluginSlot(IL_COMP_SERVICE, $s["subdir"], $ps["id"]);
81  foreach ($slot->getPluginsInformation() as $p)
82  {
83  $plugins[] = $p;
84  }
85  if (count($plugins) > 0)
86  {
87  $slots[] = array("slot_name" => $slot->getSlotName(),
88  "component_type" => IL_COMP_SERVICE,
89  "component_name" => $s["subdir"],
90  "slot_id" => $ps["id"],
91  "plugins" => $plugins);
92  }
93  }
94  }
95  $this->setData($slots);
96  //include_once("./Services/Component/classes/class.ilService.php");
97  //$services = ilService::getAvailableCoreServices();
98  }
99 
104  protected function fillRow($a_set)
105  {
106  global $ilCtrl, $lng;
107 
108  $ilCtrl->setParameter($this->parent_obj, "ctype", $a_set["component_type"]);
109  $ilCtrl->setParameter($this->parent_obj, "cname", $a_set["component_name"]);
110  $ilCtrl->setParameter($this->parent_obj, "slot_id", $a_set["slot_id"]);
111  $this->tpl->setCurrentBlock("cmd");
112  $this->tpl->setVariable("TXT_CMD", $lng->txt("administrate"));
113  $this->tpl->setVariable("HREF_CMD",
114  $ilCtrl->getLinkTarget($this->parent_obj, "showPluginSlot"));
115  $this->tpl->parseCurrentBlock();
116 
117  foreach ($a_set["plugins"] as $p)
118  {
119  $act_str = ($p["is_active"])
120  ? " <b>(".$lng->txt("active").")</b>"
121  : "";
122  $this->tpl->setCurrentBlock("plugin");
123  $this->tpl->setVariable("TXT_PLUGIN_NAME", $p["name"].$act_str);
124  $this->tpl->parseCurrentBlock();
125  }
126  $this->tpl->setVariable("TXT_SLOT_NAME",
127  $a_set["slot_name"]);
128  $this->tpl->setVariable("TXT_COMP_NAME",
129  $a_set["component_type"]."/".$a_set["component_name"]);
130  }
131 
132 }
133 ?>