20 declare(strict_types=1);
30 private const TYPE =
'cmps';
71 $this->
tabs = $DIC->tabs();
72 $this->
ctrl = $DIC->ctrl();
73 $this->rbac_system = $DIC->rbac()->system();
74 $this->db = $DIC->database();
75 $this->type = self::TYPE;
76 $this->component_repository = $DIC[
"component.repository"];
77 $this->component_factory = $DIC[
"component.factory"];
78 $this->error = $DIC[
"ilErr"];
80 $this->request_wrapper = $DIC->http()->wrapper()->query();
81 $this->
ui = $DIC->ui()->factory();
82 $this->renderer = $DIC->ui()->renderer();
84 $this->
lng->loadLanguageModule(self::TYPE);
90 self::CMD_UPDATE_PLUGIN,
91 self::CMD_ACTIVATE_PLUGIN,
92 self::CMD_DEACTIVATE_PLUGIN,
93 self::CMD_REFRESH_LANGUAGES,
104 $next_class = $this->
ctrl->getNextClass($this);
105 $cmd = $this->
ctrl->getCmd();
109 if (!$this->rbac_system->checkAccess(
'read', $this->object->getRefId())) {
110 $this->error->raiseError($this->
lng->txt(
'no_permission'), $this->error->WARNING);
114 case $next_class ===
'ilpermissiongui':
115 $this->
tabs->activateTab(self::TAB_PERMISSION);
117 $this->
ctrl->forwardCommand($perm_gui);
119 case preg_match(
"/configgui$/i", $next_class):
124 case self::CMD_INSTALL_PLUGIN:
127 case self::CMD_REFRESH_LANGUAGES:
130 case self::CMD_ACTIVATE_PLUGIN:
133 case self::CMD_DEACTIVATE_PLUGIN:
136 case self::CMD_UPDATE_PLUGIN:
139 case self::CMD_CONFIRM_UNINSTALL_PLUGIN:
142 case self::CMD_UNINSTALL_PLUGIN:
153 $name = $this->
ctrl->lookupOriginalClassName($name);
155 if (!class_exists($name)) {
156 throw new Exception(
"class $name not found!");
161 $gui->setPluginObject(
$plugin);
163 $this->
ctrl->forwardCommand($gui);
178 $this->tpl->setOnScreenMessage(
"success", $this->
lng->txt(
"cmps_plugin_updated"),
true);
180 $this->tpl->setOnScreenMessage(
"failure", $e->getMessage(),
true);
183 $this->
ctrl->redirectByClass(ilAdministrationGUI::class, self::CMD_JUMP_TO_PLUGIN_SLOT);
189 $plugin_name = $this->request_wrapper->retrieve(self::P_PLUGIN_NAME, $this->
refinery->kindlyTo()->string());
190 $plugin = $this->component_repository->getPluginByName($plugin_name);
192 $language_handler->updateLanguages();
193 $this->tpl->setOnScreenMessage(
"success", $this->
lng->txt(
"cmps_refresh_lng"),
true);
195 $this->tpl->setOnScreenMessage(
"failure", $e->getMessage(),
true);
197 $this->
ctrl->redirect($this, self::CMD_DEFAULT);
206 $this->tpl->setOnScreenMessage(
"success", $this->
lng->txt(
"cmps_plugin_activated"),
true);
208 $this->tpl->setOnScreenMessage(
"failure", $e->getMessage(),
true);
211 $this->
ctrl->redirect($this, self::CMD_DEFAULT);
220 $this->tpl->setOnScreenMessage(
"success", $this->
lng->txt(
"cmps_plugin_deactivated"),
true);
222 $this->tpl->setOnScreenMessage(
"failure", $e->getMessage(),
true);
225 $this->
ctrl->redirect($this, self::CMD_DEFAULT);
238 $plugin_name = $this->request_wrapper->retrieve(self::P_PLUGIN_NAME, $this->
refinery->kindlyTo()->string());
240 $pl_info = $this->component_repository->getPluginByName($plugin_name);
242 if ($pl_info->isActivated() || $pl_info->isActivationPossible()) {
244 $this->
lng->txt(
"cmps_uninstall_confirm"),
249 $this->
lng->txt(
"cmps_uninstall_inactive_confirm"),
250 $pl->getPluginName(),
251 $pl_info->getReasonForInactivity()
255 $this->
ctrl->setParameter($this, self::P_PLUGIN_NAME, $pl_info->getName());
257 $this->
ui->button()->standard(
258 $this->
lng->txt(
'confirm'),
259 $this->
ctrl->getLinkTarget($this, self::CMD_UNINSTALL_PLUGIN)
261 $this->
ui->button()->standard(
262 $this->
lng->txt(
'cancel'),
263 $this->
ctrl->getLinkTarget($this,
'showQuestionList')
267 $this->tpl->setContent($this->renderer->render($this->ui->messageBox()->confirmation($question)->withButtons($buttons)));
276 $this->tpl->setOnScreenMessage(
"success", $this->
lng->txt(
"cmps_plugin_deinstalled"),
true);
278 $this->tpl->setOnScreenMessage(
"failure", $e->getMessage(),
true);
281 $this->
ctrl->redirect($this, self::CMD_DEFAULT);
286 $plugin_name = $this->request_wrapper->retrieve(self::P_PLUGIN_NAME, $this->
refinery->kindlyTo()->string());
287 return $this->component_factory->getPlugin(
288 $this->component_repository->getPluginByName($plugin_name)->getId()
294 $this->
tabs->activateTab(self::TAB_PLUGINS);
299 foreach ($this->component_repository->getPlugins() as
$plugin) {
312 $table = $table->
withData($plugins)->getTable();
314 $this->tpl->setContent($filters->getHTML() . $table);
319 if ($this->rbac_system->checkAccess(
"visible,read", $this->object->getRefId())) {
320 $this->tabs_gui->addTab(
322 $this->
lng->txt(
"cmps_plugins"),
323 $this->
ctrl->getLinkTarget($this, self::CMD_DEFAULT)
327 if ($this->rbac_system->checkAccess(
'edit_permission', $this->object->getRefId())) {
328 $this->tabs_gui->addTab(
330 $this->
lng->txt(
"perm_settings"),
331 $this->
ctrl->getLinkTargetByClass(
'ilpermissiongui',
"perm")
336 $this->request_wrapper->has(self::P_CTYPE) &&
337 $this->request_wrapper->retrieve(self::P_CTYPE, $this->
refinery->kindlyTo()->string()) ===
"components/ILIAS" 339 $this->tabs_gui->activateTab(
"services");
Readable part of repository interface to ilComponentDataDB.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
prepareOutput(bool $show_sub_objects=true)
Class ilPluginsOverviewTableFilterGUI.
forwardConfigGUI(string $name)
ILIAS HTTP Wrapper RequestWrapper $request_wrapper
ilComponentFactory $component_factory
getUnsafeGetCommands()
This method must return a list of unsafe GET commands.
const CMD_DEACTIVATE_PLUGIN
const CMD_CONFIRM_UNINSTALL_PLUGIN
const CMD_UNINSTALL_PLUGIN
__construct($data, int $id, bool $call_by_reference=true, bool $prepare_output=true)
This is how the factory for UI elements looks.
const CMD_ACTIVATE_PLUGIN
ilRbacSystem $rbac_system
Class ilObjectGUI Basic methods of all Output classes.
ILIAS Refinery Factory $refinery
ilComponentRepository $component_repository
ilObjComponentSettingsGUI: ilPermissionGUI
getSafePostCommands()
This method must return a list of safe POST commands.
__construct(Container $dic, ilPlugin $plugin)
const CMD_JUMP_TO_PLUGIN_SLOT
Interface ilCtrlSecurityInterface provides ilCtrl security information.
const CMD_REFRESH_LANGUAGES