4 include_once(
"Services/Table/classes/class.ilTable2GUI.php");
5 include_once(
"Services/Component/classes/class.ilComponent.php");
22 public function __construct($a_parent_obj, $a_parent_cmd =
"")
25 $this->lng = $DIC->language();
26 $this->ctrl = $DIC->ctrl();
28 parent::__construct($a_parent_obj, $a_parent_cmd);
30 $this->
setId(
"cmpspl");
32 $this->
addColumn($this->lng->txt(
"cmps_plugin"),
"plugin_name");
33 $this->
addColumn($this->lng->txt(
"id"),
"plugin_id");
34 $this->
addColumn($this->lng->txt(
"cmps_plugin_slot"),
"slot_name");
35 $this->
addColumn($this->lng->txt(
"cmps_component"),
"component_name");
36 $this->
addColumn($this->lng->txt(
"active"),
"plugin_active");
37 $this->
addColumn($this->lng->txt(
"action"));
42 $this->
setFormAction($this->ctrl->getFormAction($a_parent_obj));
44 "tpl.plugin_overview_row.html",
50 include_once(
"./Services/UIComponent/AdvancedSelectionList/classes/class.ilAdvancedSelectionListGUI.php");
77 include_once(
"./Services/Component/classes/class.ilModule.php");
90 include_once(
"./Services/Component/classes/class.ilService.php");
105 protected function addPluginData(array &$plugins, array $core_items, $core_type)
107 foreach ($core_items as $core_item) {
109 foreach ($plugin_slots as $plugin_slot) {
110 $slot =
new ilPluginSlot($core_type, $core_item[
"subdir"], $plugin_slot[
"id"]);
111 foreach ($slot->getPluginsInformation() as $plugin) {
112 if ($core_type && $slot && $core_item[
"subdir"] && is_array($plugin) && count($plugin) > 0) {
113 $plugins[] = $this->
gatherPluginData($core_type, $slot, $core_item[
"subdir"], $plugin);
133 if (!$a_plugin[
"component_type"]) {
136 $plugin_db_data =
ilPlugin::getPluginRecord($a_plugin[
"component_type"], $a_plugin[
"component_name"], $a_plugin[
"slot_id"], $a_plugin[
"name"]);
138 $config_class = null;
145 return array(
"slot_name" => $a_slot->
getSlotName(),
147 "component_name" => $a_slot_subdir,
149 "plugin_id" => $a_plugin[
"id"],
150 "plugin_name" => $a_plugin[
"name"],
151 "must_install" => $a_plugin[
"must_install"],
152 "plugin_active" => $a_plugin[
"is_active"],
153 "activation_possible" => $a_plugin[
"activation_possible"],
154 "needs_update" => $a_plugin[
"needs_update"],
155 "config_class" => $config_class,
156 "has_lang" => (bool)
sizeof(
171 $rbacsystem = $DIC->rbac()->system();
173 $this->tpl->setVariable(
"TXT_SLOT_NAME", $a_set[
"slot_name"]);
174 $this->tpl->setVariable(
176 $a_set[
"component_type"] .
"/" . $a_set[
"component_name"]
179 if ($a_set[
"plugin_active"]) {
180 $this->tpl->setCurrentBlock(
"active");
181 $this->tpl->setVariable(
"TXT_ACTIVE", $this->lng->txt(
"yes"));
182 $this->tpl->parseCurrentBlock();
184 $this->tpl->setCurrentBlock(
"inactive");
185 $this->tpl->setVariable(
"TXT_INACTIVE", $this->lng->txt(
"no"));
186 $this->tpl->parseCurrentBlock();
189 $this->tpl->setVariable(
"TXT_PLUGIN_NAME", $a_set[
"plugin_name"]);
190 $this->tpl->setVariable(
"TXT_PLUGIN_ID", $a_set[
"plugin_id"]);
192 if ($rbacsystem->checkAccess(
'write',
$_GET[
'ref_id'])) {
194 $this->tpl->setVariable(
"ACTION_SELECTOR", $this->
getActionMenu($actions, $a_set[
"plugin_id"]));
210 $alist->setId($plugin_id);
211 $alist->setListTitle($this->lng->txt(
"actions"));
213 foreach ($actions as $caption => $cmd) {
214 $alist->addItem($caption,
"", $cmd);
217 return $alist->getHTML();
233 $this->ctrl->setParameter($this->parent_obj,
"plugin_id", $a_set[
"plugin_id"]);
235 $this->ctrl->setParameter($this->parent_obj,
"plugin_id", null);
237 if ($a_set[
"must_install"]) {
240 if ($a_set[
"config_class"]) {
241 $actions[$this->lng->txt(
"cmps_configure")]
242 = $this->ctrl->getLinkTargetByClass($a_set[
"config_class"],
"configure");
245 if ($a_set[
"has_lang"]) {
249 if ($a_set[
"plugin_active"]) {
253 if ($a_set[
"activation_possible"]) {
258 if ($a_set[
"needs_update"]) {
281 $this->ctrl->setParameter($this->parent_obj,
"ctype", $a_set[
"component_type"]);
282 $this->ctrl->setParameter($this->parent_obj,
"cname", $a_set[
"component_name"]);
283 $this->ctrl->setParameter($this->parent_obj,
"slot_id", $a_set[
"slot_id"]);
284 $this->ctrl->setParameter($this->parent_obj,
"pname", $a_set[
"plugin_name"]);
295 $this->ctrl->setParameter($this->parent_obj,
"ctype", null);
296 $this->ctrl->setParameter($this->parent_obj,
"cname", null);
297 $this->ctrl->setParameter($this->parent_obj,
"slot_id", null);
298 $this->ctrl->setParameter($this->parent_obj,
"pname", null);
313 $actions[$this->lng->txt($caption)]
314 = $this->ctrl->getLinkTarget($this->parent_obj, $command);
setDefaultOrderField($a_defaultorderfield)
Set Default order field.
getSlotName()
Get Slot Name.
setParameter(array $a_set)
Set parameter for plugin.
getActionMenu(array $actions, $plugin_id)
Get action menu for each row.
static getAvailableLangFiles(string $a_lang_directory)
Get array of all language files in the plugin.
gatherPluginData($a_type, ilPluginSlot $a_slot, $a_slot_subdir, array $a_plugin)
Process plugin data for table row.
addPluginData(array &$plugins, array $core_items, $core_type)
Get plugin informations.
getActionMenuEntries(array $a_set)
Get entries for action menu.
static getPluginRecord(string $a_ctype, string $a_cname, string $a_slot_id, string $a_pname)
addCommandToActions(array &$actions, $caption, $command)
Add command to actions.
static getAvailableCoreServices()
Get all available core services.
static hasConfigureClass(string $a_slot_dir, array $plugin_data, array $plugin_db_data)
Has the plugin a configure class?
clearParameter()
Clear parameter.
setRowTemplate($a_template, $a_template_dir="")
Set row template.
static getConfigureClassName(array $plugin_data)
Get plugin configure class name.
TableGUI class for components listing.
User interface class for advanced drop-down selection lists.
setFormAction($a_form_action, $a_multipart=false)
Set Form action parameter.
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.
getPluginsDirectory()
Get directory of.
fillRow($a_set)
Standard Version of Fill Row.
getComponents()
Get pages for list.
setEnableHeader($a_enableheader)
Set Enable Header.
getServicesCoreItems()
Get all available services.
getModulesCoreItems()
Get all available modules.
setLimit($a_limit=0, $a_default_limit=0)
static getAvailableCoreModules()
Get all available core modules.
static lookupPluginSlots($a_type, $a_name)
Lookup all plugin slots of a component.
__construct($a_parent_obj, $a_parent_cmd="")