3 include_once(
"./Services/Object/classes/class.ilObjectGUI.php");
24 public function __construct($a_data, $a_id, $a_call_by_reference =
true, $a_prepare_output =
true)
27 parent::__construct($a_data, $a_id, $a_call_by_reference, $a_prepare_output);
29 $this->lng->loadLanguageModule(
'cmps');
42 $next_class = $this->ctrl->getNextClass($this);
43 $cmd = $this->ctrl->getCmd();
47 if (!$rbacsystem->checkAccess(
'read', $this->object->getRefId())) {
48 $ilErr->raiseError($this->lng->txt(
'no_permission'), $ilErr->WARNING);
51 switch ($next_class) {
52 case 'ilpermissiongui':
53 $this->tabs_gui->setTabActive(
'perm_settings');
54 include_once(
"Services/AccessControl/classes/class.ilPermissionGUI.php");
56 $ret = $this->ctrl->forwardCommand($perm_gui);
63 if (substr(strtolower($next_class), strlen($next_class) - 9) ==
"configgui") {
64 $path = $ilCtrl->lookupClassPath(strtolower($next_class));
67 $nc =
new $next_class();
76 $nc->setPluginObject($pl);
78 $ret = $this->ctrl->forwardCommand($nc);
84 if (!$cmd || $cmd ==
'view') {
105 if ($rbacsystem->checkAccess(
"visible,read", $this->object->getRefId())) {
106 $this->tabs_gui->addTab(
108 $lng->txt(
"cmps_plugins"),
109 $this->ctrl->getLinkTarget($this,
"listPlugins")
113 $this->tabs_gui->addTab(
115 $lng->txt(
"cmps_slots"),
116 $this->ctrl->getLinkTarget($this,
"listSlots")
121 if ($rbacsystem->checkAccess(
'edit_permission', $this->object->getRefId())) {
122 $this->tabs_gui->addTab(
124 $lng->txt(
"perm_settings"),
125 $this->ctrl->getLinkTargetByClass(
'ilpermissiongui',
"perm")
129 if (
$_GET[
"ctype"] ==
"Services") {
130 $this->tabs_gui->activateTab(
"services");
140 $this->ctrl->redirect($this,
"listPlugins");
143 $this->tabs_gui->activateTab(
'slots');
145 include_once(
"./Services/Component/classes/class.ilComponentsTableGUI.php");
148 $this->tpl->setContent($comp_table->getHTML());
159 global
$tpl, $ilTabs;
161 $ilTabs->activateTab(
"plugins");
162 include_once(
"./Services/Component/classes/class.ilPluginsOverviewTableGUI.php");
164 $tpl->setContent(
$table->getHTML());
175 $ilCtrl->redirect($this,
"listPlugins");
178 $ilTabs->clearTargets();
180 $ilTabs->setBackTarget(
181 $lng->txt(
"cmps_slots"),
182 $ilCtrl->getLinkTarget($this,
"listSlots")
185 include_once(
"./Services/Component/classes/class.ilComponent.php");
188 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
193 $ne->
setValue($comp->getComponentType() .
"/" . $comp->getName() .
" [" . $comp->getId() .
"]");
198 $ne->
setValue($comp->getPluginSlotName(
$_GET[
"slot_id"]) .
" [" .
$_GET[
"slot_id"] .
"]");
203 $ne->
setValue($comp->getPluginSlotDirectory(
$_GET[
"slot_id"]) .
"/<Plugin_Name>");
208 $ne->
setValue(
"<" . $lng->txt(
"cmps_main_dir") .
">" .
209 "/classes/class.il<Plugin_Name>Plugin.php");
214 $ne->
setValue(
"<" . $lng->txt(
"cmps_main_dir") .
">" .
215 "/lang/ilias_<Language ID>.lang");
220 $ne->
setValue(
"<" . $lng->txt(
"cmps_main_dir") .
">" .
221 "/sql/dbupdate.php");
226 $ne->
setValue($comp->getPluginSlotLanguagePrefix(
$_GET[
"slot_id"]) .
"<Plugin_ID>_");
231 $ne->
setValue($comp->getPluginSlotLanguagePrefix(
$_GET[
"slot_id"]) .
"<Plugin_ID>_");
234 $form->setTitle($lng->txt(
"cmps_plugin_slot"));
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(
"");
247 if (!
$_GET[
"ctype"] ||
250 !
$_GET[
"plugin_id"]) {
251 $ilCtrl->redirect($this,
"listPlugins");
254 include_once(
"./Services/Component/classes/class.ilPluginSlot.php");
258 foreach ($slot->getPluginsInformation() as $item) {
259 if ($item[
"id"] ==
$_GET[
"plugin_id"]) {
265 $ilCtrl->redirect($this,
"listPlugins");
268 $ilTabs->clearTargets();
269 $ilTabs->setBackTarget(
270 $lng->txt(
"cmps_plugins"),
271 $ilCtrl->getLinkTarget($this,
"listPlugins")
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"]);
281 $plugin[
"name"] .
"/lang");
290 $db_curr = $db_file = null;
291 if (@is_file($file)) {
292 include_once(
"./Services/Component/classes/class.ilPluginDBUpdate.php");
303 $db_curr = $dbupdate->getCurrentVersion();
304 $db_file = $dbupdate->getFileVersion();
308 if ($plugin[
"must_install"]) {
309 $ilToolbar->addButton(
310 $lng->txt(
"cmps_install"),
311 $ilCtrl->getLinkTarget($this,
"installPlugin")
317 $ilToolbar->addButton(
318 $lng->txt(
"cmps_configure"),
323 if (count($langs) > 0) {
324 $ilToolbar->addButton(
325 $lng->txt(
"cmps_refresh"),
326 $ilCtrl->getLinkTarget($this,
"refreshLanguages")
330 if ($plugin[
"activation_possible"]) {
331 $ilToolbar->addButton(
332 $lng->txt(
"cmps_activate"),
333 $ilCtrl->getLinkTarget($this,
"activatePlugin")
338 if ($plugin[
"is_active"]) {
340 $ilToolbar->addButton(
341 $lng->txt(
"cmps_deactivate"),
342 $ilCtrl->getLinkTarget($this,
"deactivatePlugin")
347 if ($plugin[
"needs_update"]) {
348 $ilToolbar->addButton(
349 $lng->txt(
"cmps_update"),
350 $ilCtrl->getLinkTarget($this,
"updatePlugin")
357 if (strlen($plugin[
"responsible"])) {
358 $responsibles = explode(
'/', $plugin[
"responsible_mail"]);
359 foreach ($responsibles as $responsible) {
360 if (!strlen($responsible = trim($responsible))) {
364 $resp[] = $responsible;
367 $resp = $plugin[
"responsible"] .
" (" . implode(
" / ", $resp) .
")";
370 if ($plugin[
"is_active"]) {
371 $status = $lng->txt(
"cmps_active");
373 $r = ($plugin[
"inactive_reason"] !=
"")
374 ?
" (" . $plugin[
"inactive_reason"] .
")" 377 $status = $lng->txt(
"cmps_inactive") .
$r;
380 $info[
""][$lng->txt(
"cmps_name")] = $plugin[
"name"];
381 $info[
""][$lng->txt(
"cmps_id")] = $plugin[
"id"];
382 $info[
""][$lng->txt(
"cmps_version")] = $plugin[
"version"];
384 $info[
""][$lng->txt(
"cmps_responsible")] = $resp;
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;
390 if (
sizeof($langs)) {
391 $lang_files =
array();
392 foreach ($langs as
$lang) {
393 $lang_files[] = $lang[
"file"];
395 $info[
""][$lng->txt(
"cmps_languages")] = implode(
", ", $lang_files);
397 $info[
""][$lng->txt(
"cmps_languages")] = $lng->txt(
"cmps_no_language_file_available");
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"] .
")";
409 $info[$lng->txt(
"cmps_database")][$lng->txt(
"file")] = $lng->txt(
"cmps_no_db_update_file_available");
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;
416 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
418 $form->setTitle($lng->txt(
"cmps_plugin"));
424 $form->addItem($sec);
426 foreach ($items as
$key => $value) {
428 $non->setValue($value);
429 $form->addItem($non);
433 $tpl->setContent(
$form->getHTML());
443 include_once(
"./Services/Component/classes/class.ilPlugin.php");
462 include_once(
"./Services/Component/classes/class.ilPlugin.php");
481 $ilCtrl->setParameter($this,
"ctype",
$_GET[
"ctype"]);
482 $ilCtrl->setParameter($this,
"cname",
$_GET[
"cname"]);
483 $ilCtrl->setParameter($this,
"slot_id",
$_GET[
"slot_id"]);
485 if (
$_GET[
"plugin_id"]) {
486 $ilCtrl->setParameter($this,
"plugin_id",
$_GET[
"plugin_id"]);
487 $ilCtrl->redirect($this,
"showPlugin");
489 $ilCtrl->redirect($this,
"listPlugins");
498 include_once(
"./Services/Component/classes/class.ilPlugin.php");
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"]);
547 include_once(
"./Services/Component/classes/class.ilPlugin.php");
563 $ilCtrl->setParameter($this,
"ctype",
$_GET[
"ctype"]);
564 $ilCtrl->setParameter($this,
"cname",
$_GET[
"cname"]);
565 $ilCtrl->setParameter($this,
"slot_id",
$_GET[
"slot_id"]);
567 if (
$_GET[
"plugin_id"]) {
568 $ilCtrl->setParameter($this,
"plugin_id",
$_GET[
"plugin_id"]);
569 $ilCtrl->redirect($this,
"showPlugin");
571 $ilCtrl->redirect($this,
"listPlugins");
582 include_once(
"./Services/Component/classes/class.ilPlugin.php");
590 $result = $pl->updateLanguages();
596 $ilCtrl->setParameter($this,
"ctype",
$_GET[
"ctype"]);
597 $ilCtrl->setParameter($this,
"cname",
$_GET[
"cname"]);
598 $ilCtrl->setParameter($this,
"slot_id",
$_GET[
"slot_id"]);
600 if (
$_GET[
"plugin_id"]) {
601 $ilCtrl->setParameter($this,
"plugin_id",
$_GET[
"plugin_id"]);
602 $ilCtrl->redirect($this,
"showPlugin");
604 $ilCtrl->redirect($this,
"listPlugins");
612 include_once(
"./Services/Component/classes/class.ilPlugin.php");
620 $pl_meta = $ilPluginAdmin->getAllData(
627 $activation = ((bool) $pl_meta[
"activation_possible"] || (
bool) $pl_meta[
"is_active"]);
628 $reason = $pl_meta[
"inactive_reason"];
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);
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"]);
639 include_once(
"./Services/Utilities/classes/class.ilConfirmationGUI.php");
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");
646 $tpl->setContent($confirmation_gui->getHTML());
653 include_once(
"./Services/Component/classes/class.ilPlugin.php");
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");
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
static getComponentObject($a_ctype, $a_cname)
Get component object.
static getPluginObject($a_ctype, $a_cname, $a_slot_id, $a_pname)
Get plugin object.
__construct($a_data, $a_id, $a_call_by_reference=true, $a_prepare_output=true)
Contructor.
setValue($a_value)
Set Value.
static lookupSlotName($a_ctype, $a_cname, $a_slot_id)
Lookup slot name for component and slot id.
activatePlugin()
Activate a plugin.
executeCommand()
Execute command.
static getConfigureClassName($a_name)
Get plugin configure class name.
showPluginSlotInfo()
Show information about a plugin slot.
deactivatePlugin()
Deactivate a plugin.
prepareOutput($a_show_subobjects=true)
prepare output
if(isset($_POST['submit'])) $form
update(ilPlugin $plugin)
Execute update and ctrl reload.
Class ilObjectGUI Basic methods of all Output classes.
static getPluginObject($a_ctype, $a_cname, $a_slot_id, $a_pname)
Get Plugin Object.
Create styles array
The data for the language used.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
TableGUI class for components listing.
static getDBUpdateScriptName($a_ctype, $a_cname, $a_slot_name, $a_pname)
Get DB update script filename (full path)
refreshLanguages()
Refresh Languages.
This class represents a non editable value in a property form.
TableGUI class for components listing.
Components (Modules, Services, Plugins) Settings.
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.
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
if(!file_exists("$old.txt")) if($old===$new) if(file_exists("$new.txt")) $file
if(empty($password)) $table
static redirect($a_script)
listSlots()
List Services.
listPlugins()
List plugins.
updatePlugin()
Update a plugin.
Confirmation screen class.
installPlugin()
Install a plugin.