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().
'" ');
689 $info->addMetaDataSections($this->object->getId(),0, $this->
object->getType());
692 $this->ctrl->forwardCommand($info);
705 $this->tpl->setTitle($this->object->getTitle());
715 $ilHelp->setScreenIdComponent(
"htlm");
717 if($ilAccess->checkAccess(
'write',
'', $this->ref_id))
719 $ilTabs->addTab(
"id_list_files",
720 $lng->txt(
"cont_list_files"),
721 $this->ctrl->getLinkTargetByClass(
"ilfilesystemgui",
"listFiles"));
723 $ilTabs->addTab(
"id_info",
724 $lng->txt(
"info_short"),
725 $this->ctrl->getLinkTargetByClass(array(
"ilobjfilebasedlmgui",
"ilinfoscreengui"),
"showSummary"));
727 $ilTabs->addTab(
"id_settings",
728 $lng->txt(
"settings"),
729 $this->ctrl->getLinkTarget($this,
"properties"));
732 include_once
'./Services/Tracking/classes/class.ilLearningProgressAccess.php';
735 $ilTabs->addTab(
"id_learning_progress",
736 $lng->txt(
"learning_progress"),
737 $this->ctrl->getLinkTargetByClass(array(
'ilobjfilebasedlmgui',
'illearningprogressgui'),
''));
740 include_once(
"Services/License/classes/class.ilLicenseAccess.php");
741 if ($ilAccess->checkAccess(
'edit_permission',
'', $this->ref_id)
744 $ilTabs->addTab(
"id_license",
745 $lng->txt(
"license"),
746 $this->ctrl->getLinkTargetByClass(
'illicensegui',
''));
749 if($ilAccess->checkAccess(
'write',
'', $this->ref_id))
751 $ilTabs->addTab(
"id_meta_data",
752 $lng->txt(
"meta_data"),
753 $this->ctrl->getLinkTargetByClass(
'ilmdeditorgui',
''));
755 $ilTabs->addTab(
"id_bib_data",
756 $lng->txt(
"bib_data"),
757 $this->ctrl->getLinkTarget($this,
"editBibItem"));
762 if ($ilAccess->checkAccess(
"write",
"", $this->object->getRefId()))
764 $ilTabs->addTab(
"export",
766 $this->ctrl->getLinkTargetByClass(
"ilexportgui",
""));
769 if ($ilAccess->checkAccess(
'edit_permission',
'', $this->object->getRefId()))
771 $ilTabs->addTab(
"id_permissions",
772 $lng->txt(
"perm_settings"),
773 $this->ctrl->getLinkTargetByClass(array(get_class($this),
'ilpermissiongui'),
"perm"));
776 require_once(
"./Modules/HTMLLearningModule/classes/class.ilObjFileBasedLMAccess.php");
779 if ($startfile !=
"")
781 $ilTabs->addNonTabbedLink(
"presentation_view",
782 $this->lng->txt(
"glo_presentation_view"),
783 "ilias.php?baseClass=ilHTLMPresentationGUI&ref_id=".$this->object->getRefID(),
799 if ($ilAccess->checkAccess(
"visible",
"", $a_target))
803 else if ($ilAccess->checkAccess(
"read",
"", ROOT_FOLDER_ID))
810 $ilErr->raiseError($lng->txt(
"msg_no_perm_read_lm"), $ilErr->FATAL);
817 if (is_object($this->
object))
819 $ilLocator->addItem($this->object->getTitle(),
820 $this->ctrl->getLinkTargetByClass(
"ilinfoscreengui",
"showSummary"),
"",
$_GET[
"ref_id"]);
856 $ilErr->raiseError($this->lng->txt(
"no_create_permission"));
863 $newObj->setDescription(
"");
865 $newObj->populateByDirectoy($a_dir,
$filename);
884 $inst_id = IL_INST_ID;
886 include_once(
"./Services/Export/classes/class.ilExport.php");
889 $this->
object->getType());
891 $this->
object->getType());
893 $subdir = $this->
object->getType().
"_".$this->
object->getId();
896 $target_dir = $export_dir.
"/".$subdir;
901 $source_dir = $this->
object->getDataDirectory();
907 $zip_file = $export_dir.
"/".$date.
"__".IL_INST_ID.
"__".
908 $this->
object->getType().
"_".$this->
object->getId().
".zip";