19 require_once(
"./Services/Object/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(
"./Services/FileSystem/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';
82 $this->tpl->getStandardTemplate();
84 include_once
'Services/Payment/classes/class.ilShopPurchaseGUI.php';
86 $ret = $this->ctrl->forwardCommand($pp);
96 $ilTabs->activateTab(
'id_meta_data');
97 include_once
'Services/MetaData/classes/class.ilMDEditorGUI.php';
99 $md_gui =&
new ilMDEditorGUI($this->object->getId(), 0, $this->
object->getType());
100 $md_gui->
addObserver($this->
object,
'MDUpdateListener',
'General');
102 $this->ctrl->forwardCommand($md_gui);
105 case "ilfilesystemgui":
107 $ilTabs->activateTab(
'id_list_files');
110 $fs_gui->setTableId(
"htlmfs".$this->object->getId());
111 if ($this->object->getStartFile() !=
"")
113 $fs_gui->labelFile($this->object->getStartFile(),
114 $this->lng->txt(
"cont_startfile"));
116 $fs_gui->addCommand($this,
"setStartFile", $this->lng->txt(
"cont_set_start_file"));
117 $ret =& $this->ctrl->forwardCommand($fs_gui);
120 case "ilinfoscreengui":
124 case "illearningprogressgui":
125 $ilTabs->activateTab(
'id_learning_progress');
126 include_once
'./Services/Tracking/classes/class.ilLearningProgressGUI.php';
128 $this->object->getRefId(),
129 $_GET[
'user_id'] ?
$_GET[
'user_id'] : $ilUser->getId());
130 $this->ctrl->forwardCommand($new_gui);
133 case 'ilpermissiongui':
134 $ilTabs->activateTab(
'id_permissions');
135 include_once(
"Services/AccessControl/classes/class.ilPermissionGUI.php");
137 $ret =& $this->ctrl->forwardCommand($perm_gui);
141 $ilTabs->activateTab(
'id_license');
142 include_once(
"./Services/License/classes/class.ilLicenseGUI.php");
144 $ret =& $this->ctrl->forwardCommand($license_gui);
148 $ilTabs->activateTab(
"export");
149 include_once(
"./Services/Export/classes/class.ilExportGUI.php");
151 $exp_gui->addFormat(
"xml");
152 $exp_gui->addFormat(
"html",
"", $this,
"exportHTML");
153 $ret = $this->ctrl->forwardCommand($exp_gui);
157 case "ilcommonactiondispatchergui":
158 include_once(
"Services/Object/classes/class.ilCommonActionDispatcherGUI.php");
160 $this->ctrl->forwardCommand($gui);
164 $cmd = $this->ctrl->getCmd(
"frameset");
165 if (strtolower(
$_GET[
"baseClass"]) ==
"iladministrationgui" ||
179 $forms = array(self::CFORM_NEW => $this->
initCreateForm($a_new_type),
194 $ilCtrl->redirectByClass(
"ilrepositorygui",
"frameset");
204 global $rbacsystem,
$tree,
$tpl, $ilTabs;
206 $ilTabs->activateTab(
"id_settings");
210 $tpl->setContent($this->form->getHTML());
220 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
227 $ti->setRequired(
true);
228 $this->form->addItem($ti);
234 $this->form->addItem($ta);
240 $this->form->addItem($cb);
243 require_once(
"./Modules/HTMLLearningModule/classes/class.ilObjFileBasedLMAccess.php");
247 if ($startfile !=
"")
249 $ne->
setValue(basename($startfile));
253 $ne->setValue(basename($this->lng->txt(
"no_start_file")));
255 $this->form->addItem($ne);
257 $this->form->addCommandButton(
"saveProperties", $lng->txt(
"save"));
258 $this->form->addCommandButton(
"toFilesystem", $lng->txt(
"cont_set_start_file"));
260 $this->form->setTitle($lng->txt(
"cont_lm_properties"));
261 $this->form->setFormAction($ilCtrl->getFormAction($this,
"saveProperties"));
269 require_once(
"./Modules/HTMLLearningModule/classes/class.ilObjFileBasedLMAccess.php");
273 $values[
"cobj_online"] = $this->
object->getOnline();
274 if ($startfile !=
"")
276 $startfile = basename($startfile);
280 $startfile = $this->lng->txt(
"no_start_file");
283 $values[
"cobj_online"] = $this->
object->getOnline();
284 $values[
"startfile"] = $startfile;
285 $values[
"title"] = $this->
object->getTitle();
286 $values[
"desc"] = $this->
object->getDescription();
288 $this->form->setValuesByArray($values);
301 $ilCtrl->redirectByClass(
"ilfilesystemgui",
"listFiles");
312 if ($this->form->checkInput())
314 $this->
object->setTitle($this->form->getInput(
"title"));
315 $this->
object->setDescription($this->form->getInput(
"desc"));
317 $this->
object->update();
319 $this->ctrl->redirect($this,
"properties");
322 $ilTabs->activateTab(
"id_settings");
323 $this->form->setValuesByPost();
324 $tpl->setContent($this->form->getHtml());
336 if (!$rbacsystem->checkAccess(
"visible,write",$this->object->getRefId()))
338 $this->ilias->raiseError($this->lng->txt(
"permission_denied"),$this->ilias->error_obj->MESSAGE);
342 $this->tpl->addBlockfile(
"BUTTONS",
"buttons",
"tpl.buttons.html");
372 ilUtil::redirect(
"ilias.php?baseClass=ilHTLMEditorGUI&ref_id=".$newObj->getRefId());
389 $this->
object->setStartFile($a_file);
390 $this->
object->update();
391 $this->ctrl->redirectByClass(
"ilfilesystemgui",
"listFiles");
399 $this->
setFormAction(
"permSave",
"fblm_edit.php?cmd=permSave&ref_id=".
$_GET[
"ref_id"].
400 "&obj_id=".
$_GET[
"obj_id"]);
401 $this->
setFormAction(
"addRole",
"fblm_edit.php?ref_id=".$_GET[
"ref_id"].
402 "&obj_id=".$_GET[
"obj_id"].
"&cmd=addRole");
413 $ilTabs->activateTab(
"id_bib_data");
415 include_once
"./Modules/LearningModule/classes/class.ilBibItemGUI.php";
417 $bib_gui->setObject($this->
object);
418 $bibItemIndex =
$_POST[
"bibItemIndex"] ?
$_POST[
"bibItemIndex"] :
$_GET[
"bibItemIndex"];
420 if ($bibItemIndex < 0)
424 $bibItemIndex = $bib_gui->save($bibItemIndex);
428 $a_target =
"adm_object.php?ref_id=" . $this->
object->getRefId();
431 $bib_gui->edit(
"ADM_CONTENT",
"adm_content", $a_target, $bibItemIndex);
453 $ilTabs->activateTab(
"id_bib_data");
455 include_once
"./Modules/LearningModule/classes/class.ilBibItemGUI.php";
457 $bib_gui->setObject($this->
object);
458 $bibItemIndex =
$_POST[
"bibItemIndex"] ?
$_POST[
"bibItemIndex"] :
$_GET[
"bibItemIndex"];
460 if ($bibItemIndex < 0)
466 $a_target =
"adm_object.php?ref_id=" . $this->
object->getRefId();
469 $bib_gui->edit(
"ADM_CONTENT",
"adm_content", $a_target, $bibItemIndex);
491 $ilTabs->activateTab(
"id_bib_data");
493 include_once
"./Modules/LearningModule/classes/class.ilBibItemGUI.php";
495 $bib_gui->setObject($this->
object);
496 $bibItemIndex =
$_POST[
"bibItemIndex"] ?
$_POST[
"bibItemIndex"] :
$_GET[
"bibItemIndex"];
497 $bib_gui->bib_obj->delete(
$_GET[
"bibItemName"],
$_GET[
"bibItemPath"], $bibItemIndex);
498 if (strpos($bibItemIndex,
",") > 0)
500 $bibItemIndex = substr($bibItemIndex, 0, strpos($bibItemIndex,
","));
504 $a_target =
"adm_object.php?ref_id=" . $this->
object->getRefId();
507 $bib_gui->edit(
"ADM_CONTENT",
"adm_content", $a_target, $bibItemIndex);
529 $ilTabs->activateTab(
"id_bib_data");
531 $bibItemName =
$_POST[
"bibItemName"] ?
$_POST[
"bibItemName"] :
$_GET[
"bibItemName"];
532 $bibItemIndex =
$_POST[
"bibItemIndex"] ?
$_POST[
"bibItemIndex"] :
$_GET[
"bibItemIndex"];
533 if ($bibItemName ==
"BibItem")
535 include_once
"./Modules/LearningModule/classes/class.ilBibItem.php";
537 $bib_item->setId($this->object->getId());
538 $bib_item->setType($this->object->getType());
542 include_once
"./Modules/LearningModule/classes/class.ilBibItemGUI.php";
544 $bib_gui->setObject($this->
object);
545 if ($bibItemIndex ==
"")
547 $bibItemPath =
$_POST[
"bibItemPath"] ?
$_POST[
"bibItemPath"] :
$_GET[
"bibItemPath"];
550 if ($bibItemName !=
"")
552 $bib_gui->bib_obj->add($bibItemName, $bibItemPath, $bibItemIndex);
553 $data = $bib_gui->bib_obj->getElement(
"BibItem");
554 $bibItemIndex = (count(
$data) - 1);
562 $a_target =
"adm_object.php?ref_id=" . $this->
object->getRefId();
565 $bib_gui->edit(
"ADM_CONTENT",
"adm_content", $a_target, $bibItemIndex);
587 $ilCtrl->setCmdClass(
"ilfilesystemgui");
588 $ilCtrl->setCmd(
"listFiles");
599 $this->tpl->addBlockFile(
"CONTENT",
"content",
"tpl.adm_content.html");
601 $this->tpl->addBlockFile(
"STATUSLINE",
"statusline",
"tpl.statusline.html");
610 include_once
"Services/License/classes/class.ilLicense.php";
612 $this->
object->getRefId());
615 if ($ilUser->getId() != ANONYMOUS_USER_ID)
617 include_once
"Services/Tracking/classes/class.ilLearningProgress.php";
619 $this->
object->getRefId(),
"htlm");
622 require_once(
"./Modules/HTMLLearningModule/classes/class.ilObjFileBasedLMAccess.php");
624 if ($startfile !=
"")
638 $this->ctrl->setCmd(
"showSummary");
639 $this->ctrl->setCmdClass(
"ilinfoscreengui");
656 global
$ilBench, $ilLocator, $ilAccess, $ilTabs;
658 $ilTabs->activateTab(
'id_info');
660 $this->lng->loadLanguageModule(
"meta");
661 include_once(
"./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
664 $info->enablePrivateNotes();
665 $info->enableLearningProgress();
668 if ($ilAccess->checkAccess(
"write",
"",
$_GET[
"ref_id"]))
670 $info->enableNewsEditing();
673 $enable_internal_rss = $news_set->get(
"enable_rss_for_internal");
674 if ($enable_internal_rss)
676 $info->setBlockProperty(
"news",
"settings",
true);
681 if ($ilAccess->checkAccess(
"read",
"",
$_GET[
"ref_id"]))
683 $info->addButton($this->lng->txt(
"view"),
684 "ilias.php?baseClass=ilHTLMPresentationGUI&ref_id=".$this->object->getRefID(),
685 ' target="ilContObj'.$this->object->getId().
'" ',
690 $info->addMetaDataSections($this->object->getId(),0, $this->
object->getType());
693 $this->ctrl->forwardCommand($info);
706 $this->tpl->setTitle($this->object->getTitle());
716 $ilHelp->setScreenIdComponent(
"htlm");
718 if($ilAccess->checkAccess(
'write',
'', $this->ref_id))
720 $ilTabs->addTab(
"id_list_files",
721 $lng->txt(
"cont_list_files"),
722 $this->ctrl->getLinkTargetByClass(
"ilfilesystemgui",
"listFiles"));
724 $ilTabs->addTab(
"id_info",
725 $lng->txt(
"info_short"),
726 $this->ctrl->getLinkTargetByClass(array(
"ilobjfilebasedlmgui",
"ilinfoscreengui"),
"showSummary"));
728 $ilTabs->addTab(
"id_settings",
729 $lng->txt(
"settings"),
730 $this->ctrl->getLinkTarget($this,
"properties"));
733 include_once
'./Services/Tracking/classes/class.ilLearningProgressAccess.php';
736 $ilTabs->addTab(
"id_learning_progress",
737 $lng->txt(
"learning_progress"),
738 $this->ctrl->getLinkTargetByClass(array(
'ilobjfilebasedlmgui',
'illearningprogressgui'),
''));
741 include_once(
"Services/License/classes/class.ilLicenseAccess.php");
742 if ($ilAccess->checkAccess(
'edit_permission',
'', $this->ref_id)
745 $ilTabs->addTab(
"id_license",
746 $lng->txt(
"license"),
747 $this->ctrl->getLinkTargetByClass(
'illicensegui',
''));
750 if($ilAccess->checkAccess(
'write',
'', $this->ref_id))
752 $ilTabs->addTab(
"id_meta_data",
753 $lng->txt(
"meta_data"),
754 $this->ctrl->getLinkTargetByClass(
'ilmdeditorgui',
''));
756 $ilTabs->addTab(
"id_bib_data",
757 $lng->txt(
"bib_data"),
758 $this->ctrl->getLinkTarget($this,
"editBibItem"));
763 if ($ilAccess->checkAccess(
"write",
"", $this->object->getRefId()))
765 $ilTabs->addTab(
"export",
767 $this->ctrl->getLinkTargetByClass(
"ilexportgui",
""));
770 if ($ilAccess->checkAccess(
'edit_permission',
'', $this->object->getRefId()))
772 $ilTabs->addTab(
"id_permissions",
773 $lng->txt(
"perm_settings"),
774 $this->ctrl->getLinkTargetByClass(array(get_class($this),
'ilpermissiongui'),
"perm"));
777 require_once(
"./Modules/HTMLLearningModule/classes/class.ilObjFileBasedLMAccess.php");
780 if ($startfile !=
"")
782 $ilTabs->addNonTabbedLink(
"presentation_view",
783 $this->lng->txt(
"glo_presentation_view"),
784 "ilias.php?baseClass=ilHTLMPresentationGUI&ref_id=".$this->object->getRefID(),
800 if ($ilAccess->checkAccess(
"visible",
"", $a_target))
804 else if ($ilAccess->checkAccess(
"read",
"", ROOT_FOLDER_ID))
811 $ilErr->raiseError($lng->txt(
"msg_no_perm_read_lm"), $ilErr->FATAL);
818 if (is_object($this->
object))
820 $ilLocator->addItem($this->object->getTitle(),
821 $this->ctrl->getLinkTargetByClass(
"ilinfoscreengui",
"showSummary"),
"",
$_GET[
"ref_id"]);
857 $ilErr->raiseError($this->lng->txt(
"no_create_permission"));
864 $newObj->setDescription(
"");
866 $newObj->populateByDirectoy($a_dir,
$filename);
885 $inst_id = IL_INST_ID;
887 include_once(
"./Services/Export/classes/class.ilExport.php");
890 $this->
object->getType());
892 $this->
object->getType());
894 $subdir = $this->
object->getType().
"_".$this->
object->getId();
897 $target_dir = $export_dir.
"/".$subdir;
902 $source_dir = $this->
object->getDataDirectory();
908 $zip_file = $export_dir.
"/".$date.
"__".IL_INST_ID.
"__".
909 $this->
object->getType().
"_".$this->
object->getId().
".zip";