19 require_once(
"classes/class.ilObjectGUI.php");
20 require_once(
"./Modules/HTMLLearningModule/classes/class.ilObjFileBasedLM.php");
21 require_once(
"./Services/Table/classes/class.ilTableGUI.php");
22 require_once(
"classes/class.ilFileSystemGUI.php");
38 $this->ctrl->saveParameter($this, array(
"ref_id"));
41 $lng->loadLanguageModule(
"content");
45 $this->output_prepared = $a_prepare_output;
54 global $ilUser, $ilLocator, $ilTabs;
56 $next_class = $this->ctrl->getNextClass($this);
57 $cmd = $this->ctrl->getCmd();
59 if (strtolower(
$_GET[
"baseClass"]) ==
"iladministrationgui" ||
66 if (!in_array(
$cmd, array(
"",
"framset")) || $next_class !=
"")
77 if(IS_PAYMENT_ENABLED)
79 include_once
'Services/Payment/classes/class.ilPaymentObject.php';
83 $this->tpl->getStandardTemplate();
85 include_once
'Services/Payment/classes/class.ilShopPurchaseGUI.php';
87 $ret = $this->ctrl->forwardCommand($pp);
97 $ilTabs->activateTab(
'id_meta_data');
98 include_once
'Services/MetaData/classes/class.ilMDEditorGUI.php';
100 $md_gui =&
new ilMDEditorGUI($this->object->getId(), 0, $this->
object->getType());
101 $md_gui->
addObserver($this->
object,
'MDUpdateListener',
'General');
103 $this->ctrl->forwardCommand($md_gui);
106 case "ilfilesystemgui":
108 $ilTabs->activateTab(
'id_list_files');
111 $fs_gui->setTableId(
"htlmfs".$this->object->getId());
112 if ($this->object->getStartFile() !=
"")
114 $fs_gui->labelFile($this->object->getStartFile(),
115 $this->lng->txt(
"cont_startfile"));
117 $fs_gui->addCommand($this,
"setStartFile", $this->lng->txt(
"cont_set_start_file"));
118 $ret =& $this->ctrl->forwardCommand($fs_gui);
121 case "ilinfoscreengui":
125 case "illearningprogressgui":
126 $ilTabs->activateTab(
'id_learning_progress');
127 include_once
'./Services/Tracking/classes/class.ilLearningProgressGUI.php';
129 $this->object->getRefId(),
130 $_GET[
'user_id'] ?
$_GET[
'user_id'] : $ilUser->getId());
131 $this->ctrl->forwardCommand($new_gui);
134 case 'ilpermissiongui':
135 $ilTabs->activateTab(
'id_permissions');
136 include_once(
"Services/AccessControl/classes/class.ilPermissionGUI.php");
138 $ret =& $this->ctrl->forwardCommand($perm_gui);
142 $ilTabs->activateTab(
'id_license');
143 include_once(
"./Services/License/classes/class.ilLicenseGUI.php");
145 $ret =& $this->ctrl->forwardCommand($license_gui);
149 $ilTabs->activateTab(
"export");
150 include_once(
"./Services/Export/classes/class.ilExportGUI.php");
152 $exp_gui->addFormat(
"xml");
153 $exp_gui->addFormat(
"html",
"", $this,
"exportHTML");
154 $ret = $this->ctrl->forwardCommand($exp_gui);
160 $cmd = $this->ctrl->getCmd(
"frameset");
161 if (strtolower(
$_GET[
"baseClass"]) ==
"iladministrationgui" ||
178 global $rbacsystem,
$tpl;
182 if (!$rbacsystem->checkAccess(
"create",
$_GET[
"ref_id"], $new_type))
184 $this->ilias->raiseError($this->lng->txt(
"permission_denied"),$this->ilias->error_obj->MESSAGE);
188 $this->ctrl->setParameter($this,
"new_type", $new_type);
190 $html = $this->form->getHTML();
193 $html2 = $this->form->getHTML();
195 $tpl->setContent($html.
"<br/>".$html2.$clone_html);
208 $lng->loadLanguageModule(
"content");
210 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
212 $this->form->setTarget(
"_top");
215 include_once(
"./Services/Form/classes/class.ilFileInputGUI.php");
218 $fi->setRequired(
true);
219 $this->form->addItem($fi);
221 $this->form->addCommandButton(
"importFile", $lng->txt(
"import"));
222 $this->form->addCommandButton(
"cancel", $lng->txt(
"cancel"));
223 $this->form->setTitle($lng->txt($a_new_type.
"_import"));
225 $this->form->setFormAction($ilCtrl->getFormAction($this));
240 if (!$rbacsystem->checkAccess(
"create",
$_GET[
"ref_id"], $new_type))
242 $this->ilias->raiseError($this->lng->txt(
"no_create_permission"), $this->ilias->error_obj->MESSAGE);
244 $this->ctrl->setParameter($this,
"new_type", $new_type);
246 if ($this->form->checkInput())
249 include_once(
"./Services/Export/classes/class.ilImport.php");
251 $new_id = $imp->importObject($newObj, $_FILES[
"importfile"][
"tmp_name"],
252 $_FILES[
"importfile"][
"name"], $new_type);
258 $newObj->createReference();
259 $newObj->putInTree($_GET[
"ref_id"]);
260 $newObj->setPermissions($_GET[
"ref_id"]);
267 $this->form->setValuesByPost();
268 $tpl->setContent($this->form->getHtml());
283 if (!$rbacsystem->checkAccess(
"create",
$_GET[
"ref_id"], $new_type))
285 $this->ilias->raiseError($this->lng->txt(
"no_create_permission"), $this->ilias->error_obj->MESSAGE);
287 $this->ctrl->setParameter($this,
"new_type", $new_type);
289 if ($this->form->checkInput())
292 $location = $objDefinition->getLocation($new_type);
295 $class_name =
"ilObj".$objDefinition->getClassName($new_type);
296 include_once(
$location.
"/class.".$class_name.
".php");
297 $newObj =
new $class_name();
298 $newObj->setType($new_type);
302 $newObj->createReference();
303 $newObj->putInTree(
$_GET[
"ref_id"]);
304 $newObj->setPermissions(
$_GET[
"ref_id"]);
310 $this->form->setValuesByPost();
311 $tpl->setContent($this->form->getHtml());
323 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
325 $this->form->setTarget(
"_top");
331 $ti->setRequired(
true);
332 $this->form->addItem($ti);
338 $this->form->addItem($ta);
341 if ($a_mode ==
"create")
343 $this->form->addCommandButton(
"save", $lng->txt($a_new_type.
"_add"));
344 $this->form->addCommandButton(
"cancelCreation", $lng->txt(
"cancel"));
345 $this->form->setTitle($lng->txt($a_new_type.
"_new"));
349 $this->form->addCommandButton(
"update", $lng->txt(
"save"));
350 $this->form->addCommandButton(
"cancelUpdate", $lng->txt(
"cancel"));
351 $this->form->setTitle($lng->txt(
"edit"));
354 $this->form->setFormAction($ilCtrl->getFormAction($this));
363 $values[
"title"] = $this->
object->getTitle();
364 $values[
"desc"] = $this->
object->getDescription();
365 $this->form->setValuesByArray($values);
385 global $rbacsystem,
$tree,
$tpl, $ilTabs;
387 $ilTabs->activateTab(
"id_settings");
391 $tpl->setContent($this->form->getHTML());
402 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
409 $this->form->addItem($cb);
412 require_once(
"./Modules/HTMLLearningModule/classes/class.ilObjFileBasedLMAccess.php");
416 if ($startfile !=
"")
418 $ne->
setValue(basename($startfile));
422 $ne->setValue(basename($this->lng->txt(
"no_start_file")));
425 $this->form->addItem($ne);
427 $this->form->addCommandButton(
"saveProperties", $lng->txt(
"save"));
428 $this->form->addCommandButton(
"toFilesystem", $lng->txt(
"cont_set_start_file"));
430 $this->form->setTitle($lng->txt(
"cont_lm_properties"));
431 $this->form->setFormAction($ilCtrl->getFormAction($this,
"saveProperties"));
439 require_once(
"./Modules/HTMLLearningModule/classes/class.ilObjFileBasedLMAccess.php");
443 $values[
"cobj_online"] = $this->
object->getOnline();
444 if ($startfile !=
"")
446 $startfile = basename($startfile);
450 $startfile = $this->lng->txt(
"no_start_file");
453 $values[
"cobj_online"] = $this->
object->getOnline();
454 $values[
"startfile"] = $startfile;
456 $this->form->setValuesByArray($values);
469 $ilCtrl->redirectByClass(
"ilfilesystemgui",
"listFiles");
480 if ($this->form->checkInput())
483 $this->
object->update();
485 $this->ctrl->redirect($this,
"properties");
488 $this->form->setValuesByPost();
489 $tpl->setContent($this->form->getHtml());
501 if (!$rbacsystem->checkAccess(
"visible,write",$this->object->getRefId()))
503 $this->ilias->raiseError($this->lng->txt(
"permission_denied"),$this->ilias->error_obj->MESSAGE);
507 $this->tpl->addBlockfile(
"BUTTONS",
"buttons",
"tpl.buttons.html");
538 ilUtil::redirect(
"ilias.php?baseClass=ilHTLMEditorGUI&ref_id=".$newObj->getRefId());
566 $this->
object->setStartFile($a_file);
567 $this->
object->update();
568 $this->ctrl->redirectByClass(
"ilfilesystemgui",
"listFiles");
576 $this->
setFormAction(
"permSave",
"fblm_edit.php?cmd=permSave&ref_id=".
$_GET[
"ref_id"].
577 "&obj_id=".
$_GET[
"obj_id"]);
578 $this->
setFormAction(
"addRole",
"fblm_edit.php?ref_id=".$_GET[
"ref_id"].
579 "&obj_id=".$_GET[
"obj_id"].
"&cmd=addRole");
590 $ilTabs->activateTab(
"id_bib_data");
592 include_once
"./Modules/LearningModule/classes/class.ilBibItemGUI.php";
594 $bib_gui->setObject($this->
object);
595 $bibItemIndex =
$_POST[
"bibItemIndex"] ?
$_POST[
"bibItemIndex"] :
$_GET[
"bibItemIndex"];
597 if ($bibItemIndex < 0)
601 $bibItemIndex = $bib_gui->save($bibItemIndex);
605 $a_target =
"adm_object.php?ref_id=" . $this->
object->getRefId();
608 $bib_gui->edit(
"ADM_CONTENT",
"adm_content", $a_target, $bibItemIndex);
630 $ilTabs->activateTab(
"id_bib_data");
632 include_once
"./Modules/LearningModule/classes/class.ilBibItemGUI.php";
634 $bib_gui->setObject($this->
object);
635 $bibItemIndex =
$_POST[
"bibItemIndex"] ?
$_POST[
"bibItemIndex"] :
$_GET[
"bibItemIndex"];
637 if ($bibItemIndex < 0)
643 $a_target =
"adm_object.php?ref_id=" . $this->
object->getRefId();
646 $bib_gui->edit(
"ADM_CONTENT",
"adm_content", $a_target, $bibItemIndex);
668 $ilTabs->activateTab(
"id_bib_data");
670 include_once
"./Modules/LearningModule/classes/class.ilBibItemGUI.php";
672 $bib_gui->setObject($this->
object);
673 $bibItemIndex =
$_POST[
"bibItemIndex"] ?
$_POST[
"bibItemIndex"] :
$_GET[
"bibItemIndex"];
674 $bib_gui->bib_obj->delete(
$_GET[
"bibItemName"],
$_GET[
"bibItemPath"], $bibItemIndex);
675 if (strpos($bibItemIndex,
",") > 0)
677 $bibItemIndex = substr($bibItemIndex, 0, strpos($bibItemIndex,
","));
681 $a_target =
"adm_object.php?ref_id=" . $this->
object->getRefId();
684 $bib_gui->edit(
"ADM_CONTENT",
"adm_content", $a_target, $bibItemIndex);
706 $ilTabs->activateTab(
"id_bib_data");
708 $bibItemName =
$_POST[
"bibItemName"] ?
$_POST[
"bibItemName"] :
$_GET[
"bibItemName"];
709 $bibItemIndex =
$_POST[
"bibItemIndex"] ?
$_POST[
"bibItemIndex"] :
$_GET[
"bibItemIndex"];
710 if ($bibItemName ==
"BibItem")
712 include_once
"./Modules/LearningModule/classes/class.ilBibItem.php";
714 $bib_item->setId($this->object->getId());
715 $bib_item->setType($this->object->getType());
719 include_once
"./Modules/LearningModule/classes/class.ilBibItemGUI.php";
721 $bib_gui->setObject($this->
object);
722 if ($bibItemIndex ==
"")
724 $bibItemPath =
$_POST[
"bibItemPath"] ?
$_POST[
"bibItemPath"] :
$_GET[
"bibItemPath"];
727 if ($bibItemName !=
"")
729 $bib_gui->bib_obj->add($bibItemName, $bibItemPath, $bibItemIndex);
730 $data = $bib_gui->bib_obj->getElement(
"BibItem");
731 $bibItemIndex = (count(
$data) - 1);
739 $a_target =
"adm_object.php?ref_id=" . $this->
object->getRefId();
742 $bib_gui->edit(
"ADM_CONTENT",
"adm_content", $a_target, $bibItemIndex);
766 $ilCtrl->setCmdClass(
"ilfilesystemgui");
767 $ilCtrl->setCmd(
"listFiles");
783 $this->tpl =
new ilTemplate(
"tpl.main.html",
true,
true);
787 $this->tpl->addBlockFile(
"CONTENT",
"content",
"tpl.explorer.html");
789 require_once (
"./Modules/HTMLLearningModule/classes/class.ilFileExplorer.php");
801 $this->tpl->addBlockFile(
"CONTENT",
"content",
"tpl.adm_content.html");
803 $this->tpl->addBlockFile(
"STATUSLINE",
"statusline",
"tpl.statusline.html");
810 include_once
"Services/License/classes/class.ilLicense.php";
812 $this->
object->getRefId());
815 include_once
"Services/Tracking/classes/class.ilTracking.php";
818 require_once(
"./Modules/HTMLLearningModule/classes/class.ilObjFileBasedLMAccess.php");
820 if ($startfile !=
"")
834 $this->ctrl->setCmd(
"showSummary");
835 $this->ctrl->setCmdClass(
"ilinfoscreengui");
852 global
$ilBench, $ilLocator, $ilAccess, $ilTabs;
854 $ilTabs->activateTab(
'id_info');
856 $this->lng->loadLanguageModule(
"meta");
857 include_once(
"./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
860 $info->enablePrivateNotes();
861 $info->enableLearningProgress();
864 if ($ilAccess->checkAccess(
"write",
"",
$_GET[
"ref_id"]))
866 $info->enableNewsEditing();
869 $enable_internal_rss = $news_set->get(
"enable_rss_for_internal");
870 if ($enable_internal_rss)
872 $info->setBlockProperty(
"news",
"settings",
true);
877 if ($ilAccess->checkAccess(
"read",
"",
$_GET[
"ref_id"]))
879 $info->addButton($this->lng->txt(
"view"),
880 "ilias.php?baseClass=ilHTLMPresentationGUI&ref_id=".$this->object->getRefID(),
881 ' target="ilContObj'.$this->object->getId().
'" ');
885 $info->addMetaDataSections($this->object->getId(),0, $this->
object->getType());
888 $this->ctrl->forwardCommand($info);
898 $this->tpl->setCurrentBlock(
"header_image");
900 $this->tpl->parseCurrentBlock();
903 $this->tpl->setVariable(
"HEADER", $this->object->getTitle());
911 global $ilUser, $ilAccess, $ilTabs,
$lng;
913 if($ilAccess->checkAccess(
'write',
'', $this->ref_id))
915 $ilTabs->addTab(
"id_list_files",
916 $lng->txt(
"cont_list_files"),
917 $this->ctrl->getLinkTargetByClass(
"ilfilesystemgui",
"listFiles"));
919 $ilTabs->addTab(
"id_info",
920 $lng->txt(
"info_short"),
921 $this->ctrl->getLinkTargetByClass(array(
"ilobjfilebasedlmgui",
"ilinfoscreengui"),
"showSummary"));
923 $ilTabs->addTab(
"id_settings",
924 $lng->txt(
"settings"),
925 $this->ctrl->getLinkTarget($this,
"properties"));
928 include_once
'./Services/Tracking/classes/class.ilLearningProgressAccess.php';
931 $ilTabs->addTab(
"id_learning_progress",
932 $lng->txt(
"learning_progress"),
933 $this->ctrl->getLinkTargetByClass(array(
'ilobjfilebasedlmgui',
'illearningprogressgui'),
''));
936 include_once(
"Services/License/classes/class.ilLicenseAccess.php");
937 if ($ilAccess->checkAccess(
'edit_permission',
'', $this->ref_id)
940 $ilTabs->addTab(
"id_license",
941 $lng->txt(
"license"),
942 $this->ctrl->getLinkTargetByClass(
'illicensegui',
''));
945 if($ilAccess->checkAccess(
'write',
'', $this->ref_id))
947 $ilTabs->addTab(
"id_meta_data",
948 $lng->txt(
"meta_data"),
949 $this->ctrl->getLinkTargetByClass(
'ilmdeditorgui',
''));
951 $ilTabs->addTab(
"id_bib_data",
952 $lng->txt(
"bib_data"),
953 $this->ctrl->getLinkTarget($this,
"editBibItem"));
958 if ($ilAccess->checkAccess(
"write",
"", $this->object->getRefId()))
960 $ilTabs->addTab(
"export",
962 $this->ctrl->getLinkTargetByClass(
"ilexportgui",
""));
965 if ($ilAccess->checkAccess(
'edit_permission',
'', $this->object->getRefId()))
967 $ilTabs->addTab(
"id_permissions",
968 $lng->txt(
"perm_settings"),
969 $this->ctrl->getLinkTargetByClass(array(get_class($this),
'ilpermissiongui'),
"perm"));
972 require_once(
"./Modules/HTMLLearningModule/classes/class.ilObjFileBasedLMAccess.php");
975 if ($startfile !=
"")
977 $ilTabs->addNonTabbedLink(
"presentation_view",
978 $this->lng->txt(
"glo_presentation_view"),
979 "ilias.php?baseClass=ilHTLMPresentationGUI&ref_id=".$this->object->getRefID(),
995 if ($ilAccess->checkAccess(
"visible",
"", $a_target))
997 $_GET[
"ref_id"] = $a_target;
998 $_GET[
"cmd"] =
"infoScreen";
999 include(
"repository.php");
1002 else if ($ilAccess->checkAccess(
"read",
"", ROOT_FOLDER_ID))
1004 $_GET[
"cmd"] =
"frameset";
1005 $_GET[
"target"] =
"";
1006 $_GET[
"ref_id"] = ROOT_FOLDER_ID;
1009 include(
"repository.php");
1013 $ilErr->raiseError($lng->txt(
"msg_no_perm_read_lm"), $ilErr->FATAL);
1020 if (is_object($this->
object))
1022 $ilLocator->addItem($this->object->getTitle(),
1023 $this->ctrl->getLinkTargetByClass(
"ilinfoscreengui",
"showSummary"),
"",
$_GET[
"ref_id"]);
1038 $inst_id = IL_INST_ID;
1040 include_once(
"./Services/Export/classes/class.ilExport.php");
1042 $this->
object->getType());
1044 $subdir = $this->
object->getType().
"_".$this->
object->getId();
1047 $target_dir = $export_dir.
"/".$subdir;
1052 $source_dir = $this->
object->getDataDirectory();
1058 $zip_file = $export_dir.
"/".$date.
"__".IL_INST_ID.
"__".
1059 $this->
object->getType().
"_".$this->
object->getId().
".zip";