ILIAS  Release_4_4_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
class.ilComponentsTableGUI.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  function __construct($a_parent_obj, $a_parent_cmd = "")
19  {
20  global $ilCtrl, $lng;
21 
22  parent::__construct($a_parent_obj, $a_parent_cmd);
23 
24  $this->setId("cmpstblslt");
25 
26  $this->setTitle($lng->txt("cmps_slots"));
27 
28  $this->addColumn($lng->txt("cmps_service")." / ".$lng->txt("cmps_module"), "subdir");
29  $this->addColumn($lng->txt("cmps_plugin_slot"), "name");
30  $this->addColumn($lng->txt("cmps_dir"), "dir");
31  $this->addColumn($lng->txt("cmps_lang_prefix"), "lang");
32  $this->addColumn($lng->txt("action"), "lang");
33 
34  $this->setDefaultOrderField("name");
35  $this->setLimit(10000);
36 
37  $this->setEnableHeader(true);
38  $this->setFormAction($ilCtrl->getFormAction($a_parent_obj));
39  $this->setRowTemplate("tpl.table_row_component.html",
40  "Services/Component");
41 
42  $this->getComponents();
43  }
44 
48  function getComponents()
49  {
50  $data = array();
51 
52  include_once("./Services/Component/classes/class.ilService.php");
53  foreach(ilService::getAvailableCoreServices() as $obj)
54  {
55  foreach (ilComponent::lookupPluginSlots(IL_COMP_SERVICE, $obj["subdir"]) as $slot)
56  {
57  $data[] = array(
58  "subdir" => $obj["subdir"],
59  "id" => $slot["id"],
60  "name" => $slot["name"],
61  "dir" => $slot["dir_pres"],
62  "lang" => $slot["lang_prefix"],
63  "ctype" => IL_COMP_SERVICE
64  );
65  }
66  }
67 
68  include_once("./Services/Component/classes/class.ilModule.php");
69  foreach(ilModule::getAvailableCoreModules() as $obj)
70  {
71  foreach (ilComponent::lookupPluginSlots(IL_COMP_MODULE, $obj["subdir"]) as $slot)
72  {
73  $data[] = array(
74  "subdir" => $obj["subdir"],
75  "id" => $slot["id"],
76  "name" => $slot["name"],
77  "dir" => $slot["dir_pres"],
78  "lang" => $slot["lang_prefix"],
79  "ctype" => IL_COMP_MODULE
80  );
81  }
82  }
83 
84  $this->setData($data);
85  }
86 
91  protected function fillRow($a_set)
92  {
93  global $lng, $ilCtrl;
94 
95  $this->tpl->setVariable("SLOT_NAME", $a_set["name"]);
96  $this->tpl->setVariable("SLOT_ID", $a_set["id"]);
97  $this->tpl->setVariable("SLOT_DIR", $a_set["dir"]);
98  $this->tpl->setVariable("LANG_PREFIX", $a_set["lang"]);
99 
100  $ilCtrl->setParameter($this->parent_obj, "ctype", $a_set["ctype"]);
101  $ilCtrl->setParameter($this->parent_obj, "cname", $a_set["subdir"]);
102  $ilCtrl->setParameter($this->parent_obj, "slot_id", $a_set["id"]);
103  $this->tpl->setVariable("HREF_SHOW_SLOT",
104  $ilCtrl->getLinkTarget($this->parent_obj, "showPluginSlotInfo"));
105  $this->tpl->setVariable("TXT_SHOW_SLOT", $lng->txt("cmps_show_details"));
106 
107  $this->tpl->setVariable("TXT_MODULE_NAME", $a_set["subdir"]);
108  }
109 }
110 
111 ?>