4require_once
"./Services/Object/classes/class.ilObjectGUI.php";
5require_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();
61 case 'ilobjectmetadatagui':
62 if(!$ilAccess->checkAccess(
'write',
'',$this->object->getRefId()))
64 $ilErr->raiseError($this->lng->txt(
'permission_denied'),
$ilErr->WARNING);
66 include_once
'Services/Object/classes/class.ilObjectMetaDataGUI.php';
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->setUseUploadDirectory(
true);
80 $this->fs_gui->setTableId(
"sahsfs".$this->object->getId());
81 $ret =& $this->ctrl->forwardCommand($this->fs_gui);
84 case "ilcertificategui":
86 $ilTabs->setSubTabActive(
'certificate');
87 include_once
"./Services/Certificate/classes/class.ilCertificateGUI.php";
88 include_once
"./Modules/ScormAicc/classes/class.ilSCORMCertificateAdapter.php";
90 $ret =& $this->ctrl->forwardCommand($output_gui);
93 case "illearningprogressgui":
94 include_once
'./Services/Tracking/classes/class.ilLearningProgressGUI.php';
97 $this->ctrl->forwardCommand($new_gui);
102 include_once(
"./Services/License/classes/class.ilLicenseGUI.php");
104 $ret =& $this->ctrl->forwardCommand($license_gui);
107 case "ilinfoscreengui":
108 include_once(
"./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
111 $info->enablePrivateNotes();
112 $info->enableLearningProgress();
115 if ($ilAccess->checkAccess(
"read",
"",
$_GET[
"ref_id"]))
117 if (!$this->object->getEditable())
119 $info->addButton($this->lng->txt(
"view"),
120 "ilias.php?baseClass=ilSAHSPresentationGUI&ref_id=".$this->object->getRefID(),
121 ' target="ilContObj'.$this->object->getId().
'" ');
126 if ($ilAccess->checkAccess(
"write",
"",
$_GET[
"ref_id"]))
128 $info->enableNewsEditing();
130 $enable_internal_rss = $news_set->get(
"enable_rss_for_internal");
131 if ($enable_internal_rss)
133 $info->setBlockProperty(
"news",
"settings",
true);
137 $info->addMetaDataSections($this->object->getId(),0, $this->object->getType());
140 $this->ctrl->forwardCommand(
$info);
143 case "ilcommonactiondispatchergui":
144 include_once(
"Services/Object/classes/class.ilCommonActionDispatcherGUI.php");
146 $this->ctrl->forwardCommand($gui);
149 case "ilobjstylesheetgui":
151 $this->ctrl->setReturn($this,
"properties");
152 $ilTabs->clearTargets();
153 $style_gui =&
new ilObjStyleSheetGUI(
"", $this->object->getStyleSheetId(),
false,
false);
154 $style_gui->omitLocator();
155 if (
$cmd ==
"create" ||
$_GET[
"new_type"]==
"sty")
157 $style_gui->setCreationMode(
true);
161 if (
$cmd ==
"confirmedDelete")
163 $this->
object->setStyleSheetId(0);
164 $this->
object->update();
166 $ret =& $this->ctrl->forwardCommand($style_gui);
167 if (
$cmd ==
"save" ||
$cmd ==
"copyStyle" ||
$cmd ==
"importStyle")
170 $this->
object->setStyleSheetId($style_id);
171 $this->
object->update();
172 $this->ctrl->redirectByClass(
"ilobjstylesheetgui",
"edit");
176 if ($this->
object && !$this->object->getEditable())
178 $cmd = $this->ctrl->getCmd(
"properties");
182 $cmd = $this->ctrl->getCmd(
"frameset");
184 if ((strtolower(
$_GET[
"baseClass"]) ==
"iladministrationgui" ||
192 if(
$cmd ==
"redrawHeaderAction")
205 if (strtolower(
$_GET[
"baseClass"]) ==
"iladministrationgui")
207 parent::viewObject();
257 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
264 $ti->setRequired(
true);
265 $this->form->addItem($ti);
271 $this->form->addItem($ta);
274 $this->form->addCommandButton(
"save",
$lng->txt(
"create"));
275 $this->form->addCommandButton(
"cancel",
$lng->txt(
"cancel"));
277 $this->form->setTitle(
$lng->txt(
"scorm_new"));
278 $this->form->setFormAction(
$ilCtrl->getFormAction($this));
289 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
294 "scorm2004" =>
$lng->txt(
"lm_type_scorm2004"),
295 "scorm" =>
$lng->txt(
"lm_type_scorm")
301 $this->form->addItem(
$si);
304 $fi =
new ilFileInputGUI($this->lng->txt(
"select_file"),
"scormfile");
305 $fi->setRequired(
true);
306 $this->form->addItem($fi);
311 include_once
'Services/FileSystem/classes/class.ilUploadFiles.php';
315 $fi->setRequired(
false);
317 $options[
""] = $this->lng->txt(
"cont_select_from_upload_dir");
318 foreach($files as
$file)
320 $file = htmlspecialchars(
$file, ENT_QUOTES,
"utf-8");
326 $this->form->addItem(
$si);
334 $this->form->addItem($cb);
339 $cb->setInfo($this->lng->txt(
"sahs_authoring_mode_info"));
340 $this->form->addItem($cb);
346 $radg->addOption($op1);
347 $op1 =
new ilRadioOption(
$lng->txt(
"sahs_import_sequencing"), 1,
$lng->txt(
"sahs_import_sequencing_info"));
348 $radg->addOption($op1);
349 $cb->addSubItem($radg);
352 $this->form->addCommandButton(
"upload",
$lng->txt(
"import"));
353 $this->form->addCommandButton(
"cancel",
$lng->txt(
"cancel"));
355 $this->form->setTitle(
$lng->txt(
"import_sahs"));
356 $this->form->setFormAction(
$ilCtrl->getFormAction($this,
"upload"));
368 global $_FILES, $rbacsystem;
370 include_once
'Services/FileSystem/classes/class.ilUploadFiles.php';
373 if (!$rbacsystem->checkAccess(
"create",
$_GET[
"ref_id"],
"sahs"))
375 $this->
ilias->raiseError($this->lng->txt(
"no_create_permission"), $this->ilias->error_obj->WARNING);
377 elseif ($_FILES[
"scormfile"][
"name"])
380 $source = $_FILES[
"scormfile"][
"tmp_name"];
381 if (($source ==
'none') || (!$source))
383 $this->
ilias->raiseError($this->lng->txt(
"msg_no_file"),$this->ilias->error_obj->MESSAGE);
386 switch ($__FILES[
"scormfile"][
"error"])
388 case UPLOAD_ERR_INI_SIZE:
389 $this->
ilias->raiseError($this->lng->txt(
"err_max_file_size_exceeds"),$this->ilias->error_obj->MESSAGE);
392 case UPLOAD_ERR_FORM_SIZE:
393 $this->
ilias->raiseError($this->lng->txt(
"err_max_file_size_exceeds"),$this->ilias->error_obj->MESSAGE);
396 case UPLOAD_ERR_PARTIAL:
397 $this->
ilias->raiseError($this->lng->txt(
"err_partial_file_upload"),$this->ilias->error_obj->MESSAGE);
400 case UPLOAD_ERR_NO_FILE:
401 $this->
ilias->raiseError($this->lng->txt(
"err_no_file_uploaded"),$this->ilias->error_obj->MESSAGE);
405 $file = pathinfo($_FILES[
"scormfile"][
"name"]);
407 elseif (
$_POST[
"uploaded_file"])
412 $this->
ilias->raiseError($this->lng->txt(
"upload_error_file_not_found"),$this->ilias->error_obj->MESSAGE);
419 $this->
ilias->raiseError($this->lng->txt(
"msg_no_file"),$this->ilias->error_obj->MESSAGE);
422 $name = substr(
$file[
"basename"], 0, strlen(
$file[
"basename"]) - strlen(
$file[
"extension"]) - 1);
425 $name = $this->lng->txt(
"no_title");
429 switch (
$_POST[
"sub_type"])
433 include_once(
"./Modules/Scorm2004/classes/class.ilObjSCORM2004LearningModule.php");
435 $newObj->setEditable(
$_POST[
"editable"]==
'y');
436 $newObj->setImportSequencing(
$_POST[
"import_sequencing"]);
437 $newObj->setSequencingExpertMode(
$_POST[
"import_sequencing"]);
441 include_once(
"./Modules/ScormAicc/classes/class.ilObjSCORMLearningModule.php");
446 include_once(
"./Modules/ScormAicc/classes/class.ilObjAICCLearningModule.php");
451 include_once(
"./Modules/ScormAicc/classes/class.ilObjHACPLearningModule.php");
456 $newObj->setTitle($name);
457 $newObj->setSubType(
$_POST[
"sub_type"]);
458 $newObj->setDescription(
"");
459 $newObj->create(
true);
460 $newObj->createReference();
461 $newObj->putInTree(
$_GET[
"ref_id"]);
462 $newObj->setPermissions(
$_GET[
"ref_id"]);
463 $newObj->notify(
"new",
$_GET[
"ref_id"],
$_GET[
"parent_non_rbac_id"],
$_GET[
"ref_id"],$newObj->getRefId());
466 $newObj->createDataDirectory();
468 if ($_FILES[
"scormfile"][
"name"])
471 $file_path = $newObj->getDataDirectory().
"/".$_FILES[
"scormfile"][
"name"];
474 $_FILES[
"scormfile"][
"name"], $file_path);
479 $file_path = $newObj->getDataDirectory().
"/".
$_POST[
"uploaded_file"];
487 $title = $newObj->readObject();
500 switch (
$_POST[
"sub_type"])
504 $newObj->setLearningProgressSettingsAtUpload();
510 ilUtil::redirect(
"ilias.php?baseClass=ilSAHSEditGUI&ref_id=".$newObj->getRefId());
525 if (trim(
$_POST[
"title"]) ==
"")
527 $this->
ilias->raiseError($this->lng->txt(
"msg_no_title"),$this->ilias->error_obj->MESSAGE);
530 include_once(
"./Modules/Scorm2004/classes/class.ilObjSCORM2004LearningModule.php");
533 $newObj->setSubType(
"scorm2004");
534 $newObj->setEditable(
true);
537 $newObj->createReference();
538 $newObj->putInTree(
$_GET[
"ref_id"]);
539 $newObj->setPermissions(
$_GET[
"ref_id"]);
540 $newObj->notify(
"new",
$_GET[
"ref_id"],
$_GET[
"parent_non_rbac_id"],
$_GET[
"ref_id"],$newObj->getRefId());
541 $newObj->createDataDirectory();
542 $newObj->createScorm2004Tree();
544 ilUtil::redirect(
"ilias.php?baseClass=ilSAHSEditGUI&ref_id=".$newObj->getRefId());
561 $this->ownerObject();
571 $this->tpl->getStandardTemplate();
595 $this->tpl->setTitle($this->object->getTitle());
596 if(strtolower(
$_GET[
"baseClass"]) ==
"ilsahseditgui") $this->
getTabs($this->tabs_gui);
604 include_once
"./Services/Certificate/classes/class.ilCertificateGUI.php";
605 include_once
"./Modules/ScormAicc/classes/class.ilSCORMCertificateAdapter.php";
607 $output_gui->certificateEditor();
619 if ($this->ctrl->getCmd() ==
"delete")
624 switch ($this->object->getSubType())
627 $ilHelp->setScreenIdComponent(
"sahs13");
631 $ilHelp->setScreenIdComponent(
"sahs12");
637 $ilCtrl->setParameterByClass(
"ilfilesystemgui",
"resetoffset", 1);
638 $tabs_gui->addTarget(
"cont_list_files",
639 $this->ctrl->getLinkTargetByClass(
"ilfilesystemgui",
"listFiles"),
"",
641 $ilCtrl->setParameterByClass(
"ilfilesystemgui",
"resetoffset",
"");
644 $force_active = ($this->ctrl->getNextClass() ==
"ilinfoscreengui")
647 $tabs_gui->addTarget(
"info_short",
648 $this->ctrl->getLinkTargetByClass(
"ilinfoscreengui",
"showSummary"),
"",
649 "ilinfoscreengui",
"", $force_active);
652 $tabs_gui->addTarget(
"settings",
653 $this->ctrl->getLinkTarget($this,
"properties"), array(
"",
"properties"),
657 include_once
'./Services/Tracking/classes/class.ilLearningProgressAccess.php';
661 if ($this->object->getSubType() ==
"scorm2004" || $this->
object->getSubType() ==
"scorm") {
662 if ($this->object->getOfflineMode() ==
true) {
663 $tabs_gui->addTarget(
"offline_mode_manager",
664 $this->ctrl->getLinkTarget($this,
"offlineModeManager"),
665 "offlineModeManager",
666 "ilobjscormlearningmodulegui");
670 $tabs_gui->addTarget(
'learning_progress',
671 $this->ctrl->getLinkTargetByClass(array(
'illearningprogressgui'),
''),
673 array(
'illplistofobjectsgui',
'illplistofsettingsgui',
'illearningprogressgui',
'illplistofprogressgui'));
677 if($rbacsystem->checkAccess(
"read_learning_progress", $this->object->getRefId()) || $rbacsystem->checkAccess(
"edit_learning_progress", $this->object->getRefId()))
679 if ($this->object->getSubType() ==
"scorm2004" || $this->
object->getSubType() ==
"scorm") {
680 include_once(
'./Services/PrivacySecurity/classes/class.ilPrivacySettings.php');
682 if($privacy->enabledSahsProtocolData())
684 $tabs_gui->addTarget(
"cont_tracking_data",
685 $this->ctrl->getLinkTarget($this,
"showTrackingItems"),
"showTrackingItems",
690 include_once(
"Services/License/classes/class.ilLicenseAccess.php");
691 if ($rbacsystem->checkAccess(
'edit_permission',$this->object->getRefId())
694 $tabs_gui->addTarget(
"license",
695 $this->ctrl->getLinkTargetByClass(
'illicensegui',
''),
700 include_once
"Services/Object/classes/class.ilObjectMetaDataGUI.php";
702 $mdtab = $mdgui->getTab();
705 $tabs_gui->addTarget(
"meta_data",
707 "",
"ilmdeditorgui");
711 if ($rbacsystem->checkAccess(
'edit_permission',$this->object->getRefId()))
713 $tabs_gui->addTarget(
"perm_settings",
714 $this->ctrl->getLinkTargetByClass(array(get_class($this),
'ilpermissiongui'),
"perm"), array(
"perm",
"info",
"owner"),
'ilpermissiongui');
721 public static function _goto($a_target)
725 $parts = explode(
"_", $a_target);
727 if ($ilAccess->checkAccess(
"write",
"", $parts[0]))
730 $_GET[
"baseClass"] =
"ilSAHSEditGUI";
731 $_GET[
"ref_id"] = $parts[0];
732 $_GET[
"obj_id"] = $parts[1];
733 include(
"ilias.php");
736 if ($ilAccess->checkAccess(
"visible",
"", $parts[0]) || $ilAccess->checkAccess(
"read",
"", $parts[0]))
738 $_GET[
"cmd"] =
"infoScreen";
739 $_GET[
"baseClass"] =
"ilSAHSPresentationGUI";
740 $_GET[
"ref_id"] = $parts[0];
741 include(
"ilias.php");
746 if ($ilAccess->checkAccess(
"read",
"", ROOT_FOLDER_ID))
761 if (is_object($this->
object))
763 $ilLocator->addItem($this->object->getTitle(),
764 $this->ctrl->getLinkTargetByClass(
"ilinfoscreengui",
"showSummary"),
"",
$_GET[
"ref_id"]);
778 if (!$this->object->getEditable())
780 $ilCtrl->redirectByClass(
"ilfilesystemgui",
"listFiles");
784 $ilCtrl->redirectByClass(
"ilobjscorm2004learningmodulegui",
"editOrganization");
795 $ilTabs->addSubTabTarget(
"cont_settings",
796 $this->ctrl->getLinkTarget($this,
"properties"), array(
"edit",
""),
799 $ilTabs->addSubTabTarget(
"cont_sc_new_version",
800 $this->ctrl->getLinkTarget($this,
"newModuleVersion"), array(
"edit",
""),
803 include_once
"Services/Certificate/classes/class.ilCertificate.php";
812 $ilTabs->addSubTabTarget(
814 $this->ctrl->getLinkTargetByClass(
"ilcertificategui",
"certificateeditor"),
815 "",
"ilcertificategui");
818 $ilTabs->setTabActive(
'settings');
GUI class to create PDF certificates.
static getInstanceFromAjaxCall()
(Re-)Build instance from ajax call
File System Explorer GUI class.
static checkAccess($a_ref_id, $a_allow_only_read=true)
check access to learning progress
const LP_CONTEXT_REPOSITORY
Class ilObjUserTrackingGUI.
static _isEnabled()
Check, if licencing is enabled This check is called from the ilAccessHandler class.
Class ilObjAICCLearningModule.
Class ilObjAICCLearningModule.
SCORM/AICC/HACP Learning Modules.
getTabs(&$tabs_gui)
adds tabs to tab gui object
& executeCommand()
execute command
saveProperties()
save properties
addLocatorItems()
should be overwritten to add object specific items (repository items are preloaded)
ilObjSAHSLearningModuleGUI($a_data, $a_id, $a_call_by_reference, $a_prepare_output=true)
Constructor.
saveObject()
save new learning module to db
setTabs()
output main frameset of media pool left frame: explorer tree of folders right frame: media pool conte...
static _goto($a_target)
goto target course
initUploadForm()
Init upload form.
properties()
module properties
viewObject()
list childs of current object
initCreationForms($a_new_type)
no manual SCORM creation, only import at the time
certificate()
Shows the certificate editor.
setSettingsSubTabs()
set Tabs for settings
owner()
show owner of learning module
initCreationForm()
Init form.
getTemplate()
output main header (title and locator)
uploadObject()
display status information or report errors messages in case of error
Class ilObjSCORM2004LearningModule.
Class ilObjSCORMLearningModule.
Class ilObjStyleSheetGUI.
Class ilObjectGUI Basic methods of all Output classes.
ilObjectGUI($a_data, $a_id=0, $a_call_by_reference=true, $a_prepare_output=true)
Constructor @access public.
prepareOutput()
prepare output
static _gotoRepositoryRoot($a_raise_error=false)
Goto repository root.
getCreationMode()
get creation mode
static _lookupObjId($a_id)
const TITLE_LENGTH
max length of object title
_writeTitle($a_obj_id, $a_title)
write title to db (static)
static _lookupTitle($a_id)
lookup object title
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
static _getInstance()
Get instance of ilPrivacySettings.
This class represents an option in a radio group.
SCORM certificate adapter.
This class represents a text area property in a property form.
This class represents a text property in a property form.
static _getUploadFiles()
Get a list of readable files in the upload directory.
static _copyUploadFile($a_file, $a_target, $a_raise_errors=true)
copy an uploaded file to the target directory (including virus check)
static _checkUploadFile($a_file)
Check if a file exists in the upload directory and is readable.
static _getUploadDirectory()
Get the directory with uploaded files.
static moveUploadedFile($a_file, $a_name, $a_target, $a_raise_errors=true, $a_mode="move_uploaded")
move uploaded file
static redirect($a_script)
http redirect to other script
static unzip($a_file, $overwrite=false, $a_flat=false)
unzip file
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
static renameExecutables($a_dir)
Rename uploaded executables for security reasons.
redirection script todo: (a better solution should control the processing via a xml file)
if(!is_array($argv)) $options