ILIAS  release_7 Revision v7.30-3-g800a261c036
ilObjComponentSettingsGUI Class Reference

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

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

Public Member Functions

 __construct ($a_data, int $a_id, bool $a_call_by_reference=true, bool $a_prepare_output=true)
 ilObjComponentSettingsGUI constructor. More...
 
 executeCommand ()
 Execute command @access public. More...
 
 getAdminTabs ()
 Get tabs @access public. 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 ()
 viewObject container presentation for "administration -> repository, trash, permissions" 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...
 
 addToDeskObject ()
 @inheritDoc More...
 
 removeFromDeskObject ()
 @inheritDoc More...
 
- Public Member Functions inherited from ILIAS\Object\ImplementsCreationCallback
 callCreationCallback (\ilObject $object, \ilObjectDefinition $obj_definition, int $requested_crtcb)
 

Data Fields

const CMD_DEFAULT = "listPlugins"
 
const CMD_LIST_SLOTS = "listSlots"
 
const TAB_PLUGINS = "plugins"
 
const CMD_INSTALL_PLUGIN = "installPlugin"
 
const CMD_CONFIGURE = "configure"
 
const CMD_REFRESH_LANGUAGES = "refreshLanguages"
 
const CMD_ACTIVATE_PLUGIN = "activatePlugin"
 
const CMD_DEACTIVATE_PLUGIN = "deactivatePlugin"
 
const CMD_UPDATE_PLUGIN = "updatePlugin"
 
const P_CTYPE = "ctype"
 
const P_CNAME = "cname"
 
const P_SLOT_ID = "slot_id"
 
const P_PLUGIN_NAME = "pname"
 
const P_PLUGIN_ID = "plugin_id"
 
const CMD_SHOW_PLUGIN = "showPlugin"
 
const CMD_JUMP_TO_PLUGIN_SLOT = "jumpToPluginSlot"
 
const CMD_UNINSTALL_PLUGIN = "uninstallPlugin"
 
const CMD_CONFIRM_UNINSTALL_PLUGIN = "confirmUninstallPlugin"
 
const TAB_SLOTS = 'slots'
 
- Data Fields inherited from ilObjectGUI
const ALLOWED_TAGS_IN_TITLE_AND_DESCRIPTION
 
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 Member Functions

 listSlots ()
 
 listPlugins ()
 
 showPluginSlotInfo ()
 
 showPlugin ()
 
 installPlugin ()
 
 activatePlugin ()
 
 updatePlugin ()
 
 update (ilPlugin $plugin)
 
 deactivatePlugin ()
 
 refreshLanguages ()
 
 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...
 
 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...
 

Protected Attributes

 $type
 
 $tabs
 
 $rbac_system
 
 $db
 
- Protected Attributes inherited from ilObjectGUI
const UPLOAD_TYPE_LOCAL = 1
 
const UPLOAD_TYPE_UPLOAD_DIRECTORY = 2
 
 $ilErr
 
 $locator
 
 $user
 
 $access
 
 $rbacsystem
 
 $settings
 
 $rbacreview
 
 $toolbar
 
 $tmp_import_dir
 
 $tabs_gui = null
 
 $ctrl
 
 $object_service
 
 $favourites
 
 $request
 

Private Attributes

const TYPE = 'cmps'
 

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...
 

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 @ilCtrl_Calls ilObjComponentSettingsGUI: ilPermissionGUI

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

Constructor & Destructor Documentation

◆ __construct()

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

ilObjComponentSettingsGUI constructor.

Parameters
$a_data
$a_id
bool$a_call_by_reference
bool$a_prepare_output

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

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 }
global $DIC
Definition: goto.php:24
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc

References $DIC, ILIAS\GlobalScreen\Provider\__construct(), and TYPE.

+ Here is the call graph for this function:

Member Function Documentation

◆ activatePlugin()

ilObjComponentSettingsGUI::activatePlugin ( )
protected

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

461 : 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 }
$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.

References $_GET, Vendor\Package\$e, $result, ilPlugin\getPluginObject(), and ilUtil\sendFailure().

+ Here is the call graph for this function:

◆ confirmUninstallPlugin()

ilObjComponentSettingsGUI::confirmUninstallPlugin ( )
protected

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

579 : 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 }
Confirmation screen class.

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

+ Here is the call graph for this function:

◆ deactivatePlugin()

ilObjComponentSettingsGUI::deactivatePlugin ( )
protected

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

527 : 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 }

References $_GET, $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 72 of file class.ilObjComponentSettingsGUI.php.

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 }
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.
if(!array_key_exists('PATH_INFO', $_SERVER)) $config
Definition: metadata.php:68

References $_GET, $config, $DIC, ilObjectGUI\$ilErr, CMD_DEFAULT, 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 134 of file class.ilObjComponentSettingsGUI.php.

134 : 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 }

References $_GET.

◆ installPlugin()

ilObjComponentSettingsGUI::installPlugin ( )
protected

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

448 : 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 }

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

+ Here is the call graph for this function:

◆ listPlugins()

ilObjComponentSettingsGUI::listPlugins ( )
protected

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

177 : 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 }
Class ilPluginsOverviewTableFilterGUI.
TableGUI class for components listing.

◆ listSlots()

ilObjComponentSettingsGUI::listSlots ( )
protected

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

166 : 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 }
TableGUI class for components listing.

◆ refreshLanguages()

ilObjComponentSettingsGUI::refreshLanguages ( )
protected

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

556 : 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 }

References $_GET, and ilPlugin\getPluginObject().

+ Here is the call graph for this function:

◆ showPlugin()

ilObjComponentSettingsGUI::showPlugin ( )
protected

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

256 : 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 }
$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.
$lang
Definition: xapiexit.php:8

References $_GET, $lang, XapiProxy\$plugin, XapiProxy\$resp, $section, 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

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

187 : 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]) . "/<Plugin_Name>");
217 $form->addItem($ne);
218
219 // plugin file
220 $ne = new ilNonEditableValueGUI($this->lng->txt("cmps_plugin_file"), "", true);
221 $ne->setValue("<" . $this->lng->txt("cmps_main_dir") . ">" .
222 "/classes/class.il<Plugin_Name>Plugin.php");
223 $form->addItem($ne);
224
225 // language files
226 $ne = new ilNonEditableValueGUI($this->lng->txt("cmps_lang_files"), "", true);
227 $ne->setValue("<" . $this->lng->txt("cmps_main_dir") . ">" .
228 "/lang/ilias_<Language ID>.lang");
229 $form->addItem($ne);
230
231 // db update
232 $ne = new ilNonEditableValueGUI($this->lng->txt("cmps_db_update"), "", true);
233 $ne->setValue("<" . $this->lng->txt("cmps_main_dir") . ">" .
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]) . "<Plugin_ID>_");
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]) . "<Plugin_ID>_");
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 }
static getComponentObject($a_ctype, $a_cname)
Get component object.

References $_GET, and ilComponent\getComponentObject().

+ Here is the call graph for this function:

◆ uninstallPlugin()

ilObjComponentSettingsGUI::uninstallPlugin ( )
protected

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

619 : 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 }

References $_GET, Vendor\Package\$e, $result, ilPlugin\getPluginObject(), and ilUtil\sendFailure().

+ Here is the call graph for this function:

◆ update()

ilObjComponentSettingsGUI::update ( ilPlugin  $plugin)
protected

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

505 : 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 }
static redirect($a_script)

References $_GET, XapiProxy\$plugin, $result, CMD_JUMP_TO_PLUGIN_SLOT, ilUtil\redirect(), and ilUtil\sendFailure().

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

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

493 : 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 }

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

+ Here is the call graph for this function:

Field Documentation

◆ $db

ilObjComponentSettingsGUI::$db
protected

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

◆ $rbac_system

ilObjComponentSettingsGUI::$rbac_system
protected

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

◆ $tabs

ilObjComponentSettingsGUI::$tabs
protected

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

◆ $type

ilObjComponentSettingsGUI::$type
protected

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

◆ CMD_ACTIVATE_PLUGIN

const ilObjComponentSettingsGUI::CMD_ACTIVATE_PLUGIN = "activatePlugin"

◆ CMD_CONFIGURE

const ilObjComponentSettingsGUI::CMD_CONFIGURE = "configure"

◆ CMD_CONFIRM_UNINSTALL_PLUGIN

const ilObjComponentSettingsGUI::CMD_CONFIRM_UNINSTALL_PLUGIN = "confirmUninstallPlugin"

◆ CMD_DEACTIVATE_PLUGIN

const ilObjComponentSettingsGUI::CMD_DEACTIVATE_PLUGIN = "deactivatePlugin"

◆ CMD_DEFAULT

const ilObjComponentSettingsGUI::CMD_DEFAULT = "listPlugins"

◆ CMD_INSTALL_PLUGIN

const ilObjComponentSettingsGUI::CMD_INSTALL_PLUGIN = "installPlugin"

◆ CMD_JUMP_TO_PLUGIN_SLOT

const ilObjComponentSettingsGUI::CMD_JUMP_TO_PLUGIN_SLOT = "jumpToPluginSlot"

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

Referenced by update().

◆ CMD_LIST_SLOTS

const ilObjComponentSettingsGUI::CMD_LIST_SLOTS = "listSlots"

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

◆ CMD_REFRESH_LANGUAGES

const ilObjComponentSettingsGUI::CMD_REFRESH_LANGUAGES = "refreshLanguages"

◆ CMD_SHOW_PLUGIN

const ilObjComponentSettingsGUI::CMD_SHOW_PLUGIN = "showPlugin"

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

◆ CMD_UNINSTALL_PLUGIN

const ilObjComponentSettingsGUI::CMD_UNINSTALL_PLUGIN = "uninstallPlugin"

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

◆ CMD_UPDATE_PLUGIN

const ilObjComponentSettingsGUI::CMD_UPDATE_PLUGIN = "updatePlugin"

◆ P_CNAME

const ilObjComponentSettingsGUI::P_CNAME = "cname"

◆ P_CTYPE

const ilObjComponentSettingsGUI::P_CTYPE = "ctype"

◆ P_PLUGIN_ID

const ilObjComponentSettingsGUI::P_PLUGIN_ID = "plugin_id"

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

◆ P_PLUGIN_NAME

const ilObjComponentSettingsGUI::P_PLUGIN_NAME = "pname"

◆ P_SLOT_ID

const ilObjComponentSettingsGUI::P_SLOT_ID = "slot_id"

◆ TAB_PLUGINS

const ilObjComponentSettingsGUI::TAB_PLUGINS = "plugins"

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

◆ TAB_SLOTS

const ilObjComponentSettingsGUI::TAB_SLOTS = 'slots'

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

◆ TYPE

const ilObjComponentSettingsGUI::TYPE = 'cmps'
private

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

Referenced by __construct().


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