ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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...
 
 listPlugins ()
 List plugins. More...
 
 showPluginSlotInfo ()
 Show information about a plugin slot. More...
 
 showPlugin ()
 
 refreshPluginsInformation ()
 Refresh plugins information. More...
 
 activatePlugin ()
 Activate a plugin. More...
 
 updatePlugin ()
 Update a plugin. More...
 
 deactivatePlugin ()
 Deactivate a plugin. More...
 
 refreshLanguages ()
 Refresh Languages. More...
 
 updatePluginDB ()
 Update plugin DB. More...
 
 confirmUninstallPlugin ()
 
 uninstallPlugin ()
 
- 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 public More...
 
 createObject ()
 create new object form More...
 
 cancelCreation ()
 cancel create action and go back to repository parent More...
 
 saveObject ()
 save object 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...
 

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
 
 $ilias
 
 $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 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 public More...
 
 setAdminTabs ()
 set admin tabs 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...
 
 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...
 
 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 inherited from ilObjectGUI
 $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$

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.

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 ( )

Activate a plugin.

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

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

472  {
473  global $ilCtrl, $lng;
474 
475  include_once("./Services/Component/classes/class.ilPlugin.php");
476  $pl = ilPlugin::getPluginObject($_GET["ctype"], $_GET["cname"],
477  $_GET["slot_id"], $_GET["pname"]);
478 
479  try
480  {
481  $result = $pl->activate();
482  if ($result !== true)
483  {
485  }
486  else
487  {
488  ilUtil::sendSuccess($lng->txt("cmps_plugin_activated"), true);
489  }
490  }
491  catch(ilPluginException $e)
492  {
493  ilUtil::sendFailure($e->getMessage, true);
494  }
495 
496  $ilCtrl->setParameter($this, "ctype", $_GET["ctype"]);
497  $ilCtrl->setParameter($this, "cname", $_GET["cname"]);
498  $ilCtrl->setParameter($this, "slot_id", $_GET["slot_id"]);
499 
500  if($_GET["plugin_id"])
501  {
502  $ilCtrl->setParameter($this, "plugin_id", $_GET["plugin_id"]);
503  $ilCtrl->redirect($this, "showPlugin");
504  }
505  else
506  {
507  $ilCtrl->redirect($this, "listPlugins");
508  }
509  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
static getPluginObject($a_ctype, $a_cname, $a_slot_id, $a_pname)
Get plugin object.
$result
$_GET["client_id"]
global $ilCtrl
Definition: ilias.php:18
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
+ Here is the call graph for this function:

◆ confirmUninstallPlugin()

ilObjComponentSettingsGUI::confirmUninstallPlugin ( )

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

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

653  {
654  global $ilCtrl, $tpl, $ilPluginAdmin;
655 
656  include_once("./Services/Component/classes/class.ilPlugin.php");
657  $pl = ilPlugin::getPluginObject($_GET["ctype"], $_GET["cname"],
658  $_GET["slot_id"], $_GET["pname"]);
659 
660  $pl_meta = $ilPluginAdmin->getAllData($_GET["ctype"], $_GET["cname"],
661  $_GET["slot_id"], $_GET["pname"]);
662 
663  $activation = ((bool)$pl_meta["activation_possible"] || (bool)$pl_meta["is_active"]); // #18827
664  $reason = $pl_meta["inactive_reason"];
665 
666  $question = $activation
667  ? sprintf($this->lng->txt("cmps_uninstall_confirm"), $pl->getPluginName())
668  : sprintf($this->lng->txt("cmps_uninstall_inactive_confirm"), $pl->getPluginName(), $reason);
669 
670  $ilCtrl->setParameter($this, "ctype", $_GET["ctype"]);
671  $ilCtrl->setParameter($this, "cname", $_GET["cname"]);
672  $ilCtrl->setParameter($this, "slot_id", $_GET["slot_id"]);
673  $ilCtrl->setParameter($this, "pname", $_GET["pname"]);
674 
675  include_once("./Services/Utilities/classes/class.ilConfirmationGUI.php");
676  $confirmation_gui = new ilConfirmationGUI();
677  $confirmation_gui->setFormAction($ilCtrl->getFormAction($this));
678  $confirmation_gui->setHeaderText($question);
679  $confirmation_gui->setCancel($this->lng->txt("cancel"), "listPlugins");
680  $confirmation_gui->setConfirm($this->lng->txt("cmps_uninstall"), "uninstallPlugin");
681 
682  $tpl->setContent($confirmation_gui->getHTML());
683  }
static getPluginObject($a_ctype, $a_cname, $a_slot_id, $a_pname)
Get plugin object.
$_GET["client_id"]
global $ilCtrl
Definition: ilias.php:18
Confirmation screen class.
+ Here is the call graph for this function:

◆ deactivatePlugin()

ilObjComponentSettingsGUI::deactivatePlugin ( )

Deactivate a plugin.

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

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

551  {
552  global $ilCtrl, $lng;
553 
554  include_once("./Services/Component/classes/class.ilPlugin.php");
555  $pl = ilPlugin::getPluginObject($_GET["ctype"], $_GET["cname"],
556  $_GET["slot_id"], $_GET["pname"]);
557 
558  $result = $pl->deactivate();
559 
560  if ($result !== true)
561  {
563  }
564  else
565  {
566  ilUtil::sendSuccess($lng->txt("cmps_plugin_deactivated"), true);
567  }
568 
569  $ilCtrl->setParameter($this, "ctype", $_GET["ctype"]);
570  $ilCtrl->setParameter($this, "cname", $_GET["cname"]);
571  $ilCtrl->setParameter($this, "slot_id", $_GET["slot_id"]);
572 
573  if($_GET["plugin_id"])
574  {
575  $ilCtrl->setParameter($this, "plugin_id", $_GET["plugin_id"]);
576  $ilCtrl->redirect($this, "showPlugin");
577  }
578  else
579  {
580  $ilCtrl->redirect($this, "listPlugins");
581  }
582  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
static getPluginObject($a_ctype, $a_cname, $a_slot_id, $a_pname)
Get plugin object.
$result
$_GET["client_id"]
global $ilCtrl
Definition: ilias.php:18
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
+ Here is the call graph for this function:

◆ executeCommand()

ilObjComponentSettingsGUI::executeCommand ( )

Execute command.

public

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

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

39  {
40  global $rbacsystem, $ilErr, $ilAccess, $ilCtrl;
41 
42  $next_class = $this->ctrl->getNextClass($this);
43  $cmd = $this->ctrl->getCmd();
44 
45  $this->prepareOutput();
46 
47  if(!$ilAccess->checkAccess('read','',$this->object->getRefId()))
48  {
49  $ilErr->raiseError($this->lng->txt('no_permission'),$ilErr->WARNING);
50  }
51 
52  switch($next_class)
53  {
54  case 'ilpermissiongui':
55  $this->tabs_gui->setTabActive('perm_settings');
56  include_once("Services/AccessControl/classes/class.ilPermissionGUI.php");
57  $perm_gui = new ilPermissionGUI($this);
58  $ret = $this->ctrl->forwardCommand($perm_gui);
59  break;
60 
61  default:
62 
63  // configure classes
64  $config = false;
65  if (substr(strtolower($next_class), strlen($next_class) - 9) == "configgui")
66  {
67  $path = $ilCtrl->lookupClassPath(strtolower($next_class));
68  if ($path != "")
69  {
70  include_once($path);
71  $nc = new $next_class();
72 
74  $_GET["cname"], $_GET["slot_id"], $_GET["pname"]);
75 
76  $nc->setPluginObject($pl);
77 
78  $ret = $this->ctrl->forwardCommand($nc);
79  $config = true;
80  }
81  }
82 
83  if (!$config)
84  {
85  if(!$cmd || $cmd == 'view')
86  {
87  $cmd = "listPlugins";
88  }
89 
90  $this->$cmd();
91  }
92  break;
93  }
94  return true;
95  }
global $ilErr
Definition: raiseError.php:16
$path
Definition: aliased.php:25
$_GET["client_id"]
$cmd
Definition: sahs_server.php:35
global $ilCtrl
Definition: ilias.php:18
prepareOutput($a_show_subobjects=true)
prepare output
static getPluginObject($a_ctype, $a_cname, $a_slot_id, $a_pname)
Get Plugin Object.
$ret
Definition: parser.php:6
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
+ Here is the call graph for this function:

◆ getAdminTabs()

ilObjComponentSettingsGUI::getAdminTabs ( )

Get tabs.

public

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

References $_GET, and ilObjectGUI\$lng.

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

◆ listPlugins()

ilObjComponentSettingsGUI::listPlugins ( )

List plugins.

Parameters

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

References ilObjectGUI\$tpl.

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

◆ listSlots()

ilObjComponentSettingsGUI::listSlots ( )

List Services.

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

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

◆ refreshLanguages()

ilObjComponentSettingsGUI::refreshLanguages ( )

Refresh Languages.

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

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

588  {
589  global $ilCtrl;
590 
591  include_once("./Services/Component/classes/class.ilPlugin.php");
592  $pl = ilPlugin::getPluginObject($_GET["ctype"], $_GET["cname"],
593  $_GET["slot_id"], $_GET["pname"]);
594 
595  $result = $pl->updateLanguages();
596 
597  if ($result !== true)
598  {
600  }
601 
602  $ilCtrl->setParameter($this, "ctype", $_GET["ctype"]);
603  $ilCtrl->setParameter($this, "cname", $_GET["cname"]);
604  $ilCtrl->setParameter($this, "slot_id", $_GET["slot_id"]);
605 
606  if($_GET["plugin_id"])
607  {
608  $ilCtrl->setParameter($this, "plugin_id", $_GET["plugin_id"]);
609  $ilCtrl->redirect($this, "showPlugin");
610  }
611  else
612  {
613  $ilCtrl->redirect($this, "listPlugins");
614  }
615  }
static getPluginObject($a_ctype, $a_cname, $a_slot_id, $a_pname)
Get plugin object.
$result
$_GET["client_id"]
global $ilCtrl
Definition: ilias.php:18
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
+ Here is the call graph for this function:

◆ refreshPluginsInformation()

ilObjComponentSettingsGUI::refreshPluginsInformation ( )

Refresh plugins information.

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

References $_GET, $ilCtrl, and IL_COMP_SERVICE.

450  {
451  global $ilCtrl;
452 
453 die ("ilObjComponentSettigsGUI::refreshPluginsInformation: deprecated");
454 
455  include_once("./Services/Component/classes/class.ilPlugin.php");
456  ilPlugin::refreshPluginXmlInformation();
457 
458  if ($_GET["mode"] == IL_COMP_SERVICE)
459  {
460  $ilCtrl->redirect($this, "listServices");
461  }
462  else
463  {
464  $ilCtrl->redirect($this, "listModules");
465  }
466  }
$_GET["client_id"]
global $ilCtrl
Definition: ilias.php:18
const IL_COMP_SERVICE

◆ showPlugin()

ilObjComponentSettingsGUI::showPlugin ( )

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

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

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

◆ showPluginSlotInfo()

ilObjComponentSettingsGUI::showPluginSlotInfo ( )

Show information about a plugin slot.

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

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

172  {
173  global $tpl,$lng, $ilTabs, $ilCtrl;
174 
175  if(!DEVMODE)
176  {
177  $ilCtrl->redirect($this, "listPlugins");
178  }
179 
180  $ilTabs->clearTargets();
181 
182  $ilTabs->setBackTarget($lng->txt("cmps_slots"),
183  $ilCtrl->getLinkTarget($this, "listSlots"));
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"])."/&lt;Plugin_Name&gt;");
204  $form->addItem($ne);
205 
206  // plugin file
207  $ne = new ilNonEditableValueGUI($lng->txt("cmps_plugin_file"), "", true);
208  $ne->setValue("&lt;".$lng->txt("cmps_main_dir")."&gt;".
209  "/classes/class.il&lt;Plugin_Name&gt;Plugin.php");
210  $form->addItem($ne);
211 
212  // language files
213  $ne = new ilNonEditableValueGUI($lng->txt("cmps_lang_files"), "", true);
214  $ne->setValue("&lt;".$lng->txt("cmps_main_dir")."&gt;".
215  "/lang/ilias_&lt;Language ID&gt;.lang");
216  $form->addItem($ne);
217 
218  // db update
219  $ne = new ilNonEditableValueGUI($lng->txt("cmps_db_update"), "", true);
220  $ne->setValue("&lt;".$lng->txt("cmps_main_dir")."&gt;".
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"])."&lt;Plugin_ID&gt;_");
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"])."&lt;Plugin_ID&gt;_");
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.
This class represents a property form user interface.
$_GET["client_id"]
global $ilCtrl
Definition: ilias.php:18
This class represents a non editable value in a property form.
+ Here is the call graph for this function:

◆ uninstallPlugin()

ilObjComponentSettingsGUI::uninstallPlugin ( )

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

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

686  {
687  global $ilCtrl;
688 
689  include_once("./Services/Component/classes/class.ilPlugin.php");
690  $pl = ilPlugin::getPluginObject($_GET["ctype"], $_GET["cname"],
691  $_GET["slot_id"], $_GET["pname"]);
692 
693  try
694  {
695  $result = $pl->uninstall();
696  if ($result !== true)
697  {
699  }
700  else
701  {
702  ilUtil::sendSuccess($this->lng->txt("cmps_plugin_uninstalled"), true);
703  }
704  }
705  catch(ilPluginException $e)
706  {
707  ilUtil::sendFailure($e->getMessage, true);
708  }
709 
710  $ilCtrl->setParameter($this, "ctype", $_GET["ctype"]);
711  $ilCtrl->setParameter($this, "cname", $_GET["cname"]);
712  $ilCtrl->setParameter($this, "slot_id", $_GET["slot_id"]);
713  $ilCtrl->redirect($this, "listPlugins");
714  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
static getPluginObject($a_ctype, $a_cname, $a_slot_id, $a_pname)
Get plugin object.
$result
$_GET["client_id"]
global $ilCtrl
Definition: ilias.php:18
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
+ Here is the call graph for this function:

◆ updatePlugin()

ilObjComponentSettingsGUI::updatePlugin ( )

Update a plugin.

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

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

515  {
516  include_once("./Services/Component/classes/class.ilPlugin.php");
517  $pl = ilPlugin::getPluginObject($_GET["ctype"], $_GET["cname"],
518  $_GET["slot_id"], $_GET["pname"]);
519 
520  $result = $pl->update();
521 
522  if ($result !== true)
523  {
524  ilUtil::sendFailure($pl->message, true);
525  }
526  else
527  {
528  ilUtil::sendSuccess($pl->message, true);
529  }
530 
531  // reinitialize control class
532  global $ilCtrl;
533  $ilCtrl->initBaseClass("iladministrationgui");
534  $_GET["cmd"] = "jumpToPluginSlot";
535  $ilCtrl->setParameterByClass("iladministrationgui", "ctype", $_GET["ctype"]);
536  $ilCtrl->setParameterByClass("iladministrationgui", "cname", $_GET["cname"]);
537  $ilCtrl->setParameterByClass("iladministrationgui", "slot_id", $_GET["slot_id"]);
538  $ilCtrl->setParameterByClass("iladministrationgui", "plugin_id", $_GET["plugin_id"]);
539  $ilCtrl->setTargetScript("ilias.php");
540 // $ilCtrl->callBaseClass();
541  ilUtil::redirect("ilias.php?admin_mode=settings&baseClass=ilAdministrationGUI".
542  "&cmd=jumpToPluginSlot&ref_id=".$_GET["ref_id"]."&ctype=".$_GET["ctype"].
543  "&cname=".$_GET["cname"]."&slot_id=".$_GET["slot_id"]."&plugin_id=".$_GET["plugin_id"]);
544  //$ilCtrl->redirectByClass("iladministrationgui", );
545  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
static getPluginObject($a_ctype, $a_cname, $a_slot_id, $a_pname)
Get plugin object.
$result
$_GET["client_id"]
global $ilCtrl
Definition: ilias.php:18
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
static redirect($a_script)
http redirect to other script
+ Here is the call graph for this function:

◆ updatePluginDB()

ilObjComponentSettingsGUI::updatePluginDB ( )

Update plugin DB.

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

References $_GET, $ilCtrl, $ilDB, $row, and ilUtil\sendInfo().

621  {
622  global $ilDB;
623 
624 die ("ilObjComponentSettigsGUI::updatePluginDB: deprecated");
625 
626  include_once("./Services/Component/classes/class.ilPluginDBUpdate.php");
627  $dbupdate = new ilPluginDBUpdate($_GET["ctype"], $_GET["cname"],
628  $_GET["slot_id"], $_GET["pname"], $ilDB, true);
629 
630  $dbupdate->applyUpdate();
631 
632  if ($dbupdate->updateMsg == "no_changes")
633  {
634  $message = $this->lng->txt("no_changes").". ".$this->lng->txt("database_is_uptodate");
635  }
636  else
637  {
638  foreach ($dbupdate->updateMsg as $row)
639  {
640  $message .= $this->lng->txt($row["msg"]).": ".$row["nr"]."<br/>";
641  }
642  }
643 
644  ilUtil::sendInfo($message, true);
645 
646  $ilCtrl->setParameter($this, "ctype", $_GET["ctype"]);
647  $ilCtrl->setParameter($this, "cname", $_GET["cname"]);
648  $ilCtrl->setParameter($this, "slot_id", $_GET["slot_id"]);
649  $ilCtrl->redirect($this, "listPlugins");
650  }
$_GET["client_id"]
Database Update class.
global $ilCtrl
Definition: ilias.php:18
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
global $ilDB
+ 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: