24 require_once
"classes/class.ilObjectGUI.php";
25 require_once(
"classes/class.ilFileSystemGUI.php");
26 require_once(
"classes/class.ilTabsGUI.php");
50 $lng->loadLanguageModule(
"content");
52 $this->
ilObjectGUI($a_data,$a_id,$a_call_by_reference,
false);
53 #$this->tabs_gui =& new ilTabsGUI();
62 global $ilAccess, $ilTabs;
64 if (strtolower(
$_GET[
"baseClass"]) ==
"iladministrationgui" ||
76 $next_class = $this->ctrl->getNextClass($this);
77 $cmd = $this->ctrl->getCmd();
83 include_once
'Services/MetaData/classes/class.ilMDEditorGUI.php';
85 $md_gui =&
new ilMDEditorGUI($this->object->getId(), 0, $this->
object->getType());
86 $md_gui->
addObserver($this->
object,
'MDUpdateListener',
'General');
88 $this->ctrl->forwardCommand($md_gui);
91 case 'ilpermissiongui':
92 include_once(
"Services/AccessControl/classes/class.ilPermissionGUI.php");
94 $ret =& $this->ctrl->forwardCommand($perm_gui);
97 case "ilfilesystemgui":
98 $this->fs_gui =&
new ilFileSystemGUI($this->object->getDataDirectory());
99 $this->fs_gui->
setTableId(
"sahsfs".$this->object->getId());
100 $ret =& $this->ctrl->forwardCommand($this->fs_gui);
103 case "ilcertificategui":
104 include_once
"./Services/Certificate/classes/class.ilCertificateGUI.php";
105 include_once
"./Modules/ScormAicc/classes/class.ilSCORMCertificateAdapter.php";
107 $ret =& $this->ctrl->forwardCommand($output_gui);
110 case "illearningprogressgui":
111 include_once
'./Services/Tracking/classes/class.ilLearningProgressGUI.php';
114 $this->ctrl->forwardCommand($new_gui);
119 include_once(
"./Services/License/classes/class.ilLicenseGUI.php");
121 $ret =& $this->ctrl->forwardCommand($license_gui);
124 case "ilinfoscreengui":
125 include_once(
"./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
128 $info->enablePrivateNotes();
129 $info->enableLearningProgress();
132 if ($ilAccess->checkAccess(
"read",
"",
$_GET[
"ref_id"]))
134 if (!$this->object->getEditable())
136 $info->addButton($this->lng->txt(
"view"),
137 "ilias.php?baseClass=ilSAHSPresentationGUI&ref_id=".$this->object->getRefID(),
138 ' target="ilContObj'.$this->object->getId().
'" ');
143 if ($ilAccess->checkAccess(
"write",
"",
$_GET[
"ref_id"]))
145 $info->enableNewsEditing();
147 $enable_internal_rss = $news_set->get(
"enable_rss_for_internal");
148 if ($enable_internal_rss)
150 $info->setBlockProperty(
"news",
"settings",
true);
154 $info->addMetaDataSections($this->object->getId(),0, $this->
object->getType());
157 $this->ctrl->forwardCommand($info);
160 case "ilobjstylesheetgui":
162 $this->ctrl->setReturn($this,
"editStyleProperties");
163 $ilTabs->clearTargets();
164 $style_gui =&
new ilObjStyleSheetGUI(
"", $this->object->getStyleSheetId(),
false,
false);
166 if (
$cmd ==
"create" ||
$_GET[
"new_type"]==
"sty")
168 $style_gui->setCreationMode(
true);
172 if (
$cmd ==
"confirmedDelete")
174 $this->
object->setStyleSheetId(0);
175 $this->
object->update();
177 $ret =& $this->ctrl->forwardCommand($style_gui);
178 if (
$cmd ==
"save" ||
$cmd ==
"copyStyle" ||
$cmd ==
"importStyle")
181 $this->
object->setStyleSheetId($style_id);
182 $this->
object->update();
183 $this->ctrl->redirectByClass(
"ilobjstylesheetgui",
"edit");
187 $cmd = $this->ctrl->getCmd(
"frameset");
188 if ((strtolower(
$_GET[
"baseClass"]) ==
"iladministrationgui" ||
203 if (strtolower(
$_GET[
"baseClass"]) ==
"iladministrationgui")
235 $this->ctrl->setParameter($this,
"new_type",
"sahs");
237 $html = $this->form->getHTML();
239 $html.=
"<br />".$this->form->getHTML();
240 $this->tpl->setContent($html);
242 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.slm_create.html",
"Modules/ScormAicc");
246 $this->tpl->setVariable(
"ALT_IMG", $this->lng->txt(
"obj_sahs"));
248 $this->ctrl->setParameter($this,
"new_type",
"sahs");
249 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
250 $this->tpl->setVariable(
"CMD_SUBMIT",
"save");
252 $this->tpl->setVariable(
"TXT_HEADER", $this->lng->txt(
"scorm_new"));
253 $this->tpl->setVariable(
"TXT_TITLE", $this->lng->txt(
"title"));
254 $this->tpl->setVariable(
"TXT_DESC", $this->lng->txt(
"desc"));
255 $this->tpl->setVariable(
"TXT_SUBMIT", $this->lng->txt(
"scorm_add"));
257 $this->tpl->setVariable(
"BTN_NAME",
"upload");
260 $this->tpl->setVariable(
"TXT_SELECT_LMTYPE", $this->lng->txt(
"type"));
261 $this->tpl->setVariable(
"TXT_TYPE_AICC", $this->lng->txt(
"lm_type_aicc"));
262 $this->tpl->setVariable(
"TXT_TYPE_HACP", $this->lng->txt(
"lm_type_hacp"));
263 $this->tpl->setVariable(
"TXT_TYPE_SCORM", $this->lng->txt(
"lm_type_scorm"));
265 $this->tpl->setVariable(
"TXT_TYPE_SCORM2004", $this->lng->txt(
"lm_type_scorm2004"));
267 $this->tpl->setVariable(
"TXT_UPLOAD", $this->lng->txt(
"upload"));
268 $this->tpl->setVariable(
"TXT_CANCEL", $this->lng->txt(
"cancel"));
269 $this->tpl->setVariable(
"TXT_IMPORT_LM", $this->lng->txt(
"import_sahs"));
270 $this->tpl->setVariable(
"TXT_SELECT_FILE", $this->lng->txt(
"select_file"));
271 $this->tpl->setVariable(
"TXT_VALIDATE_FILE", $this->lng->txt(
"cont_validate_file"));
272 $this->tpl->setVariable(
"TXT_EDITABLE_LM", $this->lng->txt(
"scorm_editable"));
273 $this->tpl->setVariable(
"TXT_EDITABLE_LM_COMMENTS", $this->lng->txt(
"scorm_editable_comments"));
277 $umf=get_cfg_var(
"upload_max_filesize");
279 $pms=get_cfg_var(
"post_max_size");
282 $multiplier_a=array(
"K"=>1024,
"M"=>1024*1024,
"G"=>1024*1024*1024);
284 $umf_parts=preg_split(
"/(\d+)([K|G|M])/", $umf, -1, PREG_SPLIT_DELIM_CAPTURE|PREG_SPLIT_NO_EMPTY);
285 $pms_parts=preg_split(
"/(\d+)([K|G|M])/", $pms, -1, PREG_SPLIT_DELIM_CAPTURE|PREG_SPLIT_NO_EMPTY);
287 if (count($umf_parts) == 2) { $umf = $umf_parts[0]*$multiplier_a[$umf_parts[1]]; }
288 if (count($pms_parts) == 2) { $pms = $pms_parts[0]*$multiplier_a[$pms_parts[1]]; }
291 $max_filesize=min($umf, $pms);
293 if (!$max_filesize) $max_filesize=max($umf, $pms);
296 $max_filesize=sprintf(
"%.1f MB",$max_filesize/1024/1024);
299 $this->tpl->setVariable(
"TXT_FILE_INFO", $this->lng->txt(
"file_notice").
" $max_filesize");
301 include_once
'Services/FileSystemStorage/classes/class.ilUploadFiles.php';
307 $file = htmlspecialchars($file, ENT_QUOTES,
"utf-8");
308 $this->tpl->setCurrentBlock(
"option_uploaded_file");
309 $this->tpl->setVariable(
"UPLOADED_FILENAME", $file);
310 $this->tpl->setVariable(
"TXT_UPLOADED_FILENAME", $file);
311 $this->tpl->parseCurrentBlock();
313 $this->tpl->setCurrentBlock(
"select_uploaded_file");
314 $this->tpl->setVariable(
"TXT_SELECT_FROM_UPLOAD_DIR", $this->lng->txt(
"cont_select_from_upload_dir"));
315 $this->tpl->setVariable(
"TXT_UPLOADED_FILE", $this->lng->txt(
"cont_uploaded_file"));
316 $this->tpl->parseCurrentBlock();
331 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
338 $ti->setRequired(
true);
339 $this->form->addItem($ti);
345 $this->form->addItem($ta);
348 $this->form->addCommandButton(
"save", $lng->txt(
"create"));
349 $this->form->addCommandButton(
"cancel", $lng->txt(
"cancel"));
351 $this->form->setTitle($lng->txt(
"scorm_new"));
352 $this->form->setFormAction($ilCtrl->getFormAction($this));
363 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
368 "scorm2004" => $lng->txt(
"lm_type_scorm2004"),
369 "scorm" => $lng->txt(
"lm_type_scorm"),
370 "aicc" => $lng->txt(
"lm_type_aicc"),
371 "hacp" => $lng->txt(
"lm_type_hacp")
375 $this->form->addItem($si);
378 $fi =
new ilFileInputGUI($this->lng->txt(
"select_file"),
"scormfile");
380 $this->form->addItem($fi);
385 include_once
'Services/FileSystemStorage/classes/class.ilUploadFiles.php';
389 $fi->setRequired(
false);
391 $options[
""] = $this->lng->txt(
"cont_select_from_upload_dir");
394 $file = htmlspecialchars($file, ENT_QUOTES,
"utf-8");
398 $si =
new ilSelectInputGUI($this->lng->txt(
"cont_uploaded_file"),
"uploaded_file");
400 $this->form->addItem($si);
407 $cb->setChecked(
true);
408 $this->form->addItem($cb);
413 $cb->setInfo($this->lng->txt(
"scorm_editable_comments"));
414 $this->form->addItem($cb);
417 $this->form->addCommandButton(
"upload", $lng->txt(
"import"));
418 $this->form->addCommandButton(
"cancel", $lng->txt(
"cancel"));
420 $this->form->setTitle($lng->txt(
"import_sahs"));
421 $this->form->setFormAction($ilCtrl->getFormAction($this));
503 global $_FILES, $rbacsystem;
505 include_once
'Services/FileSystemStorage/classes/class.ilUploadFiles.php';
508 if (!$rbacsystem->checkAccess(
"create",
$_GET[
"ref_id"],
"sahs"))
510 $this->ilias->raiseError($this->lng->txt(
"no_create_permission"), $this->ilias->error_obj->WARNING);
512 elseif ($_FILES[
"scormfile"][
"name"])
515 $source = $_FILES[
"scormfile"][
"tmp_name"];
516 if (($source ==
'none') || (!$source))
518 $this->ilias->raiseError($this->lng->txt(
"msg_no_file"),$this->ilias->error_obj->MESSAGE);
521 switch ($__FILES[
"scormfile"][
"error"])
523 case UPLOAD_ERR_INI_SIZE:
524 $this->ilias->raiseError($this->lng->txt(
"err_max_file_size_exceeds"),$this->ilias->error_obj->MESSAGE);
527 case UPLOAD_ERR_FORM_SIZE:
528 $this->ilias->raiseError($this->lng->txt(
"err_max_file_size_exceeds"),$this->ilias->error_obj->MESSAGE);
531 case UPLOAD_ERR_PARTIAL:
532 $this->ilias->raiseError($this->lng->txt(
"err_partial_file_upload"),$this->ilias->error_obj->MESSAGE);
535 case UPLOAD_ERR_NO_FILE:
536 $this->ilias->raiseError($this->lng->txt(
"err_no_file_uploaded"),$this->ilias->error_obj->MESSAGE);
540 $file = pathinfo($_FILES[
"scormfile"][
"name"]);
542 elseif (
$_POST[
"uploaded_file"])
547 $this->ilias->raiseError($this->lng->txt(
"upload_error_file_not_found"),$this->ilias->error_obj->MESSAGE);
554 $this->ilias->raiseError($this->lng->txt(
"msg_no_file"),$this->ilias->error_obj->MESSAGE);
557 $name = substr(
$file[
"basename"], 0, strlen(
$file[
"basename"]) - strlen(
$file[
"extension"]) - 1);
560 $name = $this->lng->txt(
"no_title");
564 switch (
$_POST[
"sub_type"])
568 include_once(
"./Modules/Scorm2004/classes/class.ilObjSCORM2004LearningModule.php");
570 $newObj->setEditable(
$_POST[
"editable"]==
'y');
574 include_once(
"./Modules/ScormAicc/classes/class.ilObjSCORMLearningModule.php");
579 include_once(
"./Modules/ScormAicc/classes/class.ilObjAICCLearningModule.php");
584 include_once(
"./Modules/ScormAicc/classes/class.ilObjHACPLearningModule.php");
589 $newObj->setTitle($name);
590 $newObj->setSubType(
$_POST[
"sub_type"]);
591 $newObj->setDescription(
"");
592 $newObj->create(
true);
593 $newObj->createReference();
594 $newObj->putInTree(
$_GET[
"ref_id"]);
595 $newObj->setPermissions(
$_GET[
"ref_id"]);
596 $newObj->notify(
"new",
$_GET[
"ref_id"],
$_GET[
"parent_non_rbac_id"],
$_GET[
"ref_id"],$newObj->getRefId());
599 $newObj->createDataDirectory();
601 if ($_FILES[
"scormfile"][
"name"])
604 $file_path = $newObj->getDataDirectory().
"/".$_FILES[
"scormfile"][
"name"];
607 $_FILES[
"scormfile"][
"name"], $file_path);
612 $file_path = $newObj->getDataDirectory().
"/".
$_POST[
"uploaded_file"];
620 $title = $newObj->readObject();
633 ilUtil::redirect(
"ilias.php?baseClass=ilSAHSEditGUI&ref_id=".$newObj->getRefId());
648 if (trim(
$_POST[
"title"]) ==
"")
650 $this->ilias->raiseError($this->lng->txt(
"msg_no_title"),$this->ilias->error_obj->MESSAGE);
653 include_once(
"./Modules/Scorm2004/classes/class.ilObjSCORM2004LearningModule.php");
656 $newObj->setSubType(
"scorm2004");
657 $newObj->setEditable(
true);
660 $newObj->createReference();
661 $newObj->putInTree(
$_GET[
"ref_id"]);
662 $newObj->setPermissions(
$_GET[
"ref_id"]);
663 $newObj->notify(
"new",
$_GET[
"ref_id"],
$_GET[
"parent_non_rbac_id"],
$_GET[
"ref_id"],$newObj->getRefId());
664 $newObj->createDataDirectory();
665 $newObj->createScorm2004Tree();
667 ilUtil::redirect(
"ilias.php?baseClass=ilSAHSEditGUI&ref_id=".$newObj->getRefId());
684 $this->ownerObject();
694 $this->tpl->addBlockFile(
"CONTENT",
"content",
"tpl.adm_content.html");
696 $this->tpl->addBlockFile(
"STATUSLINE",
"statusline",
"tpl.statusline.html");
708 $this->tpl =
new ilTemplate(
"tpl.sahs_edit_frameset.html",
false,
false,
"Modules/ScormAicc");
709 $this->tpl->setVariable(
"SRC",
710 $this->ctrl->getLinkTarget($this,
"properties"));
711 $this->tpl->show(
"DEFAULT",
false);
720 $this->tpl->setCurrentBlock(
"header_image");
722 $this->tpl->parseCurrentBlock();
724 $this->
getTabs($this->tabs_gui);
725 #$this->tpl->setVariable("TABS", $this->tabs_gui->getHTML());
726 $this->tpl->setVariable(
"HEADER", $this->object->getTitle());
734 include_once
"./Services/Certificate/classes/class.ilCertificateGUI.php";
735 include_once
"./Modules/ScormAicc/classes/class.ilSCORMCertificateAdapter.php";
737 $output_gui->certificateEditor();
747 global $rbacsystem, $ilUser,
$ilCtrl;
749 if ($this->ctrl->getCmd() ==
"delete")
756 $ilCtrl->setParameterByClass(
"ilfilesystemgui",
"resetoffset", 1);
757 $tabs_gui->addTarget(
"cont_list_files",
758 $this->ctrl->getLinkTargetByClass(
"ilfilesystemgui",
"listFiles"),
"",
760 $ilCtrl->setParameterByClass(
"ilfilesystemgui",
"resetoffset",
"");
763 $force_active = ($this->ctrl->getNextClass() ==
"ilinfoscreengui")
766 $tabs_gui->addTarget(
"info_short",
767 $this->ctrl->getLinkTargetByClass(
"ilinfoscreengui",
"showSummary"),
"",
768 "ilinfoscreengui",
"", $force_active);
771 $tabs_gui->addTarget(
"settings",
772 $this->ctrl->getLinkTarget($this,
"properties"),
"properties",
776 include_once
'./Services/Tracking/classes/class.ilLearningProgressAccess.php';
779 $tabs_gui->addTarget(
'learning_progress',
780 $this->ctrl->getLinkTargetByClass(array(
'illearningprogressgui'),
''),
782 array(
'illplistofobjectsgui',
'illplistofsettingsgui',
'illearningprogressgui',
'illplistofprogressgui'));
786 $tabs_gui->addTarget(
"cont_tracking_data",
787 $this->ctrl->getLinkTarget($this,
"showTrackingItems"),
"showTrackingItems",
791 switch ($this->object->getSubType())
797 $tabs_gui->addTarget(
"certificate",
798 $this->ctrl->getLinkTarget($this,
"certificate"),
799 array(
"certificate",
"certificateEditor",
"certificateRemoveBackground",
"certificateSave",
800 "certificatePreview",
"certificateDelete",
"certificateUpload",
"certificateImport")
805 include_once(
"Services/License/classes/class.ilLicenseAccess.php");
806 if ($rbacsystem->checkAccess(
'edit_permission',$this->object->getRefId())
809 $tabs_gui->addTarget(
"license",
810 $this->ctrl->getLinkTargetByClass(
'illicensegui',
''),
815 $tabs_gui->addTarget(
"meta_data",
816 $this->ctrl->getLinkTargetByClass(
'ilmdeditorgui',
''),
817 "",
"ilmdeditorgui");
820 if ($rbacsystem->checkAccess(
'edit_permission',$this->object->getRefId()))
822 $tabs_gui->addTarget(
"perm_settings",
823 $this->ctrl->getLinkTargetByClass(array(get_class($this),
'ilpermissiongui'),
"perm"), array(
"perm",
"info",
"owner"),
'ilpermissiongui');
834 $parts = explode(
"_", $a_target);
836 if ($ilAccess->checkAccess(
"write",
"", $parts[0]))
839 $_GET[
"baseClass"] =
"ilSAHSEditGUI";
840 $_GET[
"ref_id"] = $parts[0];
841 $_GET[
"obj_id"] = $parts[1];
842 include(
"ilias.php");
845 if ($ilAccess->checkAccess(
"visible",
"", $parts[0]))
847 $_GET[
"cmd"] =
"infoScreen";
848 $_GET[
"baseClass"] =
"ilSAHSPresentationGUI";
849 $_GET[
"ref_id"] = $parts[0];
850 include(
"ilias.php");
855 if ($ilAccess->checkAccess(
"read",
"", ROOT_FOLDER_ID))
857 $_GET[
"cmd"] =
"frameset";
858 $_GET[
"target"] =
"";
859 $_GET[
"ref_id"] = ROOT_FOLDER_ID;
862 include(
"repository.php");
867 $ilErr->raiseError($lng->txt(
"msg_no_perm_read"), $ilErr->FATAL);
874 if (is_object($this->
object))
876 $ilLocator->addItem($this->object->getTitle(),
877 $this->ctrl->getLinkTargetByClass(
"ilinfoscreengui",
"showSummary"),
"",
$_GET[
"ref_id"]);