4 require_once
"classes/class.ilObjectGUI.php";
5 require_once(
"classes/class.ilFileSystemGUI.php");
6 require_once(
"classes/class.ilTabsGUI.php");
30 $lng->loadLanguageModule(
"content");
32 $this->
ilObjectGUI($a_data,$a_id,$a_call_by_reference,
false);
33 #$this->tabs_gui =& new ilTabsGUI();
42 global $ilAccess, $ilTabs;
44 if (strtolower(
$_GET[
"baseClass"]) ==
"iladministrationgui" ||
56 $next_class = $this->ctrl->getNextClass($this);
57 $cmd = $this->ctrl->getCmd();
63 include_once
'Services/MetaData/classes/class.ilMDEditorGUI.php';
65 $md_gui =&
new ilMDEditorGUI($this->object->getId(), 0, $this->
object->getType());
66 $md_gui->
addObserver($this->
object,
'MDUpdateListener',
'General');
68 $this->ctrl->forwardCommand($md_gui);
71 case 'ilpermissiongui':
72 include_once(
"Services/AccessControl/classes/class.ilPermissionGUI.php");
74 $ret =& $this->ctrl->forwardCommand($perm_gui);
77 case "ilfilesystemgui":
78 $this->fs_gui =&
new ilFileSystemGUI($this->object->getDataDirectory());
79 $this->fs_gui->
setTableId(
"sahsfs".$this->object->getId());
80 $ret =& $this->ctrl->forwardCommand($this->fs_gui);
83 case "ilcertificategui":
84 include_once
"./Services/Certificate/classes/class.ilCertificateGUI.php";
85 include_once
"./Modules/ScormAicc/classes/class.ilSCORMCertificateAdapter.php";
87 $ret =& $this->ctrl->forwardCommand($output_gui);
90 case "illearningprogressgui":
91 include_once
'./Services/Tracking/classes/class.ilLearningProgressGUI.php';
94 $this->ctrl->forwardCommand($new_gui);
99 include_once(
"./Services/License/classes/class.ilLicenseGUI.php");
101 $ret =& $this->ctrl->forwardCommand($license_gui);
104 case "ilinfoscreengui":
105 include_once(
"./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
108 $info->enablePrivateNotes();
109 $info->enableLearningProgress();
112 if ($ilAccess->checkAccess(
"read",
"",
$_GET[
"ref_id"]))
114 if (!$this->object->getEditable())
116 $info->addButton($this->lng->txt(
"view"),
117 "ilias.php?baseClass=ilSAHSPresentationGUI&ref_id=".$this->object->getRefID(),
118 ' target="ilContObj'.$this->object->getId().
'" ');
123 if ($ilAccess->checkAccess(
"write",
"",
$_GET[
"ref_id"]))
125 $info->enableNewsEditing();
127 $enable_internal_rss = $news_set->get(
"enable_rss_for_internal");
128 if ($enable_internal_rss)
130 $info->setBlockProperty(
"news",
"settings",
true);
134 $info->addMetaDataSections($this->object->getId(),0, $this->
object->getType());
137 $this->ctrl->forwardCommand($info);
140 case "ilcommonactiondispatchergui":
141 include_once(
"Services/Object/classes/class.ilCommonActionDispatcherGUI.php");
143 $this->ctrl->forwardCommand($gui);
146 case "ilobjstylesheetgui":
148 $this->ctrl->setReturn($this,
"properties");
149 $ilTabs->clearTargets();
150 $style_gui =&
new ilObjStyleSheetGUI(
"", $this->object->getStyleSheetId(),
false,
false);
152 if (
$cmd ==
"create" ||
$_GET[
"new_type"]==
"sty")
154 $style_gui->setCreationMode(
true);
158 if (
$cmd ==
"confirmedDelete")
160 $this->
object->setStyleSheetId(0);
161 $this->
object->update();
163 $ret =& $this->ctrl->forwardCommand($style_gui);
164 if (
$cmd ==
"save" ||
$cmd ==
"copyStyle" ||
$cmd ==
"importStyle")
167 $this->
object->setStyleSheetId($style_id);
168 $this->
object->update();
169 $this->ctrl->redirectByClass(
"ilobjstylesheetgui",
"edit");
173 $cmd = $this->ctrl->getCmd(
"frameset");
174 if ((strtolower(
$_GET[
"baseClass"]) ==
"iladministrationgui" ||
182 if(
$cmd ==
"redrawHeaderAction")
195 if (strtolower(
$_GET[
"baseClass"]) ==
"iladministrationgui")
247 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
254 $ti->setRequired(
true);
255 $this->form->addItem($ti);
261 $this->form->addItem($ta);
264 $this->form->addCommandButton(
"save", $lng->txt(
"create"));
265 $this->form->addCommandButton(
"cancel", $lng->txt(
"cancel"));
267 $this->form->setTitle($lng->txt(
"scorm_new"));
268 $this->form->setFormAction($ilCtrl->getFormAction($this));
279 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
284 "scorm2004" => $lng->txt(
"lm_type_scorm2004"),
285 "scorm" => $lng->txt(
"lm_type_scorm"),
286 "aicc" => $lng->txt(
"lm_type_aicc"),
287 "hacp" => $lng->txt(
"lm_type_hacp")
291 $this->form->addItem($si);
294 $fi =
new ilFileInputGUI($this->lng->txt(
"select_file"),
"scormfile");
296 $this->form->addItem($fi);
301 include_once
'Services/FileSystemStorage/classes/class.ilUploadFiles.php';
305 $fi->setRequired(
false);
307 $options[
""] = $this->lng->txt(
"cont_select_from_upload_dir");
310 $file = htmlspecialchars($file, ENT_QUOTES,
"utf-8");
314 $si =
new ilSelectInputGUI($this->lng->txt(
"cont_uploaded_file"),
"uploaded_file");
316 $this->form->addItem($si);
323 $cb->setChecked(
true);
324 $this->form->addItem($cb);
329 $cb->setInfo($this->lng->txt(
"sahs_authoring_mode_info"));
330 $this->form->addItem($cb);
335 $op1 =
new ilRadioOption($lng->txt(
"sahs_std_sequencing"), 0,$lng->txt(
"sahs_std_sequencing_info"));
336 $radg->addOption($op1);
337 $op1 =
new ilRadioOption($lng->txt(
"sahs_import_sequencing"), 1,$lng->txt(
"sahs_import_sequencing_info"));
338 $radg->addOption($op1);
342 $this->form->addCommandButton(
"upload", $lng->txt(
"import"));
343 $this->form->addCommandButton(
"cancel", $lng->txt(
"cancel"));
345 $this->form->setTitle($lng->txt(
"import_sahs"));
346 $this->form->setFormAction($ilCtrl->getFormAction($this));
428 global $_FILES, $rbacsystem;
430 include_once
'Services/FileSystemStorage/classes/class.ilUploadFiles.php';
433 if (!$rbacsystem->checkAccess(
"create",
$_GET[
"ref_id"],
"sahs"))
435 $this->ilias->raiseError($this->lng->txt(
"no_create_permission"), $this->ilias->error_obj->WARNING);
437 elseif ($_FILES[
"scormfile"][
"name"])
440 $source = $_FILES[
"scormfile"][
"tmp_name"];
441 if (($source ==
'none') || (!$source))
443 $this->ilias->raiseError($this->lng->txt(
"msg_no_file"),$this->ilias->error_obj->MESSAGE);
446 switch ($__FILES[
"scormfile"][
"error"])
448 case UPLOAD_ERR_INI_SIZE:
449 $this->ilias->raiseError($this->lng->txt(
"err_max_file_size_exceeds"),$this->ilias->error_obj->MESSAGE);
452 case UPLOAD_ERR_FORM_SIZE:
453 $this->ilias->raiseError($this->lng->txt(
"err_max_file_size_exceeds"),$this->ilias->error_obj->MESSAGE);
456 case UPLOAD_ERR_PARTIAL:
457 $this->ilias->raiseError($this->lng->txt(
"err_partial_file_upload"),$this->ilias->error_obj->MESSAGE);
460 case UPLOAD_ERR_NO_FILE:
461 $this->ilias->raiseError($this->lng->txt(
"err_no_file_uploaded"),$this->ilias->error_obj->MESSAGE);
465 $file = pathinfo($_FILES[
"scormfile"][
"name"]);
467 elseif (
$_POST[
"uploaded_file"])
472 $this->ilias->raiseError($this->lng->txt(
"upload_error_file_not_found"),$this->ilias->error_obj->MESSAGE);
479 $this->ilias->raiseError($this->lng->txt(
"msg_no_file"),$this->ilias->error_obj->MESSAGE);
482 $name = substr(
$file[
"basename"], 0, strlen(
$file[
"basename"]) - strlen(
$file[
"extension"]) - 1);
485 $name = $this->lng->txt(
"no_title");
489 switch (
$_POST[
"sub_type"])
493 include_once(
"./Modules/Scorm2004/classes/class.ilObjSCORM2004LearningModule.php");
495 $newObj->setEditable(
$_POST[
"editable"]==
'y');
496 $newObj->setImportSequencing(
$_POST[
"import_sequencing"]);
497 $newObj->setSequencingExpertMode(
$_POST[
"import_sequencing"]);
501 include_once(
"./Modules/ScormAicc/classes/class.ilObjSCORMLearningModule.php");
506 include_once(
"./Modules/ScormAicc/classes/class.ilObjAICCLearningModule.php");
511 include_once(
"./Modules/ScormAicc/classes/class.ilObjHACPLearningModule.php");
516 $newObj->setTitle($name);
517 $newObj->setSubType(
$_POST[
"sub_type"]);
518 $newObj->setDescription(
"");
519 $newObj->create(
true);
520 $newObj->createReference();
521 $newObj->putInTree(
$_GET[
"ref_id"]);
522 $newObj->setPermissions(
$_GET[
"ref_id"]);
523 $newObj->notify(
"new",
$_GET[
"ref_id"],
$_GET[
"parent_non_rbac_id"],
$_GET[
"ref_id"],$newObj->getRefId());
526 $newObj->createDataDirectory();
528 if ($_FILES[
"scormfile"][
"name"])
531 $file_path = $newObj->getDataDirectory().
"/".$_FILES[
"scormfile"][
"name"];
534 $_FILES[
"scormfile"][
"name"], $file_path);
539 $file_path = $newObj->getDataDirectory().
"/".
$_POST[
"uploaded_file"];
547 $title = $newObj->readObject();
560 ilUtil::redirect(
"ilias.php?baseClass=ilSAHSEditGUI&ref_id=".$newObj->getRefId());
575 if (trim(
$_POST[
"title"]) ==
"")
577 $this->ilias->raiseError($this->lng->txt(
"msg_no_title"),$this->ilias->error_obj->MESSAGE);
580 include_once(
"./Modules/Scorm2004/classes/class.ilObjSCORM2004LearningModule.php");
583 $newObj->setSubType(
"scorm2004");
584 $newObj->setEditable(
true);
587 $newObj->createReference();
588 $newObj->putInTree(
$_GET[
"ref_id"]);
589 $newObj->setPermissions(
$_GET[
"ref_id"]);
590 $newObj->notify(
"new",
$_GET[
"ref_id"],
$_GET[
"parent_non_rbac_id"],
$_GET[
"ref_id"],$newObj->getRefId());
591 $newObj->createDataDirectory();
592 $newObj->createScorm2004Tree();
594 ilUtil::redirect(
"ilias.php?baseClass=ilSAHSEditGUI&ref_id=".$newObj->getRefId());
611 $this->ownerObject();
621 $this->tpl->getStandardTemplate();
632 $this->tpl =
new ilTemplate(
"tpl.sahs_edit_frameset.html",
false,
false,
"Modules/ScormAicc");
633 $this->tpl->setVariable(
"SRC",
634 $this->ctrl->getLinkTarget($this,
"properties"));
635 $this->tpl->show(
"DEFAULT",
false);
645 $this->tpl->setTitle($this->object->getTitle());
646 $this->
getTabs($this->tabs_gui);
654 include_once
"./Services/Certificate/classes/class.ilCertificateGUI.php";
655 include_once
"./Modules/ScormAicc/classes/class.ilSCORMCertificateAdapter.php";
657 $output_gui->certificateEditor();
667 global $rbacsystem, $ilUser,
$ilCtrl;
669 if ($this->ctrl->getCmd() ==
"delete")
676 $ilCtrl->setParameterByClass(
"ilfilesystemgui",
"resetoffset", 1);
677 $tabs_gui->addTarget(
"cont_list_files",
678 $this->ctrl->getLinkTargetByClass(
"ilfilesystemgui",
"listFiles"),
"",
680 $ilCtrl->setParameterByClass(
"ilfilesystemgui",
"resetoffset",
"");
683 $force_active = ($this->ctrl->getNextClass() ==
"ilinfoscreengui")
686 $tabs_gui->addTarget(
"info_short",
687 $this->ctrl->getLinkTargetByClass(
"ilinfoscreengui",
"showSummary"),
"",
688 "ilinfoscreengui",
"", $force_active);
691 $tabs_gui->addTarget(
"settings",
692 $this->ctrl->getLinkTarget($this,
"properties"),
"properties",
696 include_once
'./Services/Tracking/classes/class.ilLearningProgressAccess.php';
699 $tabs_gui->addTarget(
'learning_progress',
700 $this->ctrl->getLinkTargetByClass(array(
'illearningprogressgui'),
''),
702 array(
'illplistofobjectsgui',
'illplistofsettingsgui',
'illearningprogressgui',
'illplistofprogressgui'));
705 include_once(
'./Services/PrivacySecurity/classes/class.ilPrivacySettings.php');
707 if($privacy->enabledSahsProtocolData())
710 $tabs_gui->addTarget(
"cont_tracking_data",
711 $this->ctrl->getLinkTarget($this,
"showTrackingItems"),
"showTrackingItems",
716 switch ($this->object->getSubType())
722 $tabs_gui->addTarget(
"certificate",
723 $this->ctrl->getLinkTarget($this,
"certificate"),
724 array(
"certificate",
"certificateEditor",
"certificateRemoveBackground",
"certificateSave",
725 "certificatePreview",
"certificateDelete",
"certificateUpload",
"certificateImport")
730 include_once(
"Services/License/classes/class.ilLicenseAccess.php");
731 if ($rbacsystem->checkAccess(
'edit_permission',$this->object->getRefId())
734 $tabs_gui->addTarget(
"license",
735 $this->ctrl->getLinkTargetByClass(
'illicensegui',
''),
740 $tabs_gui->addTarget(
"meta_data",
741 $this->ctrl->getLinkTargetByClass(
'ilmdeditorgui',
''),
742 "",
"ilmdeditorgui");
745 if ($rbacsystem->checkAccess(
'edit_permission',$this->object->getRefId()))
747 $tabs_gui->addTarget(
"perm_settings",
748 $this->ctrl->getLinkTargetByClass(array(get_class($this),
'ilpermissiongui'),
"perm"), array(
"perm",
"info",
"owner"),
'ilpermissiongui');
759 $parts = explode(
"_", $a_target);
761 if ($ilAccess->checkAccess(
"write",
"", $parts[0]))
764 $_GET[
"baseClass"] =
"ilSAHSEditGUI";
765 $_GET[
"ref_id"] = $parts[0];
766 $_GET[
"obj_id"] = $parts[1];
767 include(
"ilias.php");
770 if ($ilAccess->checkAccess(
"visible",
"", $parts[0]))
772 $_GET[
"cmd"] =
"infoScreen";
773 $_GET[
"baseClass"] =
"ilSAHSPresentationGUI";
774 $_GET[
"ref_id"] = $parts[0];
775 include(
"ilias.php");
780 if ($ilAccess->checkAccess(
"read",
"", ROOT_FOLDER_ID))
782 $_GET[
"cmd"] =
"frameset";
783 $_GET[
"target"] =
"";
784 $_GET[
"ref_id"] = ROOT_FOLDER_ID;
787 include(
"repository.php");
792 $ilErr->raiseError($lng->txt(
"msg_no_perm_read"), $ilErr->FATAL);
799 if (is_object($this->
object))
801 $ilLocator->addItem($this->object->getTitle(),
802 $this->ctrl->getLinkTargetByClass(
"ilinfoscreengui",
"showSummary"),
"",
$_GET[
"ref_id"]);