ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
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
4include_once("Services/Table/classes/class.ilTable2GUI.php");
5include_once("Services/Component/classes/class.ilComponent.php");
6
7
17{
18 public function __construct($a_parent_obj, $a_parent_cmd = "")
19 {
20 global $DIC;
21 $ilCtrl = $DIC->ctrl();
22 $lng = $DIC->language();
23
24 parent::__construct($a_parent_obj, $a_parent_cmd);
25
26 $this->setId("cmpstblslt");
27
28 $this->setTitle($lng->txt("cmps_slots"));
29
30 $this->addColumn($lng->txt("cmps_service") . " / " . $lng->txt("cmps_module"), "subdir");
31 $this->addColumn($lng->txt("cmps_plugin_slot"), "name");
32 $this->addColumn($lng->txt("cmps_dir"), "dir");
33 $this->addColumn($lng->txt("cmps_lang_prefix"), "lang");
34 $this->addColumn($lng->txt("action"), "lang");
35
36 $this->setDefaultOrderField("name");
37 $this->setLimit(10000);
38
39 $this->setEnableHeader(true);
40 $this->setFormAction($ilCtrl->getFormAction($a_parent_obj));
41 $this->setRowTemplate(
42 "tpl.table_row_component.html",
43 "Services/Component"
44 );
45
46 $this->getComponents();
47 }
48
52 public function getComponents()
53 {
54 $data = array();
55
56 include_once("./Services/Component/classes/class.ilService.php");
57 foreach (ilService::getAvailableCoreServices() as $obj) {
58 foreach (ilComponent::lookupPluginSlots(IL_COMP_SERVICE, $obj["subdir"]) as $slot) {
59 $data[] = array(
60 "subdir" => $obj["subdir"],
61 "id" => $slot["id"],
62 "name" => $slot["name"],
63 "dir" => $slot["dir_pres"],
64 "lang" => $slot["lang_prefix"],
65 "ctype" => IL_COMP_SERVICE
66 );
67 }
68 }
69
70 include_once("./Services/Component/classes/class.ilModule.php");
71 foreach (ilModule::getAvailableCoreModules() as $obj) {
72 foreach (ilComponent::lookupPluginSlots(IL_COMP_MODULE, $obj["subdir"]) as $slot) {
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 $DIC;
94 $lng = $DIC->language();
95 $ilCtrl = $DIC->ctrl();
96
97 $this->tpl->setVariable("SLOT_NAME", $a_set["name"]);
98 $this->tpl->setVariable("SLOT_ID", $a_set["id"]);
99 $this->tpl->setVariable("SLOT_DIR", $a_set["dir"]);
100 $this->tpl->setVariable("LANG_PREFIX", $a_set["lang"]);
101
102 $ilCtrl->setParameter($this->parent_obj, "ctype", $a_set["ctype"]);
103 $ilCtrl->setParameter($this->parent_obj, "cname", $a_set["subdir"]);
104 $ilCtrl->setParameter($this->parent_obj, "slot_id", $a_set["id"]);
105 $this->tpl->setVariable(
106 "HREF_SHOW_SLOT",
107 $ilCtrl->getLinkTarget($this->parent_obj, "showPluginSlotInfo")
108 );
109 $this->tpl->setVariable("TXT_SHOW_SLOT", $lng->txt("cmps_show_details"));
110
111 $this->tpl->setVariable("TXT_MODULE_NAME", $a_set["subdir"]);
112 }
113}
An exception for terminatinating execution or to throw for unit testing.
const IL_COMP_SERVICE
const IL_COMP_MODULE
static lookupPluginSlots($a_type, $a_name)
Lookup all plugin slots of a component.
TableGUI class for components listing.
getComponents()
Get pages for list.
fillRow($a_set)
Standard Version of Fill Row.
__construct($a_parent_obj, $a_parent_cmd="")
Constructor.
static getAvailableCoreModules()
Get all available core modules.
static getAvailableCoreServices()
Get all available core services.
Class ilTable2GUI.
setEnableHeader($a_enableheader)
Set Enable Header.
setTitle($a_title, $a_icon=0, $a_icon_alt=0)
Set title and title icon.
setData($a_data)
set table data @access public
setRowTemplate($a_template, $a_template_dir="")
Set row template.
setLimit($a_limit=0, $a_default_limit=0)
set max.
setDefaultOrderField($a_defaultorderfield)
Set Default order field.
addColumn( $a_text, $a_sort_field="", $a_width="", $a_is_checkbox_action_column=false, $a_class="", $a_tooltip="", $a_tooltip_with_html=false)
Add a column to the header.
setId($a_val)
Set id.
setFormAction($a_form_action, $a_multipart=false)
Set Form action parameter.
global $ilCtrl
Definition: ilias.php:18
global $DIC
Definition: saml.php:7