3 include_once(
"./Services/Object/classes/class.ilObjectGUI.php");
24 public function __construct($a_data, $a_id, $a_call_by_reference =
true, $a_prepare_output =
true)
27 parent::__construct($a_data, $a_id, $a_call_by_reference, $a_prepare_output);
29 $this->lng->loadLanguageModule(
'cmps');
41 $rbacsystem = $DIC->rbac()->system();
45 $next_class = $this->ctrl->getNextClass($this);
46 $cmd = $this->ctrl->getCmd();
50 if (!$rbacsystem->checkAccess(
'read', $this->object->getRefId())) {
51 $ilErr->raiseError($this->lng->txt(
'no_permission'),
$ilErr->WARNING);
54 switch ($next_class) {
55 case 'ilpermissiongui':
56 $this->tabs_gui->setTabActive(
'perm_settings');
57 include_once(
"Services/AccessControl/classes/class.ilPermissionGUI.php");
59 $ret = $this->ctrl->forwardCommand($perm_gui);
66 if (substr(strtolower($next_class), strlen($next_class) - 9) ==
"configgui") {
67 $path =
$ilCtrl->lookupClassPath(strtolower($next_class));
70 $nc =
new $next_class();
79 $nc->setPluginObject($pl);
81 $ret = $this->ctrl->forwardCommand($nc);
87 if (!$cmd || $cmd ==
'view') {
107 $rbacsystem = $DIC->rbac()->system();
108 $lng = $DIC->language();
110 if ($rbacsystem->checkAccess(
"visible,read", $this->object->getRefId())) {
111 $this->tabs_gui->addTab(
113 $lng->txt(
"cmps_plugins"),
114 $this->ctrl->getLinkTarget($this,
"listPlugins")
118 $this->tabs_gui->addTab(
120 $lng->txt(
"cmps_slots"),
121 $this->ctrl->getLinkTarget($this,
"listSlots")
126 if ($rbacsystem->checkAccess(
'edit_permission', $this->object->getRefId())) {
127 $this->tabs_gui->addTab(
129 $lng->txt(
"perm_settings"),
130 $this->ctrl->getLinkTargetByClass(
'ilpermissiongui',
"perm")
134 if (
$_GET[
"ctype"] ==
"Services") {
135 $this->tabs_gui->activateTab(
"services");
145 $this->ctrl->redirect($this,
"listPlugins");
148 $this->tabs_gui->activateTab(
'slots');
150 include_once(
"./Services/Component/classes/class.ilComponentsTableGUI.php");
153 $this->tpl->setContent($comp_table->getHTML());
165 $tpl = $DIC->ui()->mainTemplate();
166 $ilTabs = $DIC->tabs();
168 $ilTabs->activateTab(
"plugins");
169 include_once(
"./Services/Component/classes/class.ilPluginsOverviewTableGUI.php");
180 $tpl = $DIC->ui()->mainTemplate();
181 $lng = $DIC->language();
182 $ilTabs = $DIC->tabs();
186 $ilCtrl->redirect($this,
"listPlugins");
189 $ilTabs->clearTargets();
191 $ilTabs->setBackTarget(
192 $lng->txt(
"cmps_slots"),
193 $ilCtrl->getLinkTarget($this,
"listSlots")
196 include_once(
"./Services/Component/classes/class.ilComponent.php");
199 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
204 $ne->
setValue($comp->getComponentType() .
"/" . $comp->getName() .
" [" . $comp->getId() .
"]");
209 $ne->
setValue($comp->getPluginSlotName(
$_GET[
"slot_id"]) .
" [" .
$_GET[
"slot_id"] .
"]");
214 $ne->
setValue($comp->getPluginSlotDirectory(
$_GET[
"slot_id"]) .
"/<Plugin_Name>");
219 $ne->
setValue(
"<" .
$lng->txt(
"cmps_main_dir") .
">" .
220 "/classes/class.il<Plugin_Name>Plugin.php");
225 $ne->
setValue(
"<" .
$lng->txt(
"cmps_main_dir") .
">" .
226 "/lang/ilias_<Language ID>.lang");
231 $ne->
setValue(
"<" .
$lng->txt(
"cmps_main_dir") .
">" .
232 "/sql/dbupdate.php");
237 $ne->
setValue($comp->getPluginSlotLanguagePrefix(
$_GET[
"slot_id"]) .
"<Plugin_ID>_");
242 $ne->
setValue($comp->getPluginSlotLanguagePrefix(
$_GET[
"slot_id"]) .
"<Plugin_ID>_");
245 $form->setTitle(
$lng->txt(
"cmps_plugin_slot"));
249 $tpl->setTitle($comp->getComponentType() .
"/" . $comp->getName() .
": " .
250 $lng->txt(
"cmps_plugin_slot") .
" \"" . $comp->getPluginSlotName(
$_GET[
"slot_id"]) .
"\"");
251 $tpl->setDescription(
"");
258 $ilTabs = $DIC->tabs();
259 $lng = $DIC->language();
260 $tpl = $DIC->ui()->mainTemplate();
261 $ilDB = $DIC->database();
262 $ilToolbar = $DIC->toolbar();
264 if (!
$_GET[
"ctype"] ||
267 !
$_GET[
"plugin_id"]) {
268 $ilCtrl->redirect($this,
"listPlugins");
271 include_once(
"./Services/Component/classes/class.ilPluginSlot.php");
275 foreach ($slot->getPluginsInformation() as $item) {
276 if ($item[
"id"] ==
$_GET[
"plugin_id"]) {
282 $ilCtrl->redirect($this,
"listPlugins");
285 $ilTabs->clearTargets();
286 $ilTabs->setBackTarget(
287 $lng->txt(
"cmps_plugins"),
288 $ilCtrl->getLinkTarget($this,
"listPlugins")
293 $ilCtrl->setParameter($this,
"slot_id",
$_GET[
"slot_id"]);
294 $ilCtrl->setParameter($this,
"plugin_id",
$_GET[
"plugin_id"]);
295 $ilCtrl->setParameter($this,
"pname", $plugin[
"name"]);
298 $plugin[
"name"] .
"/lang");
307 $db_curr = $db_file = null;
308 if (@is_file($file)) {
309 include_once(
"./Services/Component/classes/class.ilPluginDBUpdate.php");
320 $db_curr = $dbupdate->getCurrentVersion();
321 $db_file = $dbupdate->getFileVersion();
324 $plugin_db_data =
ilPlugin::getPluginRecord($plugin[
"component_type"], $plugin[
"component_name"], $plugin[
"slot_id"], $plugin[
"name"]);
327 if ($plugin[
"must_install"]) {
328 $ilToolbar->addButton(
329 $lng->txt(
"cmps_install"),
330 $ilCtrl->getLinkTarget($this,
"installPlugin")
336 $ilToolbar->addButton(
337 $lng->txt(
"cmps_configure"),
342 if (count($langs) > 0) {
343 $ilToolbar->addButton(
344 $lng->txt(
"cmps_refresh"),
345 $ilCtrl->getLinkTarget($this,
"refreshLanguages")
349 if ($plugin[
"activation_possible"]) {
350 $ilToolbar->addButton(
351 $lng->txt(
"cmps_activate"),
352 $ilCtrl->getLinkTarget($this,
"activatePlugin")
357 if ($plugin[
"is_active"]) {
359 $ilToolbar->addButton(
360 $lng->txt(
"cmps_deactivate"),
361 $ilCtrl->getLinkTarget($this,
"deactivatePlugin")
366 if ($plugin[
"needs_update"]) {
367 $ilToolbar->addButton(
368 $lng->txt(
"cmps_update"),
369 $ilCtrl->getLinkTarget($this,
"updatePlugin")
376 if (strlen($plugin[
"responsible"])) {
377 $responsibles = explode(
'/', $plugin[
"responsible_mail"]);
378 foreach ($responsibles as $responsible) {
379 if (!strlen($responsible = trim($responsible))) {
383 $resp[] = $responsible;
386 $resp = $plugin[
"responsible"] .
" (" . implode(
" / ", $resp) .
")";
389 if ($plugin[
"is_active"]) {
390 $status =
$lng->txt(
"cmps_active");
392 $r = ($plugin[
"inactive_reason"] !=
"")
393 ?
" (" . $plugin[
"inactive_reason"] .
")" 396 $status =
$lng->txt(
"cmps_inactive") .
$r;
399 $info[
""][
$lng->txt(
"cmps_name")] = $plugin[
"name"];
400 $info[
""][
$lng->txt(
"cmps_id")] = $plugin[
"id"];
401 $info[
""][
$lng->txt(
"cmps_version")] = $plugin[
"version"];
403 $info[
""][
$lng->txt(
"cmps_responsible")] = $resp;
405 $info[
""][
$lng->txt(
"cmps_ilias_min_version")] = $plugin[
"ilias_min_version"];
406 $info[
""][
$lng->txt(
"cmps_ilias_max_version")] = $plugin[
"ilias_max_version"];
407 $info[
""][
$lng->txt(
"cmps_status")] = $status;
409 if (
sizeof($langs)) {
410 $lang_files = array();
411 foreach ($langs as
$lang) {
412 $lang_files[] = $lang[
"file"];
414 $info[
""][
$lng->txt(
"cmps_languages")] = implode(
", ", $lang_files);
416 $info[
""][
$lng->txt(
"cmps_languages")] =
$lng->txt(
"cmps_no_language_file_available");
419 $info[
$lng->txt(
"cmps_basic_files")][
"plugin.php"] = $plugin[
"plugin_php_file_status"] ?
420 $lng->txt(
"cmps_available") :
421 $lng->txt(
"cmps_missing");
422 $info[
$lng->txt(
"cmps_basic_files")][
$lng->txt(
"cmps_class_file")] = ($plugin[
"class_file_status"] ?
423 $lng->txt(
"cmps_available") :
424 $lng->txt(
"cmps_missing")) .
425 " (" . $plugin[
"class_file"] .
")";
428 $info[
$lng->txt(
"cmps_database")][
$lng->txt(
"file")] =
$lng->txt(
"cmps_no_db_update_file_available");
430 $info[
$lng->txt(
"cmps_database")][
$lng->txt(
"file")] =
"dbupdate.php";
431 $info[
$lng->txt(
"cmps_database")][
$lng->txt(
"cmps_current_version")] = $db_curr;
432 $info[
$lng->txt(
"cmps_database")][
$lng->txt(
"cmps_file_version")] = $db_file;
435 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
437 $form->setTitle(
$lng->txt(
"cmps_plugin"));
443 $form->addItem($sec);
445 foreach ($items as
$key => $value) {
447 $non->setValue($value);
448 $form->addItem($non);
462 include_once(
"./Services/Component/classes/class.ilPlugin.php");
481 $lng = $DIC->language();
483 include_once(
"./Services/Component/classes/class.ilPlugin.php");
496 ilUtil::sendSuccess(
$lng->txt(
"cmps_plugin_activated"),
true);
504 $ilCtrl->setParameter($this,
"slot_id",
$_GET[
"slot_id"]);
506 if (
$_GET[
"plugin_id"]) {
507 $ilCtrl->setParameter($this,
"plugin_id",
$_GET[
"plugin_id"]);
508 $ilCtrl->redirect($this,
"showPlugin");
510 $ilCtrl->redirect($this,
"listPlugins");
519 include_once(
"./Services/Component/classes/class.ilPlugin.php");
544 ilUtil::sendSuccess($plugin->message,
true);
550 $ilCtrl->initBaseClass(
"iladministrationgui");
551 $_GET[
"cmd"] =
"jumpToPluginSlot";
552 $ilCtrl->setParameterByClass(
"iladministrationgui",
"ctype",
$_GET[
"ctype"]);
553 $ilCtrl->setParameterByClass(
"iladministrationgui",
"cname",
$_GET[
"cname"]);
554 $ilCtrl->setParameterByClass(
"iladministrationgui",
"slot_id",
$_GET[
"slot_id"]);
555 $ilCtrl->setParameterByClass(
"iladministrationgui",
"plugin_id",
$_GET[
"plugin_id"]);
556 ilUtil::redirect(
"ilias.php?admin_mode=settings&baseClass=ilAdministrationGUI" .
557 "&cmd=jumpToPluginSlot&ref_id=" .
$_GET[
"ref_id"] .
"&ctype=" .
$_GET[
"ctype"] .
558 "&cname=" .
$_GET[
"cname"] .
"&slot_id=" .
$_GET[
"slot_id"] .
"&plugin_id=" .
$_GET[
"plugin_id"]);
568 $lng = $DIC->language();
570 include_once(
"./Services/Component/classes/class.ilPlugin.php");
583 ilUtil::sendSuccess(
$lng->txt(
"cmps_plugin_deactivated"),
true);
588 $ilCtrl->setParameter($this,
"slot_id",
$_GET[
"slot_id"]);
590 if (
$_GET[
"plugin_id"]) {
591 $ilCtrl->setParameter($this,
"plugin_id",
$_GET[
"plugin_id"]);
592 $ilCtrl->redirect($this,
"showPlugin");
594 $ilCtrl->redirect($this,
"listPlugins");
606 include_once(
"./Services/Component/classes/class.ilPlugin.php");
614 $result = $pl->updateLanguages();
622 $ilCtrl->setParameter($this,
"slot_id",
$_GET[
"slot_id"]);
624 if (
$_GET[
"plugin_id"]) {
625 $ilCtrl->setParameter($this,
"plugin_id",
$_GET[
"plugin_id"]);
626 $ilCtrl->redirect($this,
"showPlugin");
628 $ilCtrl->redirect($this,
"listPlugins");
636 $tpl = $DIC->ui()->mainTemplate();
637 $ilPluginAdmin = $DIC[
'ilPluginAdmin'];
639 include_once(
"./Services/Component/classes/class.ilPlugin.php");
647 $pl_meta = $ilPluginAdmin->getAllData(
654 $activation = ((bool) $pl_meta[
"activation_possible"] || (
bool) $pl_meta[
"is_active"]);
655 $reason = $pl_meta[
"inactive_reason"];
657 $question = $activation
658 ? sprintf($this->lng->txt(
"cmps_uninstall_confirm"), $pl->getPluginName())
659 : sprintf($this->lng->txt(
"cmps_uninstall_inactive_confirm"), $pl->getPluginName(), $reason);
663 $ilCtrl->setParameter($this,
"slot_id",
$_GET[
"slot_id"]);
666 include_once(
"./Services/Utilities/classes/class.ilConfirmationGUI.php");
668 $confirmation_gui->setFormAction(
$ilCtrl->getFormAction($this));
669 $confirmation_gui->setHeaderText($question);
670 $confirmation_gui->setCancel($this->lng->txt(
"cancel"),
"listPlugins");
671 $confirmation_gui->setConfirm($this->lng->txt(
"cmps_uninstall"),
"uninstallPlugin");
673 $tpl->setContent($confirmation_gui->getHTML());
681 include_once(
"./Services/Component/classes/class.ilPlugin.php");
694 ilUtil::sendSuccess($this->lng->txt(
"cmps_plugin_uninstalled"),
true);
700 ilGlobalCache::flushAll();
705 $ilCtrl->setParameter($this,
"slot_id",
$_GET[
"slot_id"]);
706 $ilCtrl->redirect($this,
"listPlugins");
static getComponentObject($a_ctype, $a_cname)
Get component object.
__construct($a_data, $a_id, $a_call_by_reference=true, $a_prepare_output=true)
Contructor.
static getPluginObject(string $a_ctype, string $a_cname, string $a_slot_id, string $a_pname)
setValue($a_value)
Set Value.
static getDBUpdateScriptName(string $a_ctype, string $a_cname, string $a_slot_name, string $a_pname)
static getAvailableLangFiles(string $a_lang_directory)
Get array of all language files in the plugin.
static lookupSlotName($a_ctype, $a_cname, $a_slot_id)
Lookup slot name for component and slot id.
activatePlugin()
Activate a plugin.
executeCommand()
Execute command.
static getPluginRecord(string $a_ctype, string $a_cname, string $a_slot_id, string $a_pname)
showPluginSlotInfo()
Show information about a plugin slot.
deactivatePlugin()
Deactivate a plugin.
prepareOutput($a_show_subobjects=true)
prepare output
if(isset($_POST['submit'])) $form
update(ilPlugin $plugin)
Execute update and ctrl reload.
Class ilObjectGUI Basic methods of all Output classes.
static hasConfigureClass(string $a_slot_dir, array $plugin_data, array $plugin_db_data)
Has the plugin a configure class?
static getPluginObject($a_ctype, $a_cname, $a_slot_id, $a_pname)
Get Plugin Object.
static getConfigureClassName(array $plugin_data)
Get plugin configure class name.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
TableGUI class for components listing.
refreshLanguages()
Refresh Languages.
This class represents a non editable value in a property form.
TableGUI class for components listing.
Components (Modules, Services, Plugins) Settings.
for($i=1; $i<=count($kw_cases_sel); $i+=1) $lang
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
if(empty($password)) $table
static redirect($a_script)
listSlots()
List Services.
listPlugins()
List plugins.
updatePlugin()
Update a plugin.
Confirmation screen class.
installPlugin()
Install a plugin.