ILIAS  release_7 Revision v7.30-3-g800a261c036
class.ilObjComponentSettingsGUI.php
Go to the documentation of this file.
1<?php
2/* Copyright (c) 1998-2009 ILIAS open source, Extended GPL, see docs/LICENSE */
3include_once("./Services/Object/classes/class.ilObjectGUI.php");
4
11{
12 private const TYPE = 'cmps';
13 public const CMD_DEFAULT = "listPlugins";
14 public const CMD_LIST_SLOTS = "listSlots";
15 public const TAB_PLUGINS = "plugins";
16 public const CMD_INSTALL_PLUGIN = "installPlugin";
17 public const CMD_CONFIGURE = "configure";
18 public const CMD_REFRESH_LANGUAGES = "refreshLanguages";
19 public const CMD_ACTIVATE_PLUGIN = "activatePlugin";
20 public const CMD_DEACTIVATE_PLUGIN = "deactivatePlugin";
21 public const CMD_UPDATE_PLUGIN = "updatePlugin";
22 public const P_CTYPE = "ctype";
23 public const P_CNAME = "cname";
24 public const P_SLOT_ID = "slot_id";
25 public const P_PLUGIN_NAME = "pname";
26 public const P_PLUGIN_ID = "plugin_id";
27 public const CMD_SHOW_PLUGIN = "showPlugin";
28 public const CMD_JUMP_TO_PLUGIN_SLOT = "jumpToPluginSlot";
29 public const CMD_UNINSTALL_PLUGIN = "uninstallPlugin";
30 public const CMD_CONFIRM_UNINSTALL_PLUGIN = "confirmUninstallPlugin";
31 public const TAB_SLOTS = 'slots';
35 protected $type;
39 protected $tabs;
43 protected $rbac_system;
47 protected $db;
48
56 public function __construct($a_data, int $a_id, bool $a_call_by_reference = true, bool $a_prepare_output = true)
57 {
58 global $DIC;
59 $this->tabs = $DIC->tabs();
60 $this->ctrl = $DIC->ctrl();
61 $this->rbac_system = $DIC->rbac()->system();
62 $this->db = $DIC->database();
63 $this->type = self::TYPE;
64 parent::__construct($a_data, $a_id, $a_call_by_reference, $a_prepare_output);
65 $this->lng->loadLanguageModule(self::TYPE);
66 }
67
72 public function executeCommand()
73 {
74 global $DIC;
75 $ilErr = $DIC['ilErr'];
76
77 $next_class = $this->ctrl->getNextClass($this);
78 $cmd = $this->ctrl->getCmd();
79
80 $this->prepareOutput();
81
82 if (!$this->rbac_system->checkAccess('read', $this->object->getRefId())) {
83 $ilErr->raiseError($this->lng->txt('no_permission'), $ilErr->WARNING);
84 }
85
86 switch ($next_class) {
87 case 'ilpermissiongui':
88 $this->tabs->activateTab('perm_settings');
89 include_once("Services/AccessControl/classes/class.ilPermissionGUI.php");
90 $perm_gui = new ilPermissionGUI($this);
91 $this->ctrl->forwardCommand($perm_gui);
92 break;
93
94 default:
95
96 // configure classes
97 $config = false;
98 if (strtolower(substr($next_class, strlen($next_class) - 9)) === "configgui") {
99 $path = $this->ctrl->lookupClassPath(strtolower($next_class));
100 if ($path != "") {
101 include_once($path);
102 $nc = new $next_class();
103
105 $_GET[self::P_CTYPE],
106 $_GET[self::P_CNAME],
107 $_GET[self::P_SLOT_ID],
108 $_GET[self::P_PLUGIN_NAME]
109 );
110
111 $nc->setPluginObject($pl);
112
113 $this->ctrl->forwardCommand($nc);
114 $config = true;
115 }
116 }
117
118 if (!$config) {
119 if (!$cmd || $cmd === 'view') {
120 $cmd = self::CMD_DEFAULT;
121 }
122
123 $this->$cmd();
124 }
125 break;
126 }
127 return true;
128 }
129
134 public function getAdminTabs() : void
135 {
136
137 if ($this->rbac_system->checkAccess("visible,read", $this->object->getRefId())) {
138 $this->tabs_gui->addTab(
139 self::TAB_PLUGINS,
140 $this->lng->txt("cmps_plugins"),
141 $this->ctrl->getLinkTarget($this, self::CMD_DEFAULT)
142 );
143
144 if (DEVMODE) {
145 $this->tabs_gui->addTab(
146 self::TAB_SLOTS,
147 $this->lng->txt("cmps_slots"),
148 $this->ctrl->getLinkTarget($this, self::CMD_LIST_SLOTS)
149 );
150 }
151 }
152
153 if ($this->rbac_system->checkAccess('edit_permission', $this->object->getRefId())) {
154 $this->tabs_gui->addTab(
155 "perm_settings",
156 $this->lng->txt("perm_settings"),
157 $this->ctrl->getLinkTargetByClass('ilpermissiongui', "perm")
158 );
159 }
160
161 if ($_GET[self::P_CTYPE] === "Services") {
162 $this->tabs_gui->activateTab("services");
163 }
164 }
165
166 protected function listSlots() : void
167 {
168 if (!DEVMODE) {
169 $this->ctrl->redirect($this, self::CMD_DEFAULT);
170 }
171
172 $this->tabs_gui->activateTab(self::TAB_SLOTS);
173 $comp_table = new ilComponentsTableGUI($this, self::CMD_LIST_SLOTS);
174 $this->tpl->setContent($comp_table->getHTML());
175 }
176
177 protected function listPlugins() : void
178 {
179 $this->tabs->activateTab(self::TAB_PLUGINS);
180
181 $filters = new ilPluginsOverviewTableFilterGUI($this);
182 $table = new ilPluginsOverviewTableGUI($this, $filters->getData(), self::CMD_DEFAULT);
183
184 $this->tpl->setContent($filters->getHTML() . $table->getHTML());
185 }
186
187 protected function showPluginSlotInfo() : void
188 {
189 if (!DEVMODE) {
190 $this->ctrl->redirect($this, self::CMD_DEFAULT);
191 }
192
193 $this->tabs->clearTargets();
194
195 $this->tabs->setBackTarget(
196 $this->lng->txt("cmps_slots"),
197 $this->ctrl->getLinkTarget($this, self::CMD_LIST_SLOTS)
198 );
199
200 $comp = ilComponent::getComponentObject($_GET[self::P_CTYPE], $_GET[self::P_CNAME]);
201
202 $form = new ilPropertyFormGUI();
203
204 // component
205 $ne = new ilNonEditableValueGUI($this->lng->txt("cmps_component"), "", true);
206 $ne->setValue($comp->getComponentType() . "/" . $comp->getName() . " [" . $comp->getId() . "]");
207 $form->addItem($ne);
208
209 // plugin slot
210 $ne = new ilNonEditableValueGUI($this->lng->txt("cmps_plugin_slot"), "", true);
211 $ne->setValue($comp->getPluginSlotName($_GET[self::P_SLOT_ID]) . " [" . $_GET[self::P_SLOT_ID] . "]");
212 $form->addItem($ne);
213
214 // main dir
215 $ne = new ilNonEditableValueGUI($this->lng->txt("cmps_main_dir"), "", true);
216 $ne->setValue($comp->getPluginSlotDirectory($_GET[self::P_SLOT_ID]) . "/&lt;Plugin_Name&gt;");
217 $form->addItem($ne);
218
219 // plugin file
220 $ne = new ilNonEditableValueGUI($this->lng->txt("cmps_plugin_file"), "", true);
221 $ne->setValue("&lt;" . $this->lng->txt("cmps_main_dir") . "&gt;" .
222 "/classes/class.il&lt;Plugin_Name&gt;Plugin.php");
223 $form->addItem($ne);
224
225 // language files
226 $ne = new ilNonEditableValueGUI($this->lng->txt("cmps_lang_files"), "", true);
227 $ne->setValue("&lt;" . $this->lng->txt("cmps_main_dir") . "&gt;" .
228 "/lang/ilias_&lt;Language ID&gt;.lang");
229 $form->addItem($ne);
230
231 // db update
232 $ne = new ilNonEditableValueGUI($this->lng->txt("cmps_db_update"), "", true);
233 $ne->setValue("&lt;" . $this->lng->txt("cmps_main_dir") . "&gt;" .
234 "/sql/dbupdate.php");
235 $form->addItem($ne);
236
237 // lang prefix
238 $ne = new ilNonEditableValueGUI($this->lng->txt("cmps_plugin_lang_prefixes"), "", true);
239 $ne->setValue($comp->getPluginSlotLanguagePrefix($_GET[self::P_SLOT_ID]) . "&lt;Plugin_ID&gt;_");
240 $form->addItem($ne);
241
242 // db prefix
243 $ne = new ilNonEditableValueGUI($this->lng->txt("cmps_plugin_db_prefixes"), "", true);
244 $ne->setValue($comp->getPluginSlotLanguagePrefix($_GET[self::P_SLOT_ID]) . "&lt;Plugin_ID&gt;_");
245 $form->addItem($ne);
246
247 $form->setTitle($this->lng->txt("cmps_plugin_slot"));
248
249 // set content and title
250 $this->tpl->setContent($form->getHTML());
251 $this->tpl->setTitle($comp->getComponentType() . "/" . $comp->getName() . ": " .
252 $this->lng->txt("cmps_plugin_slot") . " \"" . $comp->getPluginSlotName($_GET[self::P_SLOT_ID]) . "\"");
253 $this->tpl->setDescription("");
254 }
255
256 protected function showPlugin() : void
257 {
258
259 if (!$_GET[self::P_CTYPE] ||
260 !$_GET[self::P_CNAME] ||
261 !$_GET[self::P_SLOT_ID] ||
262 !$_GET[self::P_PLUGIN_ID]) {
263 $this->ctrl->redirect($this, self::CMD_DEFAULT);
264 }
265
266 $slot = new ilPluginSlot($_GET[self::P_CTYPE], $_GET[self::P_CNAME], $_GET[self::P_SLOT_ID]);
267
268 $plugin = null;
269 foreach ($slot->getPluginsInformation() as $item) {
270 if ($item["id"] === $_GET[self::P_PLUGIN_ID]) {
271 $plugin = $item;
272 break;
273 }
274 }
275 if (!$plugin) {
276 $this->ctrl->redirect($this, self::CMD_DEFAULT);
277 }
278
279 $this->tabs->clearTargets();
280 $this->tabs->setBackTarget(
281 $this->lng->txt("cmps_plugins"),
282 $this->ctrl->getLinkTarget($this, self::CMD_DEFAULT)
283 );
284
285 $this->ctrl->setParameter($this, self::P_CTYPE, $_GET[self::P_CTYPE]);
286 $this->ctrl->setParameter($this, self::P_CNAME, $_GET[self::P_CNAME]);
287 $this->ctrl->setParameter($this, self::P_SLOT_ID, $_GET[self::P_SLOT_ID]);
288 $this->ctrl->setParameter($this, self::P_PLUGIN_ID, $_GET[self::P_PLUGIN_ID]);
289 $this->ctrl->setParameter($this, self::P_PLUGIN_NAME, $plugin["name"]);
290
291 $langs = ilPlugin::getAvailableLangFiles($slot->getPluginsDirectory() . "/" .
292 $plugin["name"] . "/lang");
293
294 // dbupdate
296 $_GET[self::P_CTYPE],
297 $_GET[self::P_CNAME],
298 ilPluginSlot::lookupSlotName($_GET[self::P_CTYPE], $_GET[self::P_CNAME], $_GET[self::P_SLOT_ID]),
299 $plugin["name"]
300 );
301 $db_curr = $db_file = null;
302 if (@is_file($file)) {
303 include_once("./Services/Component/classes/class.ilPluginDBUpdate.php");
304 $dbupdate = new ilPluginDBUpdate(
305 $_GET[self::P_CTYPE],
306 $_GET[self::P_CNAME],
307 $_GET[self::P_SLOT_ID],
308 $plugin["name"],
309 $this->db,
310 true,
311 ""
312 );
313
314 $db_curr = $dbupdate->getCurrentVersion();
315 $db_file = $dbupdate->getFileVersion();
316 }
317
318 $plugin_db_data = ilPlugin::getPluginRecord($plugin["component_type"], $plugin["component_name"], $plugin[self::P_SLOT_ID], $plugin["name"]);
319
320 // toolbar actions
321 if ($plugin["must_install"]) {
322 $this->toolbar->addButton(
323 $this->lng->txt("cmps_install"),
324 $this->ctrl->getLinkTarget($this, self::CMD_INSTALL_PLUGIN)
325 );
326 } else {
327 // configure button
328 if (ilPlugin::hasConfigureClass($slot->getPluginsDirectory(), $plugin, $plugin_db_data) &&
329 $this->ctrl->checkTargetClass(ilPlugin::getConfigureClassName($plugin))) {
330 $this->toolbar->addButton(
331 $this->lng->txt("cmps_configure"),
332 $this->ctrl->getLinkTargetByClass(strtolower(ilPlugin::getConfigureClassName($plugin)), self::CMD_CONFIGURE)
333 );
334 }
335 // refresh languages button
336 if (count($langs) > 0) {
337 $this->toolbar->addButton(
338 $this->lng->txt("cmps_refresh"),
339 $this->ctrl->getLinkTarget($this, self::CMD_REFRESH_LANGUAGES)
340 );
341 }
342
343 if ($plugin["activation_possible"]) {
344 $this->toolbar->addButton(
345 $this->lng->txt("cmps_activate"),
346 $this->ctrl->getLinkTarget($this, self::CMD_ACTIVATE_PLUGIN)
347 );
348 }
349
350 // deactivation/refresh languages button
351 if ($plugin["is_active"]) {
352 // deactivate button
353 $this->toolbar->addButton(
354 $this->lng->txt("cmps_deactivate"),
355 $this->ctrl->getLinkTarget($this, self::CMD_DEACTIVATE_PLUGIN)
356 );
357 }
358
359 // update button
360 if ($plugin["needs_update"]) {
361 $this->toolbar->addButton(
362 $this->lng->txt("cmps_update"),
363 $this->ctrl->getLinkTarget($this, self::CMD_UPDATE_PLUGIN)
364 );
365 }
366 }
367
368 // info
369 $resp = array();
370 if ($plugin["responsible"] != '') {
371 $responsibles = explode('/', $plugin["responsible_mail"]);
372 foreach ($responsibles as $responsible) {
373 if (!strlen($responsible = trim($responsible))) {
374 continue;
375 }
376
377 $resp[] = $responsible;
378 }
379
380 $resp = $plugin["responsible"] . " (" . implode(" / ", $resp) . ")";
381 }
382
383 if ($plugin["is_active"]) {
384 $status = $this->lng->txt("cmps_active");
385 } else {
386 $r = ($plugin["inactive_reason"] != "")
387 ? " (" . $plugin["inactive_reason"] . ")"
388 : "";
389
390 $status = $this->lng->txt("cmps_inactive") . $r;
391 }
392
393 $info[""][$this->lng->txt("cmps_name")] = $plugin["name"];
394 $info[""][$this->lng->txt("cmps_id")] = $plugin["id"];
395 $info[""][$this->lng->txt("cmps_version")] = $plugin["version"];
396 if ($resp) {
397 $info[""][$this->lng->txt("cmps_responsible")] = $resp;
398 }
399 $info[""][$this->lng->txt("cmps_ilias_min_version")] = $plugin["ilias_min_version"];
400 $info[""][$this->lng->txt("cmps_ilias_max_version")] = $plugin["ilias_max_version"];
401 $info[""][$this->lng->txt("cmps_status")] = $status;
402
403 if (sizeof($langs)) {
404 $lang_files = array();
405 foreach ($langs as $lang) {
406 $lang_files[] = $lang["file"];
407 }
408 $info[""][$this->lng->txt("cmps_languages")] = implode(", ", $lang_files);
409 } else {
410 $info[""][$this->lng->txt("cmps_languages")] = $this->lng->txt("cmps_no_language_file_available");
411 }
412
413 $info[$this->lng->txt("cmps_basic_files")]["plugin.php"] = $plugin["plugin_php_file_status"] ?
414 $this->lng->txt("cmps_available") :
415 $this->lng->txt("cmps_missing");
416 $info[$this->lng->txt("cmps_basic_files")][$this->lng->txt("cmps_class_file")] = ($plugin["class_file_status"] ?
417 $this->lng->txt("cmps_available") :
418 $this->lng->txt("cmps_missing")) .
419 " (" . $plugin["class_file"] . ")";
420
421 if (!$db_file) {
422 $info[$this->lng->txt("cmps_database")][$this->lng->txt("file")] = $this->lng->txt("cmps_no_db_update_file_available");
423 } else {
424 $info[$this->lng->txt("cmps_database")][$this->lng->txt("file")] = "dbupdate.php";
425 $info[$this->lng->txt("cmps_database")][$this->lng->txt("cmps_current_version")] = $db_curr;
426 $info[$this->lng->txt("cmps_database")][$this->lng->txt("cmps_file_version")] = $db_file;
427 }
428
429 $form = new ilPropertyFormGUI();
430 $form->setTitle($this->lng->txt("cmps_plugin"));
431
432 foreach ($info as $section => $items) {
433 if (trim($section)) {
434 $sec = new ilFormSectionHeaderGUI();
435 $sec->setTitle($section);
436 $form->addItem($sec);
437 }
438 foreach ($items as $key => $value) {
439 $non = new ilNonEditableValueGUI($key);
440 $non->setValue($value);
441 $form->addItem($non);
442 }
443 }
444
445 $this->tpl->setContent($form->getHTML());
446 }
447
448 protected function installPlugin() : void
449 {
451 $_GET[self::P_CTYPE],
452 $_GET[self::P_CNAME],
453 $_GET[self::P_SLOT_ID],
454 $_GET[self::P_PLUGIN_NAME]
455 );
456
457 $pl->install();
458 $this->update($pl);
459 }
460
461 protected function activatePlugin() : void
462 {
464 $_GET[self::P_CTYPE],
465 $_GET[self::P_CNAME],
466 $_GET[self::P_SLOT_ID],
467 $_GET[self::P_PLUGIN_NAME]
468 );
469
470 try {
471 $result = $pl->activate();
472 if ($result !== true) {
474 } else {
475 ilUtil::sendSuccess($this->lng->txt("cmps_plugin_activated"), true);
476 }
477 } catch (ilPluginException $e) {
478 ilUtil::sendFailure($e->getMessage(), true);
479 }
480
481 $this->ctrl->setParameter($this, self::P_CTYPE, $_GET[self::P_CTYPE]);
482 $this->ctrl->setParameter($this, self::P_CNAME, $_GET[self::P_CNAME]);
483 $this->ctrl->setParameter($this, self::P_SLOT_ID, $_GET[self::P_SLOT_ID]);
484
485 if ($_GET[self::P_PLUGIN_ID]) {
486 $this->ctrl->setParameter($this, self::P_PLUGIN_ID, $_GET[self::P_PLUGIN_ID]);
487 $this->ctrl->redirect($this, self::CMD_SHOW_PLUGIN);
488 } else {
489 $this->ctrl->redirect($this, self::CMD_DEFAULT);
490 }
491 }
492
493 protected function updatePlugin() : void
494 {
496 $_GET[self::P_CTYPE],
497 $_GET[self::P_CNAME],
498 $_GET[self::P_SLOT_ID],
499 $_GET[self::P_PLUGIN_NAME]
500 );
501
502 $this->update($pl);
503 }
504
505 protected function update(ilPlugin $plugin) : void
506 {
507 $result = $plugin->update();
508
509 if ($result !== true) {
510 ilUtil::sendFailure($plugin->getMessage(), true);
511 } else {
512 ilUtil::sendSuccess($plugin->getMessage(), true);
513 }
514
515 // reinitialize control class
517 $this->ctrl->initBaseClass(ilAdministrationGUI::class);
518 $this->ctrl->setParameterByClass(ilAdministrationGUI::class, self::P_CTYPE, $_GET[self::P_CTYPE]);
519 $this->ctrl->setParameterByClass(ilAdministrationGUI::class, self::P_CNAME, $_GET[self::P_CNAME]);
520 $this->ctrl->setParameterByClass(ilAdministrationGUI::class, self::P_SLOT_ID, $_GET[self::P_SLOT_ID]);
521 $this->ctrl->setParameterByClass(ilAdministrationGUI::class, self::P_PLUGIN_ID, $_GET[self::P_PLUGIN_ID]);
522 ilUtil::redirect("ilias.php?admin_mode=settings&baseClass=ilAdministrationGUI" .
523 "&cmd=jumpToPluginSlot&ref_id=" . $_GET["ref_id"] . "&ctype=" . $_GET[self::P_CTYPE] .
524 "&cname=" . $_GET[self::P_CNAME] . "&slot_id=" . $_GET[self::P_SLOT_ID] . "&plugin_id=" . $_GET[self::P_PLUGIN_ID]);
525 }
526
527 protected function deactivatePlugin() : void
528 {
530 $_GET[self::P_CTYPE],
531 $_GET[self::P_CNAME],
532 $_GET[self::P_SLOT_ID],
533 $_GET[self::P_PLUGIN_NAME]
534 );
535
536 $result = $pl->deactivate();
537
538 if ($result !== true) {
540 } else {
541 ilUtil::sendSuccess($this->lng->txt("cmps_plugin_deactivated"), true);
542 }
543
544 $this->ctrl->setParameter($this, self::P_CTYPE, $_GET[self::P_CTYPE]);
545 $this->ctrl->setParameter($this, self::P_CNAME, $_GET[self::P_CNAME]);
546 $this->ctrl->setParameter($this, self::P_SLOT_ID, $_GET[self::P_SLOT_ID]);
547
548 if ($_GET[self::P_PLUGIN_ID]) {
549 $this->ctrl->setParameter($this, self::P_PLUGIN_ID, $_GET[self::P_PLUGIN_ID]);
550 $this->ctrl->redirect($this, self::CMD_SHOW_PLUGIN);
551 } else {
552 $this->ctrl->redirect($this, self::CMD_DEFAULT);
553 }
554 }
555
556 protected function refreshLanguages() : void
557 {
559 $_GET[self::P_CTYPE],
560 $_GET[self::P_CNAME],
561 $_GET[self::P_SLOT_ID],
562 $_GET[self::P_PLUGIN_NAME]
563 );
564
565 $pl->updateLanguages();
566
567 $this->ctrl->setParameter($this, self::P_CTYPE, $_GET[self::P_CTYPE]);
568 $this->ctrl->setParameter($this, self::P_CNAME, $_GET[self::P_CNAME]);
569 $this->ctrl->setParameter($this, self::P_SLOT_ID, $_GET[self::P_SLOT_ID]);
570
571 if ($_GET[self::P_PLUGIN_ID]) {
572 $this->ctrl->setParameter($this, self::P_PLUGIN_ID, $_GET[self::P_PLUGIN_ID]);
573 $this->ctrl->redirect($this, self::CMD_SHOW_PLUGIN);
574 } else {
575 $this->ctrl->redirect($this, self::CMD_DEFAULT);
576 }
577 }
578
579 protected function confirmUninstallPlugin() : void
580 {
581 global $DIC;
582 $ilPluginAdmin = $DIC['ilPluginAdmin'];
583
585 $_GET[self::P_CTYPE],
586 $_GET[self::P_CNAME],
587 $_GET[self::P_SLOT_ID],
588 $_GET[self::P_PLUGIN_NAME]
589 );
590
591 $pl_meta = $ilPluginAdmin->getAllData(
592 $_GET[self::P_CTYPE],
593 $_GET[self::P_CNAME],
594 $_GET[self::P_SLOT_ID],
595 $_GET[self::P_PLUGIN_NAME]
596 );
597
598 $activation = ((bool) $pl_meta["activation_possible"] || (bool) $pl_meta["is_active"]); // #18827
599 $reason = $pl_meta["inactive_reason"];
600
601 $question = $activation
602 ? sprintf($this->lng->txt("cmps_uninstall_confirm"), $pl->getPluginName())
603 : sprintf($this->lng->txt("cmps_uninstall_inactive_confirm"), $pl->getPluginName(), $reason);
604
605 $this->ctrl->setParameter($this, self::P_CTYPE, $_GET[self::P_CTYPE]);
606 $this->ctrl->setParameter($this, self::P_CNAME, $_GET[self::P_CNAME]);
607 $this->ctrl->setParameter($this, self::P_SLOT_ID, $_GET[self::P_SLOT_ID]);
608 $this->ctrl->setParameter($this, self::P_PLUGIN_NAME, $_GET[self::P_PLUGIN_NAME]);
609
610 $confirmation_gui = new ilConfirmationGUI();
611 $confirmation_gui->setFormAction($this->ctrl->getFormAction($this));
612 $confirmation_gui->setHeaderText($question);
613 $confirmation_gui->setCancel($this->lng->txt("cancel"), self::CMD_DEFAULT);
614 $confirmation_gui->setConfirm($this->lng->txt("cmps_uninstall"), self::CMD_UNINSTALL_PLUGIN);
615
616 $this->tpl->setContent($confirmation_gui->getHTML());
617 }
618
619 protected function uninstallPlugin() : void
620 {
622 $_GET[self::P_CTYPE],
623 $_GET[self::P_CNAME],
624 $_GET[self::P_SLOT_ID],
625 $_GET[self::P_PLUGIN_NAME]
626 );
627
628 try {
629 $result = $pl->uninstall();
630 if ($result !== true) {
632 } else {
633 ilUtil::sendSuccess($this->lng->txt("cmps_plugin_uninstalled"), true);
634 }
635 } catch (ilPluginException $e) {
636 ilUtil::sendFailure($e->getMessage(), true);
637 }
638
639 ilGlobalCache::flushAll();
640 $ilPluginsOverviewTableGUI = new ilPluginsOverviewTableGUI($this, []);
641
642 $this->ctrl->setParameter($this, self::P_CTYPE, $_GET[self::P_CTYPE]);
643 $this->ctrl->setParameter($this, self::P_CNAME, $_GET[self::P_CNAME]);
644 $this->ctrl->setParameter($this, self::P_SLOT_ID, $_GET[self::P_SLOT_ID]);
645 $this->ctrl->redirect($this, self::CMD_DEFAULT);
646 }
647}
$result
$section
Definition: Utf8Test.php:83
$_GET["client_id"]
An exception for terminatinating execution or to throw for unit testing.
static getComponentObject($a_ctype, $a_cname)
Get component object.
TableGUI class for components listing.
Confirmation screen class.
This class represents a section header in a property form.
This class represents a non editable value in a property form.
Components (Modules, Services, Plugins) Settings.
executeCommand()
Execute command @access public.
__construct($a_data, int $a_id, bool $a_call_by_reference=true, bool $a_prepare_output=true)
ilObjComponentSettingsGUI constructor.
Class ilObjectGUI Basic methods of all Output classes.
prepareOutput($a_show_subobjects=true)
prepare output
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
static getPluginObject($a_ctype, $a_cname, $a_slot_id, $a_pname)
Get Plugin Object.
Database Update class.
static lookupSlotName($a_ctype, $a_cname, $a_slot_id)
Lookup slot name for component and slot id.
Abstract Class ilPlugin.
static getPluginRecord(string $a_ctype, string $a_cname, string $a_slot_id, string $a_pname)
static getAvailableLangFiles(string $a_lang_directory)
Get array of all language files in the plugin.
static hasConfigureClass(string $a_slot_dir, array $plugin_data, array $plugin_db_data)
Has the plugin a configure class?
static getDBUpdateScriptName(string $a_ctype, string $a_cname, string $a_slot_name, string $a_pname)
static getPluginObject(string $a_ctype, string $a_cname, string $a_slot_id, string $a_pname)
static getConfigureClassName(array $plugin_data)
Get plugin configure class name.
Class ilPluginsOverviewTableFilterGUI.
TableGUI class for components listing.
This class represents a property form user interface.
static redirect($a_script)
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
global $DIC
Definition: goto.php:24
if(!array_key_exists('PATH_INFO', $_SERVER)) $config
Definition: metadata.php:68
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
$lang
Definition: xapiexit.php:8