ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
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...
 

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
 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
 
 $rbacsystem
 
 $tmp_import_dir
 
 $tabs_gui = null
 
 $ctrl
 

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 458 of file class.ilObjComponentSettingsGUI.php.

459 {
460 global $ilCtrl, $lng;
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 try {
471 $result = $pl->activate();
472 if ($result !== true) {
474 } else {
475 ilUtil::sendSuccess($lng->txt("cmps_plugin_activated"), true);
476 }
477 } catch (ilPluginException $e) {
478 ilUtil::sendFailure($e->getMessage, true);
479 }
480
481 $ilCtrl->setParameter($this, "ctype", $_GET["ctype"]);
482 $ilCtrl->setParameter($this, "cname", $_GET["cname"]);
483 $ilCtrl->setParameter($this, "slot_id", $_GET["slot_id"]);
484
485 if ($_GET["plugin_id"]) {
486 $ilCtrl->setParameter($this, "plugin_id", $_GET["plugin_id"]);
487 $ilCtrl->redirect($this, "showPlugin");
488 } else {
489 $ilCtrl->redirect($this, "listPlugins");
490 }
491 }
$result
$_GET["client_id"]
static getPluginObject($a_ctype, $a_cname, $a_slot_id, $a_pname)
Get plugin object.
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
global $ilCtrl
Definition: ilias.php:18

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

+ Here is the call graph for this function:

◆ confirmUninstallPlugin()

ilObjComponentSettingsGUI::confirmUninstallPlugin ( )
protected

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

609 {
610 global $ilCtrl, $tpl, $ilPluginAdmin;
611
612 include_once("./Services/Component/classes/class.ilPlugin.php");
614 $_GET["ctype"],
615 $_GET["cname"],
616 $_GET["slot_id"],
617 $_GET["pname"]
618 );
619
620 $pl_meta = $ilPluginAdmin->getAllData(
621 $_GET["ctype"],
622 $_GET["cname"],
623 $_GET["slot_id"],
624 $_GET["pname"]
625 );
626
627 $activation = ((bool) $pl_meta["activation_possible"] || (bool) $pl_meta["is_active"]); // #18827
628 $reason = $pl_meta["inactive_reason"];
629
630 $question = $activation
631 ? sprintf($this->lng->txt("cmps_uninstall_confirm"), $pl->getPluginName())
632 : sprintf($this->lng->txt("cmps_uninstall_inactive_confirm"), $pl->getPluginName(), $reason);
633
634 $ilCtrl->setParameter($this, "ctype", $_GET["ctype"]);
635 $ilCtrl->setParameter($this, "cname", $_GET["cname"]);
636 $ilCtrl->setParameter($this, "slot_id", $_GET["slot_id"]);
637 $ilCtrl->setParameter($this, "pname", $_GET["pname"]);
638
639 include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
640 $confirmation_gui = new ilConfirmationGUI();
641 $confirmation_gui->setFormAction($ilCtrl->getFormAction($this));
642 $confirmation_gui->setHeaderText($question);
643 $confirmation_gui->setCancel($this->lng->txt("cancel"), "listPlugins");
644 $confirmation_gui->setConfirm($this->lng->txt("cmps_uninstall"), "uninstallPlugin");
645
646 $tpl->setContent($confirmation_gui->getHTML());
647 }
sprintf('%.4f', $callTime)
Confirmation screen class.

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

+ Here is the call graph for this function:

◆ deactivatePlugin()

ilObjComponentSettingsGUI::deactivatePlugin ( )
protected

Deactivate a plugin.

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

544 {
545 global $ilCtrl, $lng;
546
547 include_once("./Services/Component/classes/class.ilPlugin.php");
549 $_GET["ctype"],
550 $_GET["cname"],
551 $_GET["slot_id"],
552 $_GET["pname"]
553 );
554
555 $result = $pl->deactivate();
556
557 if ($result !== true) {
559 } else {
560 ilUtil::sendSuccess($lng->txt("cmps_plugin_deactivated"), true);
561 }
562
563 $ilCtrl->setParameter($this, "ctype", $_GET["ctype"]);
564 $ilCtrl->setParameter($this, "cname", $_GET["cname"]);
565 $ilCtrl->setParameter($this, "slot_id", $_GET["slot_id"]);
566
567 if ($_GET["plugin_id"]) {
568 $ilCtrl->setParameter($this, "plugin_id", $_GET["plugin_id"]);
569 $ilCtrl->redirect($this, "showPlugin");
570 } else {
571 $ilCtrl->redirect($this, "listPlugins");
572 }
573 }

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

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

References $_GET, $config, $ilCtrl, ilObjectGUI\$ilErr, $path, ilObjectGUI\$rbacsystem, $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 101 of file class.ilObjComponentSettingsGUI.php.

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

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

◆ installPlugin()

ilObjComponentSettingsGUI::installPlugin ( )
protected

Install a plugin.

Returns
void

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

442 {
443 include_once("./Services/Component/classes/class.ilPlugin.php");
445 $_GET["ctype"],
446 $_GET["cname"],
447 $_GET["slot_id"],
448 $_GET["pname"]
449 );
450
451 $pl->install();
452 $this->update($pl);
453 }
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 157 of file class.ilObjComponentSettingsGUI.php.

158 {
159 global $tpl, $ilTabs;
160
161 $ilTabs->activateTab("plugins");
162 include_once("./Services/Component/classes/class.ilPluginsOverviewTableGUI.php");
163 $table = new ilPluginsOverviewTableGUI($this, "listPlugins");
164 $tpl->setContent($table->getHTML());
165 }
TableGUI class for components listing.
if(empty($password)) $table
Definition: pwgen.php:24

References $table, and ilObjectGUI\$tpl.

◆ listSlots()

ilObjComponentSettingsGUI::listSlots ( )

List Services.

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

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

◆ refreshLanguages()

ilObjComponentSettingsGUI::refreshLanguages ( )
protected

Refresh Languages.

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

579 {
580 global $ilCtrl;
581
582 include_once("./Services/Component/classes/class.ilPlugin.php");
584 $_GET["ctype"],
585 $_GET["cname"],
586 $_GET["slot_id"],
587 $_GET["pname"]
588 );
589
590 $result = $pl->updateLanguages();
591
592 if ($result !== true) {
594 }
595
596 $ilCtrl->setParameter($this, "ctype", $_GET["ctype"]);
597 $ilCtrl->setParameter($this, "cname", $_GET["cname"]);
598 $ilCtrl->setParameter($this, "slot_id", $_GET["slot_id"]);
599
600 if ($_GET["plugin_id"]) {
601 $ilCtrl->setParameter($this, "plugin_id", $_GET["plugin_id"]);
602 $ilCtrl->redirect($this, "showPlugin");
603 } else {
604 $ilCtrl->redirect($this, "listPlugins");
605 }
606 }

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

+ Here is the call graph for this function:

◆ showPlugin()

ilObjComponentSettingsGUI::showPlugin ( )
protected

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

244 {
245 global $ilCtrl, $ilTabs, $lng, $tpl, $ilDB, $ilToolbar;
246
247 if (!$_GET["ctype"] ||
248 !$_GET["cname"] ||
249 !$_GET["slot_id"] ||
250 !$_GET["plugin_id"]) {
251 $ilCtrl->redirect($this, "listPlugins");
252 }
253
254 include_once("./Services/Component/classes/class.ilPluginSlot.php");
255 $slot = new ilPluginSlot($_GET["ctype"], $_GET["cname"], $_GET["slot_id"]);
256
257 $plugin = null;
258 foreach ($slot->getPluginsInformation() as $item) {
259 if ($item["id"] == $_GET["plugin_id"]) {
260 $plugin = $item;
261 break;
262 }
263 }
264 if (!$plugin) {
265 $ilCtrl->redirect($this, "listPlugins");
266 }
267
268 $ilTabs->clearTargets();
269 $ilTabs->setBackTarget(
270 $lng->txt("cmps_plugins"),
271 $ilCtrl->getLinkTarget($this, "listPlugins")
272 );
273
274 $ilCtrl->setParameter($this, "ctype", $_GET["ctype"]);
275 $ilCtrl->setParameter($this, "cname", $_GET["cname"]);
276 $ilCtrl->setParameter($this, "slot_id", $_GET["slot_id"]);
277 $ilCtrl->setParameter($this, "plugin_id", $_GET["plugin_id"]);
278 $ilCtrl->setParameter($this, "pname", $plugin["name"]);
279
280 $langs = ilPlugin::getAvailableLangFiles($slot->getPluginsDirectory() . "/" .
281 $plugin["name"] . "/lang");
282
283 // dbupdate
285 $_GET["ctype"],
286 $_GET["cname"],
287 ilPluginSlot::lookupSlotName($_GET["ctype"], $_GET["cname"], $_GET["slot_id"]),
288 $plugin["name"]
289 );
290 $db_curr = $db_file = null;
291 if (@is_file($file)) {
292 include_once("./Services/Component/classes/class.ilPluginDBUpdate.php");
293 $dbupdate = new ilPluginDBUpdate(
294 $_GET["ctype"],
295 $_GET["cname"],
296 $_GET["slot_id"],
297 $plugin["name"],
298 $ilDB,
299 true,
300 ""
301 );
302
303 $db_curr = $dbupdate->getCurrentVersion();
304 $db_file = $dbupdate->getFileVersion();
305 }
306
307 // toolbar actions
308 if ($plugin["must_install"]) {
309 $ilToolbar->addButton(
310 $lng->txt("cmps_install"),
311 $ilCtrl->getLinkTarget($this, "installPlugin")
312 );
313 } else {
314 // configure button
315 if (ilPlugin::hasConfigureClass($slot->getPluginsDirectory(), $plugin["name"]) &&
316 $ilCtrl->checkTargetClass(ilPlugin::getConfigureClassName($plugin["name"]))) {
317 $ilToolbar->addButton(
318 $lng->txt("cmps_configure"),
319 $ilCtrl->getLinkTargetByClass(strtolower(ilPlugin::getConfigureClassName($plugin["name"])), "configure")
320 );
321 }
322 // refresh languages button
323 if (count($langs) > 0) {
324 $ilToolbar->addButton(
325 $lng->txt("cmps_refresh"),
326 $ilCtrl->getLinkTarget($this, "refreshLanguages")
327 );
328 }
329
330 if ($plugin["activation_possible"]) {
331 $ilToolbar->addButton(
332 $lng->txt("cmps_activate"),
333 $ilCtrl->getLinkTarget($this, "activatePlugin")
334 );
335 }
336
337 // deactivation/refresh languages button
338 if ($plugin["is_active"]) {
339 // deactivate button
340 $ilToolbar->addButton(
341 $lng->txt("cmps_deactivate"),
342 $ilCtrl->getLinkTarget($this, "deactivatePlugin")
343 );
344 }
345
346 // update button
347 if ($plugin["needs_update"]) {
348 $ilToolbar->addButton(
349 $lng->txt("cmps_update"),
350 $ilCtrl->getLinkTarget($this, "updatePlugin")
351 );
352 }
353 }
354
355 // info
356 $resp = array();
357 if (strlen($plugin["responsible"])) {
358 $responsibles = explode('/', $plugin["responsible_mail"]);
359 foreach ($responsibles as $responsible) {
360 if (!strlen($responsible = trim($responsible))) {
361 continue;
362 }
363
364 $resp[] = $responsible;
365 }
366
367 $resp = $plugin["responsible"] . " (" . implode(" / ", $resp) . ")";
368 }
369
370 if ($plugin["is_active"]) {
371 $status = $lng->txt("cmps_active");
372 } else {
373 $r = ($plugin["inactive_reason"] != "")
374 ? " (" . $plugin["inactive_reason"] . ")"
375 : "";
376
377 $status = $lng->txt("cmps_inactive") . $r;
378 }
379
380 $info[""][$lng->txt("cmps_name")] = $plugin["name"];
381 $info[""][$lng->txt("cmps_id")] = $plugin["id"];
382 $info[""][$lng->txt("cmps_version")] = $plugin["version"];
383 if ($resp) {
384 $info[""][$lng->txt("cmps_responsible")] = $resp;
385 }
386 $info[""][$lng->txt("cmps_ilias_min_version")] = $plugin["ilias_min_version"];
387 $info[""][$lng->txt("cmps_ilias_max_version")] = $plugin["ilias_max_version"];
388 $info[""][$lng->txt("cmps_status")] = $status;
389
390 if (sizeof($langs)) {
391 $lang_files = array();
392 foreach ($langs as $lang) {
393 $lang_files[] = $lang["file"];
394 }
395 $info[""][$lng->txt("cmps_languages")] = implode(", ", $lang_files);
396 } else {
397 $info[""][$lng->txt("cmps_languages")] = $lng->txt("cmps_no_language_file_available");
398 }
399
400 $info[$lng->txt("cmps_basic_files")]["plugin.php"] = $plugin["plugin_php_file_status"] ?
401 $lng->txt("cmps_available") :
402 $lng->txt("cmps_missing");
403 $info[$lng->txt("cmps_basic_files")][$lng->txt("cmps_class_file")] = ($plugin["class_file_status"] ?
404 $lng->txt("cmps_available") :
405 $lng->txt("cmps_missing")) .
406 " (" . $plugin["class_file"] . ")";
407
408 if (!$db_file) {
409 $info[$lng->txt("cmps_database")][$lng->txt("file")] = $lng->txt("cmps_no_db_update_file_available");
410 } else {
411 $info[$lng->txt("cmps_database")][$lng->txt("file")] = "dbupdate.php";
412 $info[$lng->txt("cmps_database")][$lng->txt("cmps_current_version")] = $db_curr;
413 $info[$lng->txt("cmps_database")][$lng->txt("cmps_file_version")] = $db_file;
414 }
415
416 include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
417 $form = new ilPropertyFormGUI();
418 $form->setTitle($lng->txt("cmps_plugin"));
419
420 foreach ($info as $section => $items) {
421 if (trim($section)) {
422 $sec = new ilFormSectionHeaderGUI();
423 $sec->setTitle($section);
424 $form->addItem($sec);
425 }
426 foreach ($items as $key => $value) {
427 $non = new ilNonEditableValueGUI($key);
428 $non->setValue($value);
429 $form->addItem($non);
430 }
431 }
432
433 $tpl->setContent($form->getHTML());
434 }
$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 getAvailableLangFiles($a_lang_directory)
Get array of all language files in the plugin.
static getDBUpdateScriptName($a_ctype, $a_cname, $a_slot_name, $a_pname)
Get DB update script filename (full path)
static getConfigureClassName($a_name)
Get plugin configure class name.
static hasConfigureClass($a_slot_dir, $a_name)
Has the plugin a configure class?
This class represents a property form user interface.
$lang
Definition: consent.php:3
$key
Definition: croninfo.php:18
$r
Definition: example_031.php:79
$info
Definition: index.php:5
if(isset($_POST['submit'])) $form
if(!file_exists("$old.txt")) if( $old===$new) if(file_exists("$new.txt")) $file
global $ilDB

References $_GET, $file, $form, $ilCtrl, $ilDB, $info, $key, $lang, ilObjectGUI\$lng, $r, $section, ilObjectGUI\$tpl, ilPlugin\getAvailableLangFiles(), ilPlugin\getConfigureClassName(), ilPlugin\getDBUpdateScriptName(), 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 170 of file class.ilObjComponentSettingsGUI.php.

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

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

+ Here is the call graph for this function:

◆ uninstallPlugin()

ilObjComponentSettingsGUI::uninstallPlugin ( )
protected

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

650 {
651 global $ilCtrl;
652
653 include_once("./Services/Component/classes/class.ilPlugin.php");
655 $_GET["ctype"],
656 $_GET["cname"],
657 $_GET["slot_id"],
658 $_GET["pname"]
659 );
660
661 try {
662 $result = $pl->uninstall();
663 if ($result !== true) {
665 } else {
666 ilUtil::sendSuccess($this->lng->txt("cmps_plugin_uninstalled"), true);
667 }
668 } catch (ilPluginException $e) {
669 ilUtil::sendFailure($e->getMessage, true);
670 }
671
672 $ilCtrl->setParameter($this, "ctype", $_GET["ctype"]);
673 $ilCtrl->setParameter($this, "cname", $_GET["cname"]);
674 $ilCtrl->setParameter($this, "slot_id", $_GET["slot_id"]);
675 $ilCtrl->redirect($this, "listPlugins");
676 }

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

+ 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 516 of file class.ilObjComponentSettingsGUI.php.

517 {
518 $result = $plugin->update();
519
520 if ($result !== true) {
521 ilUtil::sendFailure($plugin->message, true);
522 } else {
523 ilUtil::sendSuccess($plugin->message, true);
524 }
525
526 // reinitialize control class
527 global $ilCtrl;
528 $ilCtrl->initBaseClass("iladministrationgui");
529 $_GET["cmd"] = "jumpToPluginSlot";
530 $ilCtrl->setParameterByClass("iladministrationgui", "ctype", $_GET["ctype"]);
531 $ilCtrl->setParameterByClass("iladministrationgui", "cname", $_GET["cname"]);
532 $ilCtrl->setParameterByClass("iladministrationgui", "slot_id", $_GET["slot_id"]);
533 $ilCtrl->setParameterByClass("iladministrationgui", "plugin_id", $_GET["plugin_id"]);
534 $ilCtrl->setTargetScript("ilias.php");
535 ilUtil::redirect("ilias.php?admin_mode=settings&baseClass=ilAdministrationGUI" .
536 "&cmd=jumpToPluginSlot&ref_id=" . $_GET["ref_id"] . "&ctype=" . $_GET["ctype"] .
537 "&cname=" . $_GET["cname"] . "&slot_id=" . $_GET["slot_id"] . "&plugin_id=" . $_GET["plugin_id"]);
538 }
update()
Update plugin.
static redirect($a_script)

References $_GET, $ilCtrl, $result, ilUtil\redirect(), ilUtil\sendFailure(), ilUtil\sendSuccess(), 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 496 of file class.ilObjComponentSettingsGUI.php.

497 {
498 include_once("./Services/Component/classes/class.ilPlugin.php");
500 $_GET["ctype"],
501 $_GET["cname"],
502 $_GET["slot_id"],
503 $_GET["pname"]
504 );
505
506 $this->update($pl);
507 }

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: