ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilObjComponentSettingsGUI Class Reference

Components (Modules, Services, Plugins) Settings. More...

+ Inheritance diagram for ilObjComponentSettingsGUI:
+ Collaboration diagram for ilObjComponentSettingsGUI:

Public Member Functions

 __construct ($a_data, $a_id, $a_call_by_reference=true, $a_prepare_output=true)
 Contructor. More...
 
 executeCommand ()
 Execute command. More...
 
 getAdminTabs ()
 Get tabs. More...
 
 listSlots ()
 List Services. More...
 
- Public Member Functions inherited from ilObjectGUI
 executeCommand ()
 execute command More...
 
 withReferences ()
 determines wether objects are referenced or not (got ref ids or not) More...
 
 setCreationMode ($a_mode=true)
 if true, a creation screen is displayed the current $_GET[ref_id] don't belong to the current class! the mode is determined in ilrepositorygui More...
 
 getCreationMode ()
 get creation mode More...
 
 prepareOutput ($a_show_subobjects=true)
 prepare output More...
 
 getAdminTabs ()
 administration tabs show only permissions and trash folder More...
 
 getHTML ()
 
 confirmedDeleteObject ()
 confirmed deletion of object -> objects are moved to trash or deleted immediately, if trash is disabled More...
 
 cancelDeleteObject ()
 cancel deletion of object More...
 
 cancelObject ()
 cancel action and go back to previous page @access public More...
 
 createObject ()
 create new object form More...
 
 cancelCreation ()
 cancel create action and go back to repository parent More...
 
 saveObject ()
 save object More...
 
 getDidacticTemplateVar ($a_type)
 Get didactic template setting from creation screen. More...
 
 putObjectInTree (ilObject $a_obj, $a_parent_node_id=null)
 Add object to tree at given position. More...
 
 editObject ()
 edit object More...
 
 addExternalEditFormCustom (ilPropertyFormGUI $a_form)
 
 updateObject ()
 updates object entry in object_data More...
 
 getFormAction ($a_cmd, $a_formaction="")
 get form action for command (command is method name without "Object", e.g. More...
 
 isVisible ($a_ref_id, $a_type)
 
 viewObject ()
 list childs of current object More...
 
 deleteObject ($a_error=false)
 Display deletion confirmation screen. More...
 
 cloneAllObject ()
 Clone single (not container object) Method is overwritten in ilContainerGUI. More...
 
 redirectAfterCreation ()
 Redirect after creation, see https://docu.ilias.de/goto_docu_wiki_wpage_5035_1357.html. More...
 

Protected Member Functions

 listPlugins ()
 List plugins. More...
 
 showPluginSlotInfo ()
 Show information about a plugin slot. More...
 
 showPlugin ()
 
 installPlugin ()
 Install a plugin. More...
 
 activatePlugin ()
 Activate a plugin. More...
 
 updatePlugin ()
 Update a plugin. More...
 
 update (ilPlugin $plugin)
 Execute update and ctrl reload. More...
 
 deactivatePlugin ()
 Deactivate a plugin. More...
 
 refreshLanguages ()
 Refresh Languages. More...
 
 confirmUninstallPlugin ()
 
 uninstallPlugin ()
 
- Protected Member Functions inherited from ilObjectGUI
 getObjectService ()
 Get object service. More...
 
 assignObject ()
 
 setTitleAndDescription ()
 called by prepare output More...
 
 initHeaderAction ($a_sub_type=null, $a_sub_id=null)
 Add header action menu. More...
 
 insertHeaderAction ($a_list_gui)
 Insert header action into main template. More...
 
 addHeaderAction ()
 Add header action menu. More...
 
 redrawHeaderActionObject ()
 Ajax call: redraw action header only. More...
 
 showMountWebfolderIcon ()
 
 setTabs ()
 set admin tabs @access public More...
 
 setAdminTabs ()
 set admin tabs @access public More...
 
 setLocator ()
 set Locator More...
 
 addLocatorItems ()
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 omitLocator ($a_omit=true)
 
 addAdminLocatorItems ($a_do_not_add_object=false)
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 initCreationForms ($a_new_type)
 Init creation froms. More...
 
 getCreationFormsHTML (array $a_forms)
 Get HTML for creation forms (accordion) More...
 
 initCreateForm ($a_new_type)
 Init object creation form. More...
 
 initDidacticTemplate (ilPropertyFormGUI $form)
 Show didactic template types. More...
 
 addDidacticTemplateOptions (array &$a_options)
 Add custom templates. More...
 
 afterSave (ilObject $a_new_object)
 Post (successful) object creation hook. More...
 
 initEditForm ()
 Init object edit form. More...
 
 initEditCustomForm (ilPropertyFormGUI $a_form)
 Add custom fields to update form. More...
 
 getEditFormValues ()
 Get values for edit form. More...
 
 getEditFormCustomValues (array &$a_values)
 Add values to custom edit fields. More...
 
 validateCustom (ilPropertyFormGUI $a_form)
 Validate custom values (if not possible with checkInput()) More...
 
 updateCustom (ilPropertyFormGUI $a_form)
 Insert custom update form values into object. More...
 
 afterUpdate ()
 Post (successful) object update hook. More...
 
 initImportForm ($a_new_type)
 Init object import form. More...
 
 importFileObject ($parent_id=null, $a_catch_errors=true)
 Import. More...
 
 afterImport (ilObject $a_new_object)
 Post (successful) object import hook. More...
 
 setFormAction ($a_cmd, $a_formaction)
 set specific form action for command More...
 
 getReturnLocation ($a_cmd, $a_location="")
 get return location for command (command is method name without "Object", e.g. More...
 
 setReturnLocation ($a_cmd, $a_location)
 set specific return location for command More...
 
 getTargetFrame ($a_cmd, $a_target_frame="")
 get target frame for command (command is method name without "Object", e.g. More...
 
 setTargetFrame ($a_cmd, $a_target_frame)
 set specific target frame for command More...
 
 showPossibleSubObjects ()
 show possible subobjects (pulldown menu) More...
 
 getTemplateFile ($a_cmd, $a_type="")
 get a template blockfile format: tpl. More...
 
 getTabs ()
 get tabs abstract method. More...
 
 __showButton ($a_cmd, $a_text, $a_target='')
 
 hitsperpageObject ()
 
__initTableGUI ()
 
 __setTableGUIBasicData (&$tbl, &$result_set, $a_from="")
 standard implementation for tables use 'from' variable use different initial setting of table More...
 
 redirectToRefId ($a_ref_id, $a_cmd="")
 redirects to (repository) view per ref id usually to a container and usually used at the end of a save/import method where the object gui type (of the new object) doesn't match with the type of the current $_GET["ref_id"] value More...
 
 fillCloneTemplate ($a_tpl_varname, $a_type)
 Fill object clone template This method can be called from any object GUI class that wants to offer object cloning. More...
 
 getCenterColumnHTML ()
 Get center column. More...
 
 getRightColumnHTML ()
 Display right column. More...
 
 setColumnSettings (ilColumnGUI $column_gui)
 May be overwritten in subclasses. More...
 
 checkPermission ($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
 Check permission and redirect on error. More...
 
 checkPermissionBool ($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
 Check permission. More...
 
 enableDragDropFileUpload ()
 Enables the file upload into this object by dropping files. More...
 
 handleAutoRating (ilObject $a_new_obj)
 Activate rating automatically if parent container setting. More...
 

Static Private Attributes

static $ERROR_MESSAGE
 

Additional Inherited Members

- Static Public Member Functions inherited from ilObjectGUI
static _gotoRepositoryRoot ($a_raise_error=false)
 Goto repository root. More...
 
static _gotoRepositoryNode ($a_ref_id, $a_cmd="frameset")
 Goto repository root. More...
 
- Data Fields inherited from ilObjectGUI
const COPY_WIZARD_NEEDS_PAGE = 1
 
 $objDefinition
 
 $tpl
 
 $tree
 
 $lng
 
 $data
 
 $object
 
 $ref_id
 
 $obj_id
 
 $maxcount
 
 $formaction
 
 $return_location
 
 $target_frame
 
 $tab_target_script
 
 $actions
 
 $sub_objects
 
 $omit_locator = false
 
const CFORM_NEW = 1
 
const CFORM_IMPORT = 2
 
const CFORM_CLONE = 3
 
- Protected Attributes inherited from ilObjectGUI
 $ilErr
 
 $locator
 
 $user
 
 $access
 
 $settings
 
 $rbacreview
 
 $toolbar
 
 $tmp_import_dir
 
 $tabs_gui = null
 
 $ctrl
 
 $object_service
 

Detailed Description

Components (Modules, Services, Plugins) Settings.

Author
Alex Killing alex..nosp@m.kill.nosp@m.ing@g.nosp@m.mx.d.nosp@m.e
Version
$Id$

@ilCtrl_Calls ilObjComponentSettingsGUI: ilPermissionGUI

Definition at line 16 of file class.ilObjComponentSettingsGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilObjComponentSettingsGUI::__construct (   $a_data,
  $a_id,
  $a_call_by_reference = true,
  $a_prepare_output = true 
)

Contructor.

@access public

Definition at line 24 of file class.ilObjComponentSettingsGUI.php.

25 {
26 $this->type = 'cmps';
27 parent::__construct($a_data, $a_id, $a_call_by_reference, $a_prepare_output);
28
29 $this->lng->loadLanguageModule('cmps');
30 }

Member Function Documentation

◆ activatePlugin()

ilObjComponentSettingsGUI::activatePlugin ( )
protected

Activate a plugin.

Definition at line 477 of file class.ilObjComponentSettingsGUI.php.

478 {
479 global $DIC;
480 $ilCtrl = $DIC->ctrl();
481 $lng = $DIC->language();
482
483 include_once("./Services/Component/classes/class.ilPlugin.php");
485 $_GET["ctype"],
486 $_GET["cname"],
487 $_GET["slot_id"],
488 $_GET["pname"]
489 );
490
491 try {
492 $result = $pl->activate();
493 if ($result !== true) {
495 } else {
496 ilUtil::sendSuccess($lng->txt("cmps_plugin_activated"), true);
497 }
498 } catch (ilPluginException $e) {
499 ilUtil::sendFailure($e->getMessage(), true);
500 }
501
502 $ilCtrl->setParameter($this, "ctype", $_GET["ctype"]);
503 $ilCtrl->setParameter($this, "cname", $_GET["cname"]);
504 $ilCtrl->setParameter($this, "slot_id", $_GET["slot_id"]);
505
506 if ($_GET["plugin_id"]) {
507 $ilCtrl->setParameter($this, "plugin_id", $_GET["plugin_id"]);
508 $ilCtrl->redirect($this, "showPlugin");
509 } else {
510 $ilCtrl->redirect($this, "listPlugins");
511 }
512 }
$result
$_GET["client_id"]
static getPluginObject(string $a_ctype, string $a_cname, string $a_slot_id, string $a_pname)
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
global $ilCtrl
Definition: ilias.php:18
global $DIC
Definition: saml.php:7

References $_GET, $DIC, $ilCtrl, ilObjectGUI\$lng, $result, ilPlugin\getPluginObject(), and ilUtil\sendFailure().

+ Here is the call graph for this function:

◆ confirmUninstallPlugin()

ilObjComponentSettingsGUI::confirmUninstallPlugin ( )
protected

Definition at line 632 of file class.ilObjComponentSettingsGUI.php.

633 {
634 global $DIC;
635 $ilCtrl = $DIC->ctrl();
636 $tpl = $DIC->ui()->mainTemplate();
637 $ilPluginAdmin = $DIC['ilPluginAdmin'];
638
639 include_once("./Services/Component/classes/class.ilPlugin.php");
641 $_GET["ctype"],
642 $_GET["cname"],
643 $_GET["slot_id"],
644 $_GET["pname"]
645 );
646
647 $pl_meta = $ilPluginAdmin->getAllData(
648 $_GET["ctype"],
649 $_GET["cname"],
650 $_GET["slot_id"],
651 $_GET["pname"]
652 );
653
654 $activation = ((bool) $pl_meta["activation_possible"] || (bool) $pl_meta["is_active"]); // #18827
655 $reason = $pl_meta["inactive_reason"];
656
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);
660
661 $ilCtrl->setParameter($this, "ctype", $_GET["ctype"]);
662 $ilCtrl->setParameter($this, "cname", $_GET["cname"]);
663 $ilCtrl->setParameter($this, "slot_id", $_GET["slot_id"]);
664 $ilCtrl->setParameter($this, "pname", $_GET["pname"]);
665
666 include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
667 $confirmation_gui = new ilConfirmationGUI();
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");
672
673 $tpl->setContent($confirmation_gui->getHTML());
674 }
Confirmation screen class.

References $_GET, $DIC, $ilCtrl, ilObjectGUI\$tpl, and ilPlugin\getPluginObject().

+ Here is the call graph for this function:

◆ deactivatePlugin()

ilObjComponentSettingsGUI::deactivatePlugin ( )
protected

Deactivate a plugin.

Definition at line 564 of file class.ilObjComponentSettingsGUI.php.

565 {
566 global $DIC;
567 $ilCtrl = $DIC->ctrl();
568 $lng = $DIC->language();
569
570 include_once("./Services/Component/classes/class.ilPlugin.php");
572 $_GET["ctype"],
573 $_GET["cname"],
574 $_GET["slot_id"],
575 $_GET["pname"]
576 );
577
578 $result = $pl->deactivate();
579
580 if ($result !== true) {
582 } else {
583 ilUtil::sendSuccess($lng->txt("cmps_plugin_deactivated"), true);
584 }
585
586 $ilCtrl->setParameter($this, "ctype", $_GET["ctype"]);
587 $ilCtrl->setParameter($this, "cname", $_GET["cname"]);
588 $ilCtrl->setParameter($this, "slot_id", $_GET["slot_id"]);
589
590 if ($_GET["plugin_id"]) {
591 $ilCtrl->setParameter($this, "plugin_id", $_GET["plugin_id"]);
592 $ilCtrl->redirect($this, "showPlugin");
593 } else {
594 $ilCtrl->redirect($this, "listPlugins");
595 }
596 }

References $_GET, $DIC, $ilCtrl, ilObjectGUI\$lng, $result, ilPlugin\getPluginObject(), and ilUtil\sendFailure().

+ Here is the call graph for this function:

◆ executeCommand()

ilObjComponentSettingsGUI::executeCommand ( )

Execute command.

@access public

Reimplemented from ilObjectGUI.

Definition at line 38 of file class.ilObjComponentSettingsGUI.php.

39 {
40 global $DIC;
41 $rbacsystem = $DIC->rbac()->system();
42 $ilErr = $DIC['ilErr'];
43 $ilCtrl = $DIC->ctrl();
44
45 $next_class = $this->ctrl->getNextClass($this);
46 $cmd = $this->ctrl->getCmd();
47
48 $this->prepareOutput();
49
50 if (!$rbacsystem->checkAccess('read', $this->object->getRefId())) {
51 $ilErr->raiseError($this->lng->txt('no_permission'), $ilErr->WARNING);
52 }
53
54 switch ($next_class) {
55 case 'ilpermissiongui':
56 $this->tabs_gui->setTabActive('perm_settings');
57 include_once("Services/AccessControl/classes/class.ilPermissionGUI.php");
58 $perm_gui = new ilPermissionGUI($this);
59 $ret = $this->ctrl->forwardCommand($perm_gui);
60 break;
61
62 default:
63
64 // configure classes
65 $config = false;
66 if (substr(strtolower($next_class), strlen($next_class) - 9) == "configgui") {
67 $path = $ilCtrl->lookupClassPath(strtolower($next_class));
68 if ($path != "") {
69 include_once($path);
70 $nc = new $next_class();
71
73 $_GET["ctype"],
74 $_GET["cname"],
75 $_GET["slot_id"],
76 $_GET["pname"]
77 );
78
79 $nc->setPluginObject($pl);
80
81 $ret = $this->ctrl->forwardCommand($nc);
82 $config = true;
83 }
84 }
85
86 if (!$config) {
87 if (!$cmd || $cmd == 'view') {
88 $cmd = "listPlugins";
89 }
90
91 $this->$cmd();
92 }
93 break;
94 }
95 return true;
96 }
$path
Definition: aliased.php:25
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.
$config
Definition: bootstrap.php:15
$ret
Definition: parser.php:6

References $_GET, $config, $DIC, $ilCtrl, ilObjectGUI\$ilErr, $path, $ret, ilPluginAdmin\getPluginObject(), and ilObjectGUI\prepareOutput().

+ Here is the call graph for this function:

◆ getAdminTabs()

ilObjComponentSettingsGUI::getAdminTabs ( )

Get tabs.

@access public

Reimplemented from ilObjectGUI.

Definition at line 104 of file class.ilObjComponentSettingsGUI.php.

105 {
106 global $DIC;
107 $rbacsystem = $DIC->rbac()->system();
108 $lng = $DIC->language();
109
110 if ($rbacsystem->checkAccess("visible,read", $this->object->getRefId())) {
111 $this->tabs_gui->addTab(
112 "plugins",
113 $lng->txt("cmps_plugins"),
114 $this->ctrl->getLinkTarget($this, "listPlugins")
115 );
116
117 if (DEVMODE) {
118 $this->tabs_gui->addTab(
119 "slots",
120 $lng->txt("cmps_slots"),
121 $this->ctrl->getLinkTarget($this, "listSlots")
122 );
123 }
124 }
125
126 if ($rbacsystem->checkAccess('edit_permission', $this->object->getRefId())) {
127 $this->tabs_gui->addTab(
128 "perm_settings",
129 $lng->txt("perm_settings"),
130 $this->ctrl->getLinkTargetByClass('ilpermissiongui', "perm")
131 );
132 }
133
134 if ($_GET["ctype"] == "Services") {
135 $this->tabs_gui->activateTab("services");
136 }
137 }

References $_GET, $DIC, and ilObjectGUI\$lng.

◆ installPlugin()

ilObjComponentSettingsGUI::installPlugin ( )
protected

Install a plugin.

Returns
void

Definition at line 460 of file class.ilObjComponentSettingsGUI.php.

461 {
462 include_once("./Services/Component/classes/class.ilPlugin.php");
464 $_GET["ctype"],
465 $_GET["cname"],
466 $_GET["slot_id"],
467 $_GET["pname"]
468 );
469
470 $pl->install();
471 $this->update($pl);
472 }
update(ilPlugin $plugin)
Execute update and ctrl reload.

References $_GET, ilPlugin\getPluginObject(), and update().

+ Here is the call graph for this function:

◆ listPlugins()

ilObjComponentSettingsGUI::listPlugins ( )
protected

List plugins.

Parameters

return

Definition at line 162 of file class.ilObjComponentSettingsGUI.php.

163 {
164 global $DIC;
165 $tpl = $DIC->ui()->mainTemplate();
166 $ilTabs = $DIC->tabs();
167
168 $ilTabs->activateTab("plugins");
169 include_once("./Services/Component/classes/class.ilPluginsOverviewTableGUI.php");
170 $table = new ilPluginsOverviewTableGUI($this, "listPlugins");
171 $tpl->setContent($table->getHTML());
172 }
TableGUI class for components listing.
if(empty($password)) $table
Definition: pwgen.php:24

References $DIC, $table, and ilObjectGUI\$tpl.

◆ listSlots()

ilObjComponentSettingsGUI::listSlots ( )

List Services.

Definition at line 142 of file class.ilObjComponentSettingsGUI.php.

143 {
144 if (!DEVMODE) {
145 $this->ctrl->redirect($this, "listPlugins");
146 }
147
148 $this->tabs_gui->activateTab('slots');
149
150 include_once("./Services/Component/classes/class.ilComponentsTableGUI.php");
151 $comp_table = new ilComponentsTableGUI($this, "listSlots");
152
153 $this->tpl->setContent($comp_table->getHTML());
154 }
TableGUI class for components listing.

◆ refreshLanguages()

ilObjComponentSettingsGUI::refreshLanguages ( )
protected

Refresh Languages.

Definition at line 601 of file class.ilObjComponentSettingsGUI.php.

602 {
603 global $DIC;
604 $ilCtrl = $DIC->ctrl();
605
606 include_once("./Services/Component/classes/class.ilPlugin.php");
608 $_GET["ctype"],
609 $_GET["cname"],
610 $_GET["slot_id"],
611 $_GET["pname"]
612 );
613
614 $result = $pl->updateLanguages();
615
616 if ($result !== true) {
618 }
619
620 $ilCtrl->setParameter($this, "ctype", $_GET["ctype"]);
621 $ilCtrl->setParameter($this, "cname", $_GET["cname"]);
622 $ilCtrl->setParameter($this, "slot_id", $_GET["slot_id"]);
623
624 if ($_GET["plugin_id"]) {
625 $ilCtrl->setParameter($this, "plugin_id", $_GET["plugin_id"]);
626 $ilCtrl->redirect($this, "showPlugin");
627 } else {
628 $ilCtrl->redirect($this, "listPlugins");
629 }
630 }

References $_GET, $DIC, $ilCtrl, $result, ilPlugin\getPluginObject(), and ilUtil\sendFailure().

+ Here is the call graph for this function:

◆ showPlugin()

ilObjComponentSettingsGUI::showPlugin ( )
protected

Definition at line 254 of file class.ilObjComponentSettingsGUI.php.

255 {
256 global $DIC;
257 $ilCtrl = $DIC->ctrl();
258 $ilTabs = $DIC->tabs();
259 $lng = $DIC->language();
260 $tpl = $DIC->ui()->mainTemplate();
261 $ilDB = $DIC->database();
262 $ilToolbar = $DIC->toolbar();
263
264 if (!$_GET["ctype"] ||
265 !$_GET["cname"] ||
266 !$_GET["slot_id"] ||
267 !$_GET["plugin_id"]) {
268 $ilCtrl->redirect($this, "listPlugins");
269 }
270
271 include_once("./Services/Component/classes/class.ilPluginSlot.php");
272 $slot = new ilPluginSlot($_GET["ctype"], $_GET["cname"], $_GET["slot_id"]);
273
274 $plugin = null;
275 foreach ($slot->getPluginsInformation() as $item) {
276 if ($item["id"] == $_GET["plugin_id"]) {
277 $plugin = $item;
278 break;
279 }
280 }
281 if (!$plugin) {
282 $ilCtrl->redirect($this, "listPlugins");
283 }
284
285 $ilTabs->clearTargets();
286 $ilTabs->setBackTarget(
287 $lng->txt("cmps_plugins"),
288 $ilCtrl->getLinkTarget($this, "listPlugins")
289 );
290
291 $ilCtrl->setParameter($this, "ctype", $_GET["ctype"]);
292 $ilCtrl->setParameter($this, "cname", $_GET["cname"]);
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"]);
296
297 $langs = ilPlugin::getAvailableLangFiles($slot->getPluginsDirectory() . "/" .
298 $plugin["name"] . "/lang");
299
300 // dbupdate
302 $_GET["ctype"],
303 $_GET["cname"],
304 ilPluginSlot::lookupSlotName($_GET["ctype"], $_GET["cname"], $_GET["slot_id"]),
305 $plugin["name"]
306 );
307 $db_curr = $db_file = null;
308 if (@is_file($file)) {
309 include_once("./Services/Component/classes/class.ilPluginDBUpdate.php");
310 $dbupdate = new ilPluginDBUpdate(
311 $_GET["ctype"],
312 $_GET["cname"],
313 $_GET["slot_id"],
314 $plugin["name"],
315 $ilDB,
316 true,
317 ""
318 );
319
320 $db_curr = $dbupdate->getCurrentVersion();
321 $db_file = $dbupdate->getFileVersion();
322 }
323
324 $plugin_db_data = ilPlugin::getPluginRecord($plugin["component_type"], $plugin["component_name"], $plugin["slot_id"], $plugin["name"]);
325
326 // toolbar actions
327 if ($plugin["must_install"]) {
328 $ilToolbar->addButton(
329 $lng->txt("cmps_install"),
330 $ilCtrl->getLinkTarget($this, "installPlugin")
331 );
332 } else {
333 // configure button
334 if (ilPlugin::hasConfigureClass($slot->getPluginsDirectory(), $plugin, $plugin_db_data) &&
335 $ilCtrl->checkTargetClass(ilPlugin::getConfigureClassName($plugin))) {
336 $ilToolbar->addButton(
337 $lng->txt("cmps_configure"),
338 $ilCtrl->getLinkTargetByClass(strtolower(ilPlugin::getConfigureClassName($plugin)), "configure")
339 );
340 }
341 // refresh languages button
342 if (count($langs) > 0) {
343 $ilToolbar->addButton(
344 $lng->txt("cmps_refresh"),
345 $ilCtrl->getLinkTarget($this, "refreshLanguages")
346 );
347 }
348
349 if ($plugin["activation_possible"]) {
350 $ilToolbar->addButton(
351 $lng->txt("cmps_activate"),
352 $ilCtrl->getLinkTarget($this, "activatePlugin")
353 );
354 }
355
356 // deactivation/refresh languages button
357 if ($plugin["is_active"]) {
358 // deactivate button
359 $ilToolbar->addButton(
360 $lng->txt("cmps_deactivate"),
361 $ilCtrl->getLinkTarget($this, "deactivatePlugin")
362 );
363 }
364
365 // update button
366 if ($plugin["needs_update"]) {
367 $ilToolbar->addButton(
368 $lng->txt("cmps_update"),
369 $ilCtrl->getLinkTarget($this, "updatePlugin")
370 );
371 }
372 }
373
374 // info
375 $resp = array();
376 if (strlen($plugin["responsible"])) {
377 $responsibles = explode('/', $plugin["responsible_mail"]);
378 foreach ($responsibles as $responsible) {
379 if (!strlen($responsible = trim($responsible))) {
380 continue;
381 }
382
383 $resp[] = $responsible;
384 }
385
386 $resp = $plugin["responsible"] . " (" . implode(" / ", $resp) . ")";
387 }
388
389 if ($plugin["is_active"]) {
390 $status = $lng->txt("cmps_active");
391 } else {
392 $r = ($plugin["inactive_reason"] != "")
393 ? " (" . $plugin["inactive_reason"] . ")"
394 : "";
395
396 $status = $lng->txt("cmps_inactive") . $r;
397 }
398
399 $info[""][$lng->txt("cmps_name")] = $plugin["name"];
400 $info[""][$lng->txt("cmps_id")] = $plugin["id"];
401 $info[""][$lng->txt("cmps_version")] = $plugin["version"];
402 if ($resp) {
403 $info[""][$lng->txt("cmps_responsible")] = $resp;
404 }
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;
408
409 if (sizeof($langs)) {
410 $lang_files = array();
411 foreach ($langs as $lang) {
412 $lang_files[] = $lang["file"];
413 }
414 $info[""][$lng->txt("cmps_languages")] = implode(", ", $lang_files);
415 } else {
416 $info[""][$lng->txt("cmps_languages")] = $lng->txt("cmps_no_language_file_available");
417 }
418
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"] . ")";
426
427 if (!$db_file) {
428 $info[$lng->txt("cmps_database")][$lng->txt("file")] = $lng->txt("cmps_no_db_update_file_available");
429 } else {
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;
433 }
434
435 include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
436 $form = new ilPropertyFormGUI();
437 $form->setTitle($lng->txt("cmps_plugin"));
438
439 foreach ($info as $section => $items) {
440 if (trim($section)) {
441 $sec = new ilFormSectionHeaderGUI();
442 $sec->setTitle($section);
443 $form->addItem($sec);
444 }
445 foreach ($items as $key => $value) {
446 $non = new ilNonEditableValueGUI($key);
447 $non->setValue($value);
448 $form->addItem($non);
449 }
450 }
451
452 $tpl->setContent($form->getHTML());
453 }
$section
Definition: Utf8Test.php:83
This class represents a section header in a property form.
This class represents a non editable value in a property form.
Database Update class.
static lookupSlotName($a_ctype, $a_cname, $a_slot_id)
Lookup slot name for component and slot id.
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 getConfigureClassName(array $plugin_data)
Get plugin configure class name.
This class represents a property form user interface.
$key
Definition: croninfo.php:18
$r
Definition: example_031.php:79
for($i=1; $i<=count($kw_cases_sel); $i+=1) $lang
Definition: langwiz.php:349
$info
Definition: index.php:5
if(isset($_POST['submit'])) $form
global $ilDB

References $_GET, $DIC, $form, $ilCtrl, $ilDB, $info, $key, $lang, ilObjectGUI\$lng, $r, $section, ilObjectGUI\$tpl, ilPlugin\getAvailableLangFiles(), ilPlugin\getConfigureClassName(), ilPlugin\getDBUpdateScriptName(), ilPlugin\getPluginRecord(), ilPlugin\hasConfigureClass(), and ilPluginSlot\lookupSlotName().

+ Here is the call graph for this function:

◆ showPluginSlotInfo()

ilObjComponentSettingsGUI::showPluginSlotInfo ( )
protected

Show information about a plugin slot.

Definition at line 177 of file class.ilObjComponentSettingsGUI.php.

178 {
179 global $DIC;
180 $tpl = $DIC->ui()->mainTemplate();
181 $lng = $DIC->language();
182 $ilTabs = $DIC->tabs();
183 $ilCtrl = $DIC->ctrl();
184
185 if (!DEVMODE) {
186 $ilCtrl->redirect($this, "listPlugins");
187 }
188
189 $ilTabs->clearTargets();
190
191 $ilTabs->setBackTarget(
192 $lng->txt("cmps_slots"),
193 $ilCtrl->getLinkTarget($this, "listSlots")
194 );
195
196 include_once("./Services/Component/classes/class.ilComponent.php");
197 $comp = ilComponent::getComponentObject($_GET["ctype"], $_GET["cname"]);
198
199 include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
200 $form = new ilPropertyFormGUI();
201
202 // component
203 $ne = new ilNonEditableValueGUI($lng->txt("cmps_component"), "", true);
204 $ne->setValue($comp->getComponentType() . "/" . $comp->getName() . " [" . $comp->getId() . "]");
205 $form->addItem($ne);
206
207 // plugin slot
208 $ne = new ilNonEditableValueGUI($lng->txt("cmps_plugin_slot"), "", true);
209 $ne->setValue($comp->getPluginSlotName($_GET["slot_id"]) . " [" . $_GET["slot_id"] . "]");
210 $form->addItem($ne);
211
212 // main dir
213 $ne = new ilNonEditableValueGUI($lng->txt("cmps_main_dir"), "", true);
214 $ne->setValue($comp->getPluginSlotDirectory($_GET["slot_id"]) . "/&lt;Plugin_Name&gt;");
215 $form->addItem($ne);
216
217 // plugin file
218 $ne = new ilNonEditableValueGUI($lng->txt("cmps_plugin_file"), "", true);
219 $ne->setValue("&lt;" . $lng->txt("cmps_main_dir") . "&gt;" .
220 "/classes/class.il&lt;Plugin_Name&gt;Plugin.php");
221 $form->addItem($ne);
222
223 // language files
224 $ne = new ilNonEditableValueGUI($lng->txt("cmps_lang_files"), "", true);
225 $ne->setValue("&lt;" . $lng->txt("cmps_main_dir") . "&gt;" .
226 "/lang/ilias_&lt;Language ID&gt;.lang");
227 $form->addItem($ne);
228
229 // db update
230 $ne = new ilNonEditableValueGUI($lng->txt("cmps_db_update"), "", true);
231 $ne->setValue("&lt;" . $lng->txt("cmps_main_dir") . "&gt;" .
232 "/sql/dbupdate.php");
233 $form->addItem($ne);
234
235 // lang prefix
236 $ne = new ilNonEditableValueGUI($lng->txt("cmps_plugin_lang_prefixes"), "", true);
237 $ne->setValue($comp->getPluginSlotLanguagePrefix($_GET["slot_id"]) . "&lt;Plugin_ID&gt;_");
238 $form->addItem($ne);
239
240 // db prefix
241 $ne = new ilNonEditableValueGUI($lng->txt("cmps_plugin_db_prefixes"), "", true);
242 $ne->setValue($comp->getPluginSlotLanguagePrefix($_GET["slot_id"]) . "&lt;Plugin_ID&gt;_");
243 $form->addItem($ne);
244
245 $form->setTitle($lng->txt("cmps_plugin_slot"));
246
247 // set content and title
248 $tpl->setContent($form->getHTML());
249 $tpl->setTitle($comp->getComponentType() . "/" . $comp->getName() . ": " .
250 $lng->txt("cmps_plugin_slot") . " \"" . $comp->getPluginSlotName($_GET["slot_id"]) . "\"");
251 $tpl->setDescription("");
252 }
static getComponentObject($a_ctype, $a_cname)
Get component object.

References $_GET, $DIC, $form, $ilCtrl, ilObjectGUI\$lng, ilObjectGUI\$tpl, and ilComponent\getComponentObject().

+ Here is the call graph for this function:

◆ uninstallPlugin()

ilObjComponentSettingsGUI::uninstallPlugin ( )
protected

Definition at line 676 of file class.ilObjComponentSettingsGUI.php.

677 {
678 global $DIC;
679 $ilCtrl = $DIC->ctrl();
680
681 include_once("./Services/Component/classes/class.ilPlugin.php");
683 $_GET["ctype"],
684 $_GET["cname"],
685 $_GET["slot_id"],
686 $_GET["pname"]
687 );
688
689 try {
690 $result = $pl->uninstall();
691 if ($result !== true) {
693 } else {
694 ilUtil::sendSuccess($this->lng->txt("cmps_plugin_uninstalled"), true);
695 }
696 } catch (ilPluginException $e) {
697 ilUtil::sendFailure($e->getMessage(), true);
698 }
699
700 ilGlobalCache::flushAll();
701 $ilPluginsOverviewTableGUI = new ilPluginsOverviewTableGUI($this);
702
703 $ilCtrl->setParameter($this, "ctype", $_GET["ctype"]);
704 $ilCtrl->setParameter($this, "cname", $_GET["cname"]);
705 $ilCtrl->setParameter($this, "slot_id", $_GET["slot_id"]);
706 $ilCtrl->redirect($this, "listPlugins");
707 }

References $_GET, $DIC, $ilCtrl, $result, ilPlugin\getPluginObject(), and ilUtil\sendFailure().

+ Here is the call graph for this function:

◆ update()

ilObjComponentSettingsGUI::update ( ilPlugin  $plugin)
protected

Execute update and ctrl reload.

Parameters
ilPlugin$plugin
Returns
void

Definition at line 537 of file class.ilObjComponentSettingsGUI.php.

538 {
539 $result = $plugin->update();
540
541 if ($result !== true) {
542 ilUtil::sendFailure($plugin->message, true);
543 } else {
544 ilUtil::sendSuccess($plugin->message, true);
545 }
546
547 // reinitialize control class
548 global $DIC;
549 $ilCtrl = $DIC->ctrl();
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"]);
559 }
update()
Update plugin.
static redirect($a_script)

References $_GET, $DIC, $ilCtrl, $result, ilUtil\redirect(), ilUtil\sendFailure(), and ilPlugin\update().

Referenced by installPlugin(), and updatePlugin().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ updatePlugin()

ilObjComponentSettingsGUI::updatePlugin ( )
protected

Update a plugin.

Definition at line 517 of file class.ilObjComponentSettingsGUI.php.

518 {
519 include_once("./Services/Component/classes/class.ilPlugin.php");
521 $_GET["ctype"],
522 $_GET["cname"],
523 $_GET["slot_id"],
524 $_GET["pname"]
525 );
526
527 $this->update($pl);
528 }

References $_GET, ilPlugin\getPluginObject(), and update().

+ Here is the call graph for this function:

Field Documentation

◆ $ERROR_MESSAGE

ilObjComponentSettingsGUI::$ERROR_MESSAGE
staticprivate

Definition at line 18 of file class.ilObjComponentSettingsGUI.php.


The documentation for this class was generated from the following file: