24 require_once
"classes/class.ilObjectGUI.php";
25 require_once(
"classes/class.ilFileSystemGUI.php");
26 require_once(
"classes/class.ilTabsGUI.php");
49 $lng->loadLanguageModule(
"content");
51 $this->
ilObjectGUI($a_data,$a_id,$a_call_by_reference,
false);
52 #$this->tabs_gui =& new ilTabsGUI();
63 if (strtolower(
$_GET[
"baseClass"]) ==
"iladministrationgui" ||
75 $next_class = $this->ctrl->getNextClass($this);
76 $cmd = $this->ctrl->getCmd();
82 include_once
'Services/MetaData/classes/class.ilMDEditorGUI.php';
84 $md_gui =&
new ilMDEditorGUI($this->object->getId(), 0, $this->
object->getType());
85 $md_gui->
addObserver($this->
object,
'MDUpdateListener',
'General');
87 $this->ctrl->forwardCommand($md_gui);
90 case 'ilpermissiongui':
91 include_once(
"./classes/class.ilPermissionGUI.php");
93 $ret =& $this->ctrl->forwardCommand($perm_gui);
96 case "ilfilesystemgui":
97 $this->fs_gui =&
new ilFileSystemGUI($this->object->getDataDirectory());
98 $ret =& $this->ctrl->forwardCommand($this->fs_gui);
101 case "illearningprogressgui":
102 include_once
'./Services/Tracking/classes/class.ilLearningProgressGUI.php';
105 $this->ctrl->forwardCommand($new_gui);
109 case "ilinfoscreengui":
110 include_once(
"./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
113 $info->enablePrivateNotes();
114 $info->enableLearningProgress();
117 if ($ilAccess->checkAccess(
"read",
"",
$_GET[
"ref_id"]))
119 $info->addButton($this->lng->txt(
"view"),
120 "ilias.php?baseClass=ilSAHSPresentationGUI&ref_id=".$this->object->getRefID(),
121 ' target="ilContObj'.$this->object->getId().
'" ');
125 if ($ilAccess->checkAccess(
"write",
"",
$_GET[
"ref_id"]))
127 $info->enableNewsEditing();
129 $enable_internal_rss = $news_set->get(
"enable_rss_for_internal");
130 if ($enable_internal_rss)
132 $info->setBlockProperty(
"news",
"settings",
true);
136 $info->addMetaDataSections($this->object->getId(),0, $this->
object->getType());
139 $this->ctrl->forwardCommand($info);
143 $cmd = $this->ctrl->getCmd(
"frameset");
144 if ((strtolower(
$_GET[
"baseClass"]) ==
"iladministrationgui" ||
151 $ret =& $this->
$cmd();
159 if (strtolower(
$_GET[
"baseClass"]) ==
"iladministrationgui")
199 $this->tpl->addBlockFile(
"ADM_CONTENT",
"adm_content",
"tpl.slm_import.html",
"Modules/ScormAicc");
202 $this->tpl->setVariable(
"ALT_IMG", $this->lng->txt(
"obj_sahs"));
204 $this->ctrl->setParameter($this,
"new_type",
"sahs");
205 $this->tpl->setVariable(
"FORMACTION", $this->ctrl->getFormAction($this));
207 $this->tpl->setVariable(
"BTN_NAME",
"save");
208 $this->tpl->setVariable(
"TARGET",
' target="'.
211 $this->tpl->setVariable(
"TXT_SELECT_LMTYPE", $this->lng->txt(
"type"));
212 $this->tpl->setVariable(
"TXT_TYPE_AICC", $this->lng->txt(
"lm_type_aicc"));
213 $this->tpl->setVariable(
"TXT_TYPE_HACP", $this->lng->txt(
"lm_type_hacp"));
214 $this->tpl->setVariable(
"TXT_TYPE_SCORM", $this->lng->txt(
"lm_type_scorm"));
216 $this->tpl->setVariable(
"TXT_TYPE_SCORM2004", $this->lng->txt(
"lm_type_scorm2004"));
218 $this->tpl->setVariable(
"TXT_UPLOAD", $this->lng->txt(
"upload"));
219 $this->tpl->setVariable(
"TXT_CANCEL", $this->lng->txt(
"cancel"));
220 $this->tpl->setVariable(
"TXT_IMPORT_LM", $this->lng->txt(
"import_sahs"));
221 $this->tpl->setVariable(
"TXT_SELECT_FILE", $this->lng->txt(
"select_file"));
222 $this->tpl->setVariable(
"TXT_VALIDATE_FILE", $this->lng->txt(
"cont_validate_file"));
225 $umf=get_cfg_var(
"upload_max_filesize");
227 $pms=get_cfg_var(
"post_max_size");
230 $multiplier_a=array(
"K"=>1024,
"M"=>1024*1024,
"G"=>1024*1024*1024);
232 $umf_parts=preg_split(
"/(\d+)([K|G|M])/", $umf, -1, PREG_SPLIT_DELIM_CAPTURE|PREG_SPLIT_NO_EMPTY);
233 $pms_parts=preg_split(
"/(\d+)([K|G|M])/", $pms, -1, PREG_SPLIT_DELIM_CAPTURE|PREG_SPLIT_NO_EMPTY);
235 if (count($umf_parts) == 2) { $umf = $umf_parts[0]*$multiplier_a[$umf_parts[1]]; }
236 if (count($pms_parts) == 2) { $pms = $pms_parts[0]*$multiplier_a[$pms_parts[1]]; }
239 $max_filesize=min($umf, $pms);
241 if (!$max_filesize) $max_filesize=max($umf, $pms);
244 $max_filesize=sprintf(
"%.1f MB",$max_filesize/1024/1024);
247 $this->tpl->setVariable(
"TXT_FILE_INFO", $this->lng->txt(
"file_notice").
" $max_filesize");
258 global $_FILES, $rbacsystem;
261 $source = $_FILES[
"scormfile"][
"tmp_name"];
262 if (($source ==
'none') || (!$source))
264 $this->ilias->raiseError(
"No file selected!",$this->ilias->error_obj->MESSAGE);
267 if (!$rbacsystem->checkAccess(
"create",
$_GET[
"ref_id"],
"sahs"))
269 $this->ilias->raiseError($this->lng->txt(
"no_create_permission"), $this->ilias->error_obj->WARNING);
272 switch ($__FILES[
"scormfile"][
"error"])
274 case UPLOAD_ERR_INI_SIZE:
275 $this->ilias->raiseError($this->lng->txt(
"err_max_file_size_exceeds"),$this->ilias->error_obj->MESSAGE);
278 case UPLOAD_ERR_FORM_SIZE:
279 $this->ilias->raiseError($this->lng->txt(
"err_max_file_size_exceeds"),$this->ilias->error_obj->MESSAGE);
282 case UPLOAD_ERR_PARTIAL:
283 $this->ilias->raiseError($this->lng->txt(
"err_partial_file_upload"),$this->ilias->error_obj->MESSAGE);
286 case UPLOAD_ERR_NO_FILE:
287 $this->ilias->raiseError($this->lng->txt(
"err_no_file_uploaded"),$this->ilias->error_obj->MESSAGE);
291 $file = pathinfo($_FILES[
"scormfile"][
"name"]);
292 $name = substr(
$file[
"basename"], 0, strlen(
$file[
"basename"]) - strlen(
$file[
"extension"]) - 1);
295 $name = $this->lng->txt(
"no_title");
299 switch ($_POST[
"sub_type"])
303 include_once(
"./Modules/Scorm2004/classes/class.ilObjSCORM2004LearningModule.php");
308 include_once(
"./Modules/ScormAicc/classes/class.ilObjSCORMLearningModule.php");
313 include_once(
"./Modules/ScormAicc/classes/class.ilObjAICCLearningModule.php");
318 include_once(
"./Modules/ScormAicc/classes/class.ilObjHACPLearningModule.php");
323 $newObj->setTitle($name);
324 $newObj->setSubType($_POST[
"sub_type"]);
325 $newObj->setDescription(
"");
327 $newObj->createReference();
328 $newObj->putInTree(
$_GET[
"ref_id"]);
329 $newObj->setPermissions(
$_GET[
"ref_id"]);
330 $newObj->notify(
"new",
$_GET[
"ref_id"],
$_GET[
"parent_non_rbac_id"],
$_GET[
"ref_id"],$newObj->getRefId());
333 $newObj->createDataDirectory();
336 $file_path = $newObj->getDataDirectory().
"/".$_FILES[
"scormfile"][
"name"];
339 $_FILES[
"scormfile"][
"name"], $file_path);
346 $title = $newObj->readObject();
350 $md =
new ilMD($newObj->getId(),0, $newObj->getType());
351 if(is_object($md_gen = $md->getGeneral()))
353 $md_gen->setTitle($title);
359 ilUtil::redirect(
"ilias.php?baseClass=ilSAHSEditGUI&ref_id=".$newObj->getRefId());
401 $this->tpl->addBlockFile(
"CONTENT",
"content",
"tpl.adm_content.html");
403 $this->tpl->addBlockFile(
"STATUSLINE",
"statusline",
"tpl.statusline.html");
415 $this->tpl =
new ilTemplate(
"tpl.sahs_edit_frameset.html",
false,
false,
"Modules/ScormAicc");
416 $this->tpl->setVariable(
"SRC",
417 $this->ctrl->getLinkTarget($this,
"properties"));
418 $this->tpl->show(
"DEFAULT",
false);
427 $this->tpl->setCurrentBlock(
"header_image");
429 $this->tpl->parseCurrentBlock();
431 $this->
getTabs($this->tabs_gui);
432 #$this->tpl->setVariable("TABS", $this->tabs_gui->getHTML());
433 $this->tpl->setVariable(
"HEADER", $this->object->getTitle());
443 global $rbacsystem,$ilUser;
445 if ($this->ctrl->getCmd() ==
"delete")
451 $force_active = ($this->ctrl->getNextClass() ==
"ilinfoscreengui")
454 $tabs_gui->addTarget(
"info_short",
455 $this->ctrl->getLinkTargetByClass(
"ilinfoscreengui",
"showSummary"),
"",
456 "ilinfoscreengui",
"", $force_active);
459 $tabs_gui->addTarget(
"properties",
460 $this->ctrl->getLinkTarget($this,
"properties"),
"properties",
465 $tabs_gui->addTarget(
"cont_list_files",
466 $this->ctrl->getLinkTargetByClass(
"ilfilesystemgui",
"listFiles"),
"",
470 $tabs_gui->addTarget(
"cont_tracking_data",
471 $this->ctrl->getLinkTarget($this,
"showTrackingItems"),
"showTrackingItems",
480 $tabs_gui->addTarget(
"meta_data",
481 $this->ctrl->getLinkTargetByClass(
'ilmdeditorgui',
''),
482 "",
"ilmdeditorgui");
485 include_once
'./Services/Tracking/classes/class.ilLearningProgressAccess.php';
488 $tabs_gui->addTarget(
'learning_progress',
489 $this->ctrl->getLinkTargetByClass(array(
'illearningprogressgui'),
''),
491 array(
'illplistofobjectsgui',
'illplistofsettingsgui',
'illearningprogressgui',
'illplistofprogressgui'));
495 if ($rbacsystem->checkAccess(
'edit_permission',$this->object->getRefId()))
497 $tabs_gui->addTarget(
"perm_settings",
498 $this->ctrl->getLinkTargetByClass(array(get_class($this),
'ilpermissiongui'),
"perm"), array(
"perm",
"info",
"owner"),
'ilpermissiongui');
517 if ($ilAccess->checkAccess(
"visible",
"", $a_target))
519 $_GET[
"cmd"] =
"infoScreen";
520 $_GET[
"baseClass"] =
"ilSAHSPresentationGUI";
521 $_GET[
"ref_id"] = $a_target;
522 include(
"ilias.php");
527 if ($ilAccess->checkAccess(
"read",
"", ROOT_FOLDER_ID))
529 $_GET[
"cmd"] =
"frameset";
530 $_GET[
"target"] =
"";
531 $_GET[
"ref_id"] = ROOT_FOLDER_ID;
534 include(
"repository.php");
539 $ilErr->raiseError($lng->txt(
"msg_no_perm_read"), $ilErr->FATAL);
546 if (is_object($this->
object))
548 $ilLocator->addItem($this->object->getTitle(),
549 $this->ctrl->getLinkTargetByClass(
"ilinfoscreengui",
"showSummary"),
"",
$_GET[
"ref_id"]);