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" ||
42 strtolower(
$_GET[
"baseClass"]) ==
"ilsahspresentationgui" ||
53 $this->tpl->setTitle($this->object->getTitle());
56 $next_class = $this->ctrl->getNextClass($this);
57 $cmd = $this->ctrl->getCmd();
62 if(!$ilAccess->checkAccess(
'write',
'',$this->object->getRefId()))
64 $ilErr->raiseError($this->lng->txt(
'permission_denied'),$ilErr->WARNING);
67 include_once
'Services/MetaData/classes/class.ilMDEditorGUI.php';
69 $md_gui =&
new ilMDEditorGUI($this->object->getId(), 0, $this->
object->getType());
70 $md_gui->
addObserver($this->
object,
'MDUpdateListener',
'General');
72 $this->ctrl->forwardCommand($md_gui);
75 case 'ilpermissiongui':
76 include_once(
"Services/AccessControl/classes/class.ilPermissionGUI.php");
78 $ret =& $this->ctrl->forwardCommand($perm_gui);
81 case "ilfilesystemgui":
82 $this->fs_gui =&
new ilFileSystemGUI($this->object->getDataDirectory());
84 $this->fs_gui->setTableId(
"sahsfs".$this->object->getId());
85 $ret =& $this->ctrl->forwardCommand($this->fs_gui);
88 case "ilcertificategui":
90 $ilTabs->setSubTabActive(
'certificate');
91 include_once
"./Services/Certificate/classes/class.ilCertificateGUI.php";
92 include_once
"./Modules/ScormAicc/classes/class.ilSCORMCertificateAdapter.php";
94 $ret =& $this->ctrl->forwardCommand($output_gui);
97 case "illearningprogressgui":
98 include_once
'./Services/Tracking/classes/class.ilLearningProgressGUI.php';
101 $this->ctrl->forwardCommand($new_gui);
106 include_once(
"./Services/License/classes/class.ilLicenseGUI.php");
108 $ret =& $this->ctrl->forwardCommand($license_gui);
111 case "ilinfoscreengui":
112 include_once(
"./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
115 $info->enablePrivateNotes();
116 $info->enableLearningProgress();
119 if ($ilAccess->checkAccess(
"read",
"",
$_GET[
"ref_id"]))
121 if (!$this->object->getEditable())
123 $info->addButton($this->lng->txt(
"view"),
124 "ilias.php?baseClass=ilSAHSPresentationGUI&ref_id=".$this->object->getRefID(),
125 ' target="ilContObj'.$this->object->getId().
'" ');
130 if ($ilAccess->checkAccess(
"write",
"",
$_GET[
"ref_id"]))
132 $info->enableNewsEditing();
134 $enable_internal_rss = $news_set->get(
"enable_rss_for_internal");
135 if ($enable_internal_rss)
137 $info->setBlockProperty(
"news",
"settings",
true);
141 $info->addMetaDataSections($this->object->getId(),0, $this->
object->getType());
144 $this->ctrl->forwardCommand($info);
147 case "ilcommonactiondispatchergui":
148 include_once(
"Services/Object/classes/class.ilCommonActionDispatcherGUI.php");
150 $this->ctrl->forwardCommand($gui);
153 case "ilobjstylesheetgui":
155 $this->ctrl->setReturn($this,
"properties");
156 $ilTabs->clearTargets();
157 $style_gui =&
new ilObjStyleSheetGUI(
"", $this->object->getStyleSheetId(),
false,
false);
159 if (
$cmd ==
"create" ||
$_GET[
"new_type"]==
"sty")
161 $style_gui->setCreationMode(
true);
165 if (
$cmd ==
"confirmedDelete")
167 $this->
object->setStyleSheetId(0);
168 $this->
object->update();
170 $ret =& $this->ctrl->forwardCommand($style_gui);
171 if (
$cmd ==
"save" ||
$cmd ==
"copyStyle" ||
$cmd ==
"importStyle")
174 $this->
object->setStyleSheetId($style_id);
175 $this->
object->update();
176 $this->ctrl->redirectByClass(
"ilobjstylesheetgui",
"edit");
180 if ($this->
object && !$this->object->getEditable())
182 $cmd = $this->ctrl->getCmd(
"properties");
186 $cmd = $this->ctrl->getCmd(
"frameset");
188 if ((strtolower(
$_GET[
"baseClass"]) ==
"iladministrationgui" ||
196 if(
$cmd ==
"redrawHeaderAction")
209 if (strtolower(
$_GET[
"baseClass"]) ==
"iladministrationgui")
261 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
268 $ti->setRequired(
true);
269 $this->form->addItem($ti);
275 $this->form->addItem($ta);
278 $this->form->addCommandButton(
"save", $lng->txt(
"create"));
279 $this->form->addCommandButton(
"cancel", $lng->txt(
"cancel"));
281 $this->form->setTitle($lng->txt(
"scorm_new"));
282 $this->form->setFormAction($ilCtrl->getFormAction($this));
293 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
298 "scorm2004" => $lng->txt(
"lm_type_scorm2004"),
299 "scorm" => $lng->txt(
"lm_type_scorm"),
300 "aicc" => $lng->txt(
"lm_type_aicc"),
301 "hacp" => $lng->txt(
"lm_type_hacp")
305 $this->form->addItem($si);
308 $fi =
new ilFileInputGUI($this->lng->txt(
"select_file"),
"scormfile");
310 $this->form->addItem($fi);
315 include_once
'Services/FileSystem/classes/class.ilUploadFiles.php';
319 $fi->setRequired(
false);
321 $options[
""] = $this->lng->txt(
"cont_select_from_upload_dir");
322 foreach($files as
$file)
324 $file = htmlspecialchars($file, ENT_QUOTES,
"utf-8");
328 $si =
new ilSelectInputGUI($this->lng->txt(
"cont_uploaded_file"),
"uploaded_file");
330 $this->form->addItem($si);
338 $this->form->addItem($cb);
343 $cb->setInfo($this->lng->txt(
"sahs_authoring_mode_info"));
344 $this->form->addItem($cb);
349 $op1 =
new ilRadioOption($lng->txt(
"sahs_std_sequencing"), 0,$lng->txt(
"sahs_std_sequencing_info"));
350 $radg->addOption($op1);
351 $op1 =
new ilRadioOption($lng->txt(
"sahs_import_sequencing"), 1,$lng->txt(
"sahs_import_sequencing_info"));
352 $radg->addOption($op1);
356 $this->form->addCommandButton(
"upload", $lng->txt(
"import"));
357 $this->form->addCommandButton(
"cancel", $lng->txt(
"cancel"));
359 $this->form->setTitle($lng->txt(
"import_sahs"));
360 $this->form->setFormAction($ilCtrl->getFormAction($this,
"upload"));
372 global $_FILES, $rbacsystem;
374 include_once
'Services/FileSystem/classes/class.ilUploadFiles.php';
377 if (!$rbacsystem->checkAccess(
"create",
$_GET[
"ref_id"],
"sahs"))
379 $this->ilias->raiseError($this->lng->txt(
"no_create_permission"), $this->ilias->error_obj->WARNING);
381 elseif ($_FILES[
"scormfile"][
"name"])
384 $source = $_FILES[
"scormfile"][
"tmp_name"];
385 if (($source ==
'none') || (!$source))
387 $this->ilias->raiseError($this->lng->txt(
"msg_no_file"),$this->ilias->error_obj->MESSAGE);
390 switch ($__FILES[
"scormfile"][
"error"])
392 case UPLOAD_ERR_INI_SIZE:
393 $this->ilias->raiseError($this->lng->txt(
"err_max_file_size_exceeds"),$this->ilias->error_obj->MESSAGE);
396 case UPLOAD_ERR_FORM_SIZE:
397 $this->ilias->raiseError($this->lng->txt(
"err_max_file_size_exceeds"),$this->ilias->error_obj->MESSAGE);
400 case UPLOAD_ERR_PARTIAL:
401 $this->ilias->raiseError($this->lng->txt(
"err_partial_file_upload"),$this->ilias->error_obj->MESSAGE);
404 case UPLOAD_ERR_NO_FILE:
405 $this->ilias->raiseError($this->lng->txt(
"err_no_file_uploaded"),$this->ilias->error_obj->MESSAGE);
409 $file = pathinfo($_FILES[
"scormfile"][
"name"]);
411 elseif (
$_POST[
"uploaded_file"])
416 $this->ilias->raiseError($this->lng->txt(
"upload_error_file_not_found"),$this->ilias->error_obj->MESSAGE);
423 $this->ilias->raiseError($this->lng->txt(
"msg_no_file"),$this->ilias->error_obj->MESSAGE);
426 $name = substr(
$file[
"basename"], 0, strlen(
$file[
"basename"]) - strlen(
$file[
"extension"]) - 1);
429 $name = $this->lng->txt(
"no_title");
433 switch (
$_POST[
"sub_type"])
437 include_once(
"./Modules/Scorm2004/classes/class.ilObjSCORM2004LearningModule.php");
439 $newObj->setEditable(
$_POST[
"editable"]==
'y');
440 $newObj->setImportSequencing(
$_POST[
"import_sequencing"]);
441 $newObj->setSequencingExpertMode(
$_POST[
"import_sequencing"]);
445 include_once(
"./Modules/ScormAicc/classes/class.ilObjSCORMLearningModule.php");
450 include_once(
"./Modules/ScormAicc/classes/class.ilObjAICCLearningModule.php");
455 include_once(
"./Modules/ScormAicc/classes/class.ilObjHACPLearningModule.php");
460 $newObj->setTitle($name);
461 $newObj->setSubType(
$_POST[
"sub_type"]);
462 $newObj->setDescription(
"");
463 $newObj->create(
true);
464 $newObj->createReference();
465 $newObj->putInTree(
$_GET[
"ref_id"]);
466 $newObj->setPermissions(
$_GET[
"ref_id"]);
467 $newObj->notify(
"new",
$_GET[
"ref_id"],
$_GET[
"parent_non_rbac_id"],
$_GET[
"ref_id"],$newObj->getRefId());
470 $newObj->createDataDirectory();
472 if ($_FILES[
"scormfile"][
"name"])
475 $file_path = $newObj->getDataDirectory().
"/".$_FILES[
"scormfile"][
"name"];
478 $_FILES[
"scormfile"][
"name"], $file_path);
483 $file_path = $newObj->getDataDirectory().
"/".
$_POST[
"uploaded_file"];
491 $title = $newObj->readObject();
504 switch (
$_POST[
"sub_type"])
508 $newObj->setLearningProgressSettingsAtUpload();
514 ilUtil::redirect(
"ilias.php?baseClass=ilSAHSEditGUI&ref_id=".$newObj->getRefId());
529 if (trim(
$_POST[
"title"]) ==
"")
531 $this->ilias->raiseError($this->lng->txt(
"msg_no_title"),$this->ilias->error_obj->MESSAGE);
534 include_once(
"./Modules/Scorm2004/classes/class.ilObjSCORM2004LearningModule.php");
537 $newObj->setSubType(
"scorm2004");
538 $newObj->setEditable(
true);
541 $newObj->createReference();
542 $newObj->putInTree(
$_GET[
"ref_id"]);
543 $newObj->setPermissions(
$_GET[
"ref_id"]);
544 $newObj->notify(
"new",
$_GET[
"ref_id"],
$_GET[
"parent_non_rbac_id"],
$_GET[
"ref_id"],$newObj->getRefId());
545 $newObj->createDataDirectory();
546 $newObj->createScorm2004Tree();
548 ilUtil::redirect(
"ilias.php?baseClass=ilSAHSEditGUI&ref_id=".$newObj->getRefId());
565 $this->ownerObject();
575 $this->tpl->getStandardTemplate();
599 $this->tpl->setTitle($this->object->getTitle());
600 if(strtolower(
$_GET[
"baseClass"]) ==
"ilsahseditgui") $this->
getTabs($this->tabs_gui);
608 include_once
"./Services/Certificate/classes/class.ilCertificateGUI.php";
609 include_once
"./Modules/ScormAicc/classes/class.ilSCORMCertificateAdapter.php";
611 $output_gui->certificateEditor();
623 if ($this->ctrl->getCmd() ==
"delete")
628 switch ($this->object->getSubType())
631 $ilHelp->setScreenIdComponent(
"sahs13");
635 $ilHelp->setScreenIdComponent(
"sahs12");
641 $ilCtrl->setParameterByClass(
"ilfilesystemgui",
"resetoffset", 1);
642 $tabs_gui->addTarget(
"cont_list_files",
643 $this->ctrl->getLinkTargetByClass(
"ilfilesystemgui",
"listFiles"),
"",
645 $ilCtrl->setParameterByClass(
"ilfilesystemgui",
"resetoffset",
"");
648 $force_active = ($this->ctrl->getNextClass() ==
"ilinfoscreengui")
651 $tabs_gui->addTarget(
"info_short",
652 $this->ctrl->getLinkTargetByClass(
"ilinfoscreengui",
"showSummary"),
"",
653 "ilinfoscreengui",
"", $force_active);
656 $tabs_gui->addTarget(
"settings",
657 $this->ctrl->getLinkTarget($this,
"properties"), array(
"",
"properties"),
661 include_once
'./Services/Tracking/classes/class.ilLearningProgressAccess.php';
665 if ($this->object->getSubType() ==
"scorm2004" || $this->
object->getSubType() ==
"scorm") {
666 if ($this->object->getOfflineMode() ==
true) {
667 $tabs_gui->addTarget(
"offline_mode_manager",
668 $this->ctrl->getLinkTarget($this,
"offlineModeManager"),
669 "offlineModeManager",
670 "ilobjscormlearningmodulegui");
674 $tabs_gui->addTarget(
'learning_progress',
675 $this->ctrl->getLinkTargetByClass(array(
'illearningprogressgui'),
''),
677 array(
'illplistofobjectsgui',
'illplistofsettingsgui',
'illearningprogressgui',
'illplistofprogressgui'));
681 if($rbacsystem->checkAccess(
"read_learning_progress", $this->object->getRefId()) || $rbacsystem->checkAccess(
"edit_learning_progress", $this->object->getRefId()))
683 if ($this->object->getSubType() ==
"scorm2004" || $this->
object->getSubType() ==
"scorm") {
684 include_once(
'./Services/PrivacySecurity/classes/class.ilPrivacySettings.php');
686 if($privacy->enabledSahsProtocolData())
688 $tabs_gui->addTarget(
"cont_tracking_data",
689 $this->ctrl->getLinkTarget($this,
"showTrackingItems"),
"showTrackingItems",
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');
719 public static function _goto($a_target)
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");
793 $ilTabs->addSubTabTarget(
"cont_settings",
794 $this->ctrl->getLinkTarget($this,
"properties"), array(
"edit",
""),
797 $ilTabs->addSubTabTarget(
"cont_sc_new_version",
798 $this->ctrl->getLinkTarget($this,
"newModuleVersion"), array(
"edit",
""),
801 include_once
"Services/Certificate/classes/class.ilCertificate.php";
810 $ilTabs->addSubTabTarget(
812 $this->ctrl->getLinkTargetByClass(
"ilcertificategui",
"certificateeditor"),
813 "",
"ilcertificategui");
816 $ilTabs->setTabActive(
'settings');