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)
29 $this->lng->loadLanguageModule(
'cmps');
42 $next_class = $this->ctrl->getNextClass($this);
43 $cmd = $this->ctrl->getCmd();
47 if(!$ilAccess->checkAccess(
'read',
'',$this->object->getRefId()))
49 $ilErr->raiseError($this->lng->txt(
'no_permission'),$ilErr->WARNING);
54 case 'ilpermissiongui':
55 $this->tabs_gui->setTabActive(
'perm_settings');
56 include_once(
"Services/AccessControl/classes/class.ilPermissionGUI.php");
58 $ret =& $this->ctrl->forwardCommand($perm_gui);
65 if (substr(strtolower($next_class), strlen($next_class) - 9) ==
"configgui")
67 $path = $ilCtrl->lookupClassPath(strtolower($next_class));
71 $nc =
new $next_class();
76 $nc->setPluginObject($pl);
78 $ret = $this->ctrl->forwardCommand($nc);
105 global $rbacsystem, $ilAccess,
$lng;
107 if ($rbacsystem->checkAccess(
"visible,read",$this->object->getRefId()))
109 $this->tabs_gui->addTab(
"plugins",
110 $lng->txt(
"cmps_plugins"),
111 $this->ctrl->getLinkTarget($this,
"listPlugins"));
115 $this->tabs_gui->addTab(
"slots",
116 $lng->txt(
"cmps_slots"),
117 $this->ctrl->getLinkTarget($this,
"listSlots"));
121 if ($rbacsystem->checkAccess(
'edit_permission',$this->object->getRefId()))
123 $this->tabs_gui->addTab(
"perm_settings",
124 $lng->txt(
"perm_settings"),
125 $this->ctrl->getLinkTargetByClass(
'ilpermissiongui',
"perm"));
128 if (
$_GET[
"ctype"] ==
"Services")
130 $this->tabs_gui->activateTab(
"services");
141 $this->ctrl->redirect($this,
"listPlugins");
144 $this->tabs_gui->activateTab(
'slots');
146 include_once(
"./Services/Component/classes/class.ilComponentsTableGUI.php");
149 $this->tpl->setContent($comp_table->getHTML());
160 global
$tpl, $ilTabs;
162 $ilTabs->activateTab(
"plugins");
163 include_once(
"./Services/Component/classes/class.ilPluginsOverviewTableGUI.php");
165 $tpl->setContent($table->getHTML());
177 $ilCtrl->redirect($this,
"listPlugins");
180 $ilTabs->clearTargets();
182 $ilTabs->setBackTarget($lng->txt(
"cmps_slots"),
183 $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().
"]");
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"] ||
252 $ilCtrl->redirect($this,
"listPlugins");
255 include_once(
"./Services/Component/classes/class.ilPluginSlot.php");
259 foreach($slot->getPluginsInformation() as $item)
261 if($item[
"id"] ==
$_GET[
"plugin_id"])
269 $ilCtrl->redirect($this,
"listPlugins");
272 $ilTabs->clearTargets();
273 $ilTabs->setBackTarget($lng->txt(
"cmps_plugins"),
274 $ilCtrl->getLinkTarget($this,
"listPlugins"));
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"]);
283 $plugin[
"name"].
"/lang");
289 $db_curr = $db_file = null;
292 include_once(
"./Services/Component/classes/class.ilPluginDBUpdate.php");
294 $_GET[
"slot_id"], $plugin[
"name"], $ilDB,
true,
"");
296 $db_curr = $dbupdate->getCurrentVersion();
297 $db_file = $dbupdate->getFileVersion();
310 if ($plugin[
"activation_possible"])
312 $ilToolbar->addButton($lng->txt(
"cmps_activate"),
313 $ilCtrl->getLinkTarget($this,
"activatePlugin"));
317 if ($plugin[
"is_active"])
320 if (count($langs) > 0)
322 $ilToolbar->addButton($lng->txt(
"cmps_refresh"),
323 $ilCtrl->getLinkTarget($this,
"refreshLanguages"));
330 $ilToolbar->addButton($lng->txt(
"cmps_configure"),
335 $ilToolbar->addButton($lng->txt(
"cmps_deactivate"),
336 $ilCtrl->getLinkTarget($this,
"deactivatePlugin"));
340 if ($plugin[
"needs_update"])
342 $ilToolbar->addButton($lng->txt(
"cmps_update"),
343 $ilCtrl->getLinkTarget($this,
"updatePlugin"));
350 if (strlen($plugin[
"responsible"]))
352 $responsibles = explode(
'/', $plugin[
"responsible_mail"]);
353 foreach($responsibles as $responsible)
355 if(!strlen($responsible = trim($responsible)))
360 $resp[] = $responsible;
363 $resp = $plugin[
"responsible"].
" (".implode(
" / ", $resp).
")";
366 if ($plugin[
"is_active"])
368 $status = $lng->txt(
"cmps_active");
372 $r = ($status[
"inactive_reason"] !=
"")
373 ?
" (".$status[
"inactive_reason"].
")"
376 $status = $lng->txt(
"cmps_inactive").$r;
379 $info[
""][$lng->txt(
"cmps_name")] = $plugin[
"name"];
380 $info[
""][$lng->txt(
"cmps_id")] = $plugin[
"id"];
381 $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;
392 $lang_files = array();
393 foreach($langs as
$lang)
395 $lang_files[] = $lang[
"file"];
397 $info[
""][$lng->txt(
"cmps_languages")] = implode(
", ", $lang_files);
401 $info[
""][$lng->txt(
"cmps_languages")] = $lng->txt(
"cmps_no_language_file_available");
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"].
")";
414 $info[$lng->txt(
"cmps_database")][$lng->txt(
"file")] = $lng->txt(
"cmps_no_db_update_file_available");
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;
423 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
425 $form->setTitle($lng->txt(
"cmps_plugin"));
427 foreach($info as
$section => $items)
433 $form->addItem($sec);
435 foreach($items as $key => $value)
438 $non->setValue($value);
439 $form->addItem($non);
443 $tpl->setContent($form->getHTML());
453 die (
"ilObjComponentSettigsGUI::refreshPluginsInformation: deprecated");
455 include_once(
"./Services/Component/classes/class.ilPlugin.php");
456 ilPlugin::refreshPluginXmlInformation();
460 $ilCtrl->redirect($this,
"listServices");
464 $ilCtrl->redirect($this,
"listModules");
475 include_once(
"./Services/Component/classes/class.ilPlugin.php");
496 $ilCtrl->setParameter($this,
"ctype",
$_GET[
"ctype"]);
497 $ilCtrl->setParameter($this,
"cname",
$_GET[
"cname"]);
498 $ilCtrl->setParameter($this,
"slot_id",
$_GET[
"slot_id"]);
500 if(
$_GET[
"plugin_id"])
502 $ilCtrl->setParameter($this,
"plugin_id",
$_GET[
"plugin_id"]);
503 $ilCtrl->redirect($this,
"showPlugin");
507 $ilCtrl->redirect($this,
"listPlugins");
516 include_once(
"./Services/Component/classes/class.ilPlugin.php");
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");
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"]);
554 include_once(
"./Services/Component/classes/class.ilPlugin.php");
569 $ilCtrl->setParameter($this,
"ctype",
$_GET[
"ctype"]);
570 $ilCtrl->setParameter($this,
"cname",
$_GET[
"cname"]);
571 $ilCtrl->setParameter($this,
"slot_id",
$_GET[
"slot_id"]);
573 if(
$_GET[
"plugin_id"])
575 $ilCtrl->setParameter($this,
"plugin_id",
$_GET[
"plugin_id"]);
576 $ilCtrl->redirect($this,
"showPlugin");
580 $ilCtrl->redirect($this,
"listPlugins");
591 include_once(
"./Services/Component/classes/class.ilPlugin.php");
595 $result = $pl->updateLanguages();
602 $ilCtrl->setParameter($this,
"ctype",
$_GET[
"ctype"]);
603 $ilCtrl->setParameter($this,
"cname",
$_GET[
"cname"]);
604 $ilCtrl->setParameter($this,
"slot_id",
$_GET[
"slot_id"]);
606 if(
$_GET[
"plugin_id"])
608 $ilCtrl->setParameter($this,
"plugin_id",
$_GET[
"plugin_id"]);
609 $ilCtrl->redirect($this,
"showPlugin");
613 $ilCtrl->redirect($this,
"listPlugins");
624 die (
"ilObjComponentSettigsGUI::updatePluginDB: deprecated");
626 include_once(
"./Services/Component/classes/class.ilPluginDBUpdate.php");
628 $_GET[
"slot_id"],
$_GET[
"pname"], $ilDB,
true);
630 $dbupdate->applyUpdate();
632 if ($dbupdate->updateMsg ==
"no_changes")
634 $message = $this->lng->txt(
"no_changes").
". ".$this->lng->txt(
"database_is_uptodate");
638 foreach ($dbupdate->updateMsg as
$row)
640 $message .= $this->lng->txt($row[
"msg"]).
": ".$row[
"nr"].
"<br/>";
648 $ilCtrl->setParameter($this,
"slot_id",
$_GET[
"slot_id"]);
649 $ilCtrl->redirect($this,
"listPlugins");