4 require_once
"./Services/Object/classes/class.ilObjectGUI.php";
5 require_once(
"./Services/FileSystem/classes/class.ilFileSystemGUI.php");
29 $lng->loadLanguageModule(
"content");
31 $this->
ilObjectGUI($a_data,$a_id,$a_call_by_reference,
false);
39 global $ilAccess, $ilTabs,
$ilErr;
41 if (strtolower(
$_GET[
"baseClass"]) ==
"iladministrationgui" ||
53 $next_class = $this->ctrl->getNextClass($this);
54 $cmd = $this->ctrl->getCmd();
59 if(!$ilAccess->checkAccess(
'write',
'',$this->object->getRefId()))
61 $ilErr->raiseError($this->lng->txt(
'permission_denied'),$ilErr->WARNING);
64 include_once
'Services/MetaData/classes/class.ilMDEditorGUI.php';
66 $md_gui =&
new ilMDEditorGUI($this->object->getId(), 0, $this->
object->getType());
67 $md_gui->
addObserver($this->
object,
'MDUpdateListener',
'General');
69 $this->ctrl->forwardCommand($md_gui);
72 case 'ilpermissiongui':
73 include_once(
"Services/AccessControl/classes/class.ilPermissionGUI.php");
75 $ret =& $this->ctrl->forwardCommand($perm_gui);
78 case "ilfilesystemgui":
79 $this->fs_gui =&
new ilFileSystemGUI($this->object->getDataDirectory());
80 $this->fs_gui->
setTableId(
"sahsfs".$this->object->getId());
81 $ret =& $this->ctrl->forwardCommand($this->fs_gui);
84 case "ilcertificategui":
85 include_once
"./Services/Certificate/classes/class.ilCertificateGUI.php";
86 include_once
"./Modules/ScormAicc/classes/class.ilSCORMCertificateAdapter.php";
88 $ret =& $this->ctrl->forwardCommand($output_gui);
91 case "illearningprogressgui":
92 include_once
'./Services/Tracking/classes/class.ilLearningProgressGUI.php';
95 $this->ctrl->forwardCommand($new_gui);
100 include_once(
"./Services/License/classes/class.ilLicenseGUI.php");
102 $ret =& $this->ctrl->forwardCommand($license_gui);
105 case "ilinfoscreengui":
106 include_once(
"./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
109 $info->enablePrivateNotes();
110 $info->enableLearningProgress();
113 if ($ilAccess->checkAccess(
"read",
"",
$_GET[
"ref_id"]))
115 if (!$this->object->getEditable())
117 $info->addButton($this->lng->txt(
"view"),
118 "ilias.php?baseClass=ilSAHSPresentationGUI&ref_id=".$this->object->getRefID(),
119 ' target="ilContObj'.$this->object->getId().
'" ');
124 if ($ilAccess->checkAccess(
"write",
"",
$_GET[
"ref_id"]))
126 $info->enableNewsEditing();
128 $enable_internal_rss = $news_set->get(
"enable_rss_for_internal");
129 if ($enable_internal_rss)
131 $info->setBlockProperty(
"news",
"settings",
true);
135 $info->addMetaDataSections($this->object->getId(),0, $this->
object->getType());
138 $this->ctrl->forwardCommand($info);
141 case "ilcommonactiondispatchergui":
142 include_once(
"Services/Object/classes/class.ilCommonActionDispatcherGUI.php");
144 $this->ctrl->forwardCommand($gui);
147 case "ilobjstylesheetgui":
149 $this->ctrl->setReturn($this,
"properties");
150 $ilTabs->clearTargets();
151 $style_gui =&
new ilObjStyleSheetGUI(
"", $this->object->getStyleSheetId(),
false,
false);
153 if (
$cmd ==
"create" ||
$_GET[
"new_type"]==
"sty")
155 $style_gui->setCreationMode(
true);
159 if (
$cmd ==
"confirmedDelete")
161 $this->
object->setStyleSheetId(0);
162 $this->
object->update();
164 $ret =& $this->ctrl->forwardCommand($style_gui);
165 if (
$cmd ==
"save" ||
$cmd ==
"copyStyle" ||
$cmd ==
"importStyle")
168 $this->
object->setStyleSheetId($style_id);
169 $this->
object->update();
170 $this->ctrl->redirectByClass(
"ilobjstylesheetgui",
"edit");
174 if ($this->
object && !$this->object->getEditable())
176 $cmd = $this->ctrl->getCmd(
"properties");
180 $cmd = $this->ctrl->getCmd(
"frameset");
182 if ((strtolower(
$_GET[
"baseClass"]) ==
"iladministrationgui" ||
190 if(
$cmd ==
"redrawHeaderAction")
203 if (strtolower(
$_GET[
"baseClass"]) ==
"iladministrationgui")
255 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
262 $ti->setRequired(
true);
263 $this->form->addItem($ti);
269 $this->form->addItem($ta);
272 $this->form->addCommandButton(
"save", $lng->txt(
"create"));
273 $this->form->addCommandButton(
"cancel", $lng->txt(
"cancel"));
275 $this->form->setTitle($lng->txt(
"scorm_new"));
276 $this->form->setFormAction($ilCtrl->getFormAction($this));
287 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
292 "scorm2004" => $lng->txt(
"lm_type_scorm2004"),
293 "scorm" => $lng->txt(
"lm_type_scorm"),
294 "aicc" => $lng->txt(
"lm_type_aicc"),
295 "hacp" => $lng->txt(
"lm_type_hacp")
299 $this->form->addItem($si);
302 $fi =
new ilFileInputGUI($this->lng->txt(
"select_file"),
"scormfile");
304 $this->form->addItem($fi);
309 include_once
'Services/FileSystem/classes/class.ilUploadFiles.php';
313 $fi->setRequired(
false);
315 $options[
""] = $this->lng->txt(
"cont_select_from_upload_dir");
316 foreach($files as
$file)
318 $file = htmlspecialchars($file, ENT_QUOTES,
"utf-8");
322 $si =
new ilSelectInputGUI($this->lng->txt(
"cont_uploaded_file"),
"uploaded_file");
324 $this->form->addItem($si);
332 $this->form->addItem($cb);
337 $cb->setInfo($this->lng->txt(
"sahs_authoring_mode_info"));
338 $this->form->addItem($cb);
343 $op1 =
new ilRadioOption($lng->txt(
"sahs_std_sequencing"), 0,$lng->txt(
"sahs_std_sequencing_info"));
344 $radg->addOption($op1);
345 $op1 =
new ilRadioOption($lng->txt(
"sahs_import_sequencing"), 1,$lng->txt(
"sahs_import_sequencing_info"));
346 $radg->addOption($op1);
350 $this->form->addCommandButton(
"upload", $lng->txt(
"import"));
351 $this->form->addCommandButton(
"cancel", $lng->txt(
"cancel"));
353 $this->form->setTitle($lng->txt(
"import_sahs"));
354 $this->form->setFormAction($ilCtrl->getFormAction($this,
"upload"));
366 global $_FILES, $rbacsystem;
368 include_once
'Services/FileSystem/classes/class.ilUploadFiles.php';
371 if (!$rbacsystem->checkAccess(
"create",
$_GET[
"ref_id"],
"sahs"))
373 $this->ilias->raiseError($this->lng->txt(
"no_create_permission"), $this->ilias->error_obj->WARNING);
375 elseif ($_FILES[
"scormfile"][
"name"])
378 $source = $_FILES[
"scormfile"][
"tmp_name"];
379 if (($source ==
'none') || (!$source))
381 $this->ilias->raiseError($this->lng->txt(
"msg_no_file"),$this->ilias->error_obj->MESSAGE);
384 switch ($__FILES[
"scormfile"][
"error"])
386 case UPLOAD_ERR_INI_SIZE:
387 $this->ilias->raiseError($this->lng->txt(
"err_max_file_size_exceeds"),$this->ilias->error_obj->MESSAGE);
390 case UPLOAD_ERR_FORM_SIZE:
391 $this->ilias->raiseError($this->lng->txt(
"err_max_file_size_exceeds"),$this->ilias->error_obj->MESSAGE);
394 case UPLOAD_ERR_PARTIAL:
395 $this->ilias->raiseError($this->lng->txt(
"err_partial_file_upload"),$this->ilias->error_obj->MESSAGE);
398 case UPLOAD_ERR_NO_FILE:
399 $this->ilias->raiseError($this->lng->txt(
"err_no_file_uploaded"),$this->ilias->error_obj->MESSAGE);
403 $file = pathinfo($_FILES[
"scormfile"][
"name"]);
405 elseif (
$_POST[
"uploaded_file"])
410 $this->ilias->raiseError($this->lng->txt(
"upload_error_file_not_found"),$this->ilias->error_obj->MESSAGE);
417 $this->ilias->raiseError($this->lng->txt(
"msg_no_file"),$this->ilias->error_obj->MESSAGE);
420 $name = substr(
$file[
"basename"], 0, strlen(
$file[
"basename"]) - strlen(
$file[
"extension"]) - 1);
423 $name = $this->lng->txt(
"no_title");
427 switch (
$_POST[
"sub_type"])
431 include_once(
"./Modules/Scorm2004/classes/class.ilObjSCORM2004LearningModule.php");
433 $newObj->setEditable(
$_POST[
"editable"]==
'y');
434 $newObj->setImportSequencing(
$_POST[
"import_sequencing"]);
435 $newObj->setSequencingExpertMode(
$_POST[
"import_sequencing"]);
439 include_once(
"./Modules/ScormAicc/classes/class.ilObjSCORMLearningModule.php");
444 include_once(
"./Modules/ScormAicc/classes/class.ilObjAICCLearningModule.php");
449 include_once(
"./Modules/ScormAicc/classes/class.ilObjHACPLearningModule.php");
454 $newObj->setTitle($name);
455 $newObj->setSubType(
$_POST[
"sub_type"]);
456 $newObj->setDescription(
"");
457 $newObj->create(
true);
458 $newObj->createReference();
459 $newObj->putInTree(
$_GET[
"ref_id"]);
460 $newObj->setPermissions(
$_GET[
"ref_id"]);
461 $newObj->notify(
"new",
$_GET[
"ref_id"],
$_GET[
"parent_non_rbac_id"],
$_GET[
"ref_id"],$newObj->getRefId());
464 $newObj->createDataDirectory();
466 if ($_FILES[
"scormfile"][
"name"])
469 $file_path = $newObj->getDataDirectory().
"/".$_FILES[
"scormfile"][
"name"];
472 $_FILES[
"scormfile"][
"name"], $file_path);
477 $file_path = $newObj->getDataDirectory().
"/".
$_POST[
"uploaded_file"];
485 $title = $newObj->readObject();
498 ilUtil::redirect(
"ilias.php?baseClass=ilSAHSEditGUI&ref_id=".$newObj->getRefId());
513 if (trim(
$_POST[
"title"]) ==
"")
515 $this->ilias->raiseError($this->lng->txt(
"msg_no_title"),$this->ilias->error_obj->MESSAGE);
518 include_once(
"./Modules/Scorm2004/classes/class.ilObjSCORM2004LearningModule.php");
521 $newObj->setSubType(
"scorm2004");
522 $newObj->setEditable(
true);
525 $newObj->createReference();
526 $newObj->putInTree(
$_GET[
"ref_id"]);
527 $newObj->setPermissions(
$_GET[
"ref_id"]);
528 $newObj->notify(
"new",
$_GET[
"ref_id"],
$_GET[
"parent_non_rbac_id"],
$_GET[
"ref_id"],$newObj->getRefId());
529 $newObj->createDataDirectory();
530 $newObj->createScorm2004Tree();
532 ilUtil::redirect(
"ilias.php?baseClass=ilSAHSEditGUI&ref_id=".$newObj->getRefId());
549 $this->ownerObject();
559 $this->tpl->getStandardTemplate();
583 $this->tpl->setTitle($this->object->getTitle());
584 $this->
getTabs($this->tabs_gui);
592 include_once
"./Services/Certificate/classes/class.ilCertificateGUI.php";
593 include_once
"./Modules/ScormAicc/classes/class.ilSCORMCertificateAdapter.php";
595 $output_gui->certificateEditor();
607 if ($this->ctrl->getCmd() ==
"delete")
612 switch ($this->object->getSubType())
615 $ilHelp->setScreenIdComponent(
"sahs13");
619 $ilHelp->setScreenIdComponent(
"sahs12");
625 $ilCtrl->setParameterByClass(
"ilfilesystemgui",
"resetoffset", 1);
626 $tabs_gui->addTarget(
"cont_list_files",
627 $this->ctrl->getLinkTargetByClass(
"ilfilesystemgui",
"listFiles"),
"",
629 $ilCtrl->setParameterByClass(
"ilfilesystemgui",
"resetoffset",
"");
632 $force_active = ($this->ctrl->getNextClass() ==
"ilinfoscreengui")
635 $tabs_gui->addTarget(
"info_short",
636 $this->ctrl->getLinkTargetByClass(
"ilinfoscreengui",
"showSummary"),
"",
637 "ilinfoscreengui",
"", $force_active);
640 $tabs_gui->addTarget(
"settings",
641 $this->ctrl->getLinkTarget($this,
"properties"), array(
"",
"properties"),
645 include_once
'./Services/Tracking/classes/class.ilLearningProgressAccess.php';
649 if ($this->object->getSubType() ==
"scorm2004" || $this->
object->getSubType() ==
"scorm") {
650 if ($this->object->getOfflineMode() ==
true) {
651 $tabs_gui->addTarget(
"offline_mode_manager",
652 $this->ctrl->getLinkTarget($this,
"offlineModeManager"),
653 "offlineModeManager",
654 "ilobjscormlearningmodulegui");
658 $tabs_gui->addTarget(
'learning_progress',
659 $this->ctrl->getLinkTargetByClass(array(
'illearningprogressgui'),
''),
661 array(
'illplistofobjectsgui',
'illplistofsettingsgui',
'illearningprogressgui',
'illplistofprogressgui'));
664 include_once(
'./Services/PrivacySecurity/classes/class.ilPrivacySettings.php');
666 if($privacy->enabledSahsProtocolData())
669 $tabs_gui->addTarget(
"cont_tracking_data",
670 $this->ctrl->getLinkTarget($this,
"showTrackingItems"),
"showTrackingItems",
675 include_once
"Services/Certificate/classes/class.ilCertificate.php";
679 switch ($this->object->getSubType())
685 $tabs_gui->addTarget(
"certificate",
686 $this->ctrl->getLinkTarget($this,
"certificate"),
687 array(
"certificate",
"certificateEditor",
"certificateRemoveBackground",
"certificateSave",
688 "certificatePreview",
"certificateDelete",
"certificateUpload",
"certificateImport")
694 include_once(
"Services/License/classes/class.ilLicenseAccess.php");
695 if ($rbacsystem->checkAccess(
'edit_permission',$this->object->getRefId())
698 $tabs_gui->addTarget(
"license",
699 $this->ctrl->getLinkTargetByClass(
'illicensegui',
''),
704 $tabs_gui->addTarget(
"meta_data",
705 $this->ctrl->getLinkTargetByClass(
'ilmdeditorgui',
''),
706 "",
"ilmdeditorgui");
709 if ($rbacsystem->checkAccess(
'edit_permission',$this->object->getRefId()))
711 $tabs_gui->addTarget(
"perm_settings",
712 $this->ctrl->getLinkTargetByClass(array(get_class($this),
'ilpermissiongui'),
"perm"), array(
"perm",
"info",
"owner"),
'ilpermissiongui');
723 $parts = explode(
"_", $a_target);
725 if ($ilAccess->checkAccess(
"write",
"", $parts[0]))
728 $_GET[
"baseClass"] =
"ilSAHSEditGUI";
729 $_GET[
"ref_id"] = $parts[0];
730 $_GET[
"obj_id"] = $parts[1];
731 include(
"ilias.php");
734 if ($ilAccess->checkAccess(
"visible",
"", $parts[0]))
736 $_GET[
"cmd"] =
"infoScreen";
737 $_GET[
"baseClass"] =
"ilSAHSPresentationGUI";
738 $_GET[
"ref_id"] = $parts[0];
739 include(
"ilias.php");
744 if ($ilAccess->checkAccess(
"read",
"", ROOT_FOLDER_ID))
752 $ilErr->raiseError($lng->txt(
"msg_no_perm_read"), $ilErr->FATAL);
759 if (is_object($this->
object))
761 $ilLocator->addItem($this->object->getTitle(),
762 $this->ctrl->getLinkTargetByClass(
"ilinfoscreengui",
"showSummary"),
"",
$_GET[
"ref_id"]);
776 if (!$this->object->getEditable())
778 $ilCtrl->redirectByClass(
"ilfilesystemgui",
"listFiles");
782 $ilCtrl->redirectByClass(
"ilobjscorm2004learningmodulegui",
"editOrganization");