3require_once
"./Services/Object/classes/class.ilObjectGUI.php";
4require_once(
"./Services/FileSystem/classes/class.ilFileSystemGUI.php");
24 function __construct($a_data,$a_id,$a_call_by_reference, $a_prepare_output =
true)
28 $lng->loadLanguageModule(
"content");
30 parent::__construct($a_data,$a_id,$a_call_by_reference,
false);
38 global $ilAccess, $ilTabs,
$ilErr;
40 $GLOBALS[
"ilLog"]->write (
"bc:".
$_GET[
"baseClass"].
"; nc:".$this->ctrl->getNextClass($this).
"; cmd:".$this->ctrl->getCmd());
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);
72 case 'ilpermissiongui':
73 include_once(
"Services/AccessControl/classes/class.ilPermissionGUI.php");
75 $ret = $this->ctrl->forwardCommand($perm_gui);
78 case "ilfilesystemgui":
80 $this->fs_gui->setUseUploadDirectory(
true);
81 $this->fs_gui->setTableId(
"sahsfs".$this->object->getId());
82 $ret = $this->ctrl->forwardCommand($this->fs_gui);
85 case "ilcertificategui":
87 $ilTabs->setSubTabActive(
'certificate');
88 include_once
"./Services/Certificate/classes/class.ilCertificateGUI.php";
89 include_once
"./Modules/ScormAicc/classes/class.ilSCORMCertificateAdapter.php";
91 $ret = $this->ctrl->forwardCommand($output_gui);
94 case "illearningprogressgui":
95 include_once
'./Services/Tracking/classes/class.ilLearningProgressGUI.php';
98 $this->ctrl->forwardCommand($new_gui);
103 include_once(
"./Services/License/classes/class.ilLicenseGUI.php");
105 $ret = $this->ctrl->forwardCommand($license_gui);
108 case "ilinfoscreengui":
109 include_once(
"./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
112 $info->enablePrivateNotes();
113 $info->enableLearningProgress();
116 if ($ilAccess->checkAccess(
"read",
"",
$_GET[
"ref_id"]))
118 if (!$this->object->getEditable())
120 $info->addButton($this->lng->txt(
"view"),
121 "ilias.php?baseClass=ilSAHSPresentationGUI&ref_id=".$this->object->getRefID(),
122 ' target="ilContObj'.$this->object->getId().
'" ');
127 if ($ilAccess->checkAccess(
"write",
"",
$_GET[
"ref_id"]))
129 $info->enableNewsEditing();
131 $enable_internal_rss = $news_set->get(
"enable_rss_for_internal");
132 if ($enable_internal_rss)
134 $info->setBlockProperty(
"news",
"settings",
true);
138 $info->addMetaDataSections($this->object->getId(),0, $this->object->getType());
141 $this->ctrl->forwardCommand(
$info);
144 case "ilcommonactiondispatchergui":
145 include_once(
"Services/Object/classes/class.ilCommonActionDispatcherGUI.php");
147 $this->ctrl->forwardCommand($gui);
150 case "ilobjstylesheetgui":
152 $this->ctrl->setReturn($this,
"properties");
153 $ilTabs->clearTargets();
154 $style_gui =
new ilObjStyleSheetGUI(
"", $this->object->getStyleSheetId(),
false,
false);
155 $style_gui->omitLocator();
156 if (
$cmd ==
"create" ||
$_GET[
"new_type"]==
"sty")
158 $style_gui->setCreationMode(
true);
162 if (
$cmd ==
"confirmedDelete")
164 $this->
object->setStyleSheetId(0);
165 $this->
object->update();
167 $ret = $this->ctrl->forwardCommand($style_gui);
168 if (
$cmd ==
"save" ||
$cmd ==
"copyStyle" ||
$cmd ==
"importStyle")
171 $this->
object->setStyleSheetId($style_id);
172 $this->
object->update();
173 $this->ctrl->redirectByClass(
"ilobjstylesheetgui",
"edit");
177 if ($this->
object && !$this->object->getEditable())
179 $cmd = $this->ctrl->getCmd(
"properties");
183 $cmd = $this->ctrl->getCmd(
"frameset");
185 if ((strtolower(
$_GET[
"baseClass"]) ==
"iladministrationgui" ||
193 if(
$cmd ==
"redrawHeaderAction")
206 if (strtolower(
$_GET[
"baseClass"]) ==
"iladministrationgui")
208 parent::viewObject();
258 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
265 $ti->setRequired(
true);
266 $this->form->addItem($ti);
272 $this->form->addItem($ta);
275 $this->form->addCommandButton(
"save",
$lng->txt(
"create"));
276 $this->form->addCommandButton(
"cancel",
$lng->txt(
"cancel"));
278 $this->form->setTitle(
$lng->txt(
"scorm_new"));
279 $this->form->setFormAction(
$ilCtrl->getFormAction($this));
290 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
295 "scorm2004" =>
$lng->txt(
"lm_type_scorm2004"),
296 "scorm" =>
$lng->txt(
"lm_type_scorm"),
297 "exportFile" =>
$lng->txt(
"sahs_export_file")
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");
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");
428 $subType =
$_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 $sFile = $_FILES[
"scormfile"];
447 $fType = $sFile[
"type"];
448 $cFileTypes = [
"application/zip",
"application/x-compressed"];
450 if (in_array ($fType, $cFileTypes))
453 $tempFile = $sFile[
"tmp_name"];
455 $lmTempDir = $lmDir . $timeStamp;
456 if (!file_exists ($lmTempDir)) mkdir ($lmTempDir, 0755,
true);
457 $zar =
new ZipArchive();
458 $zar->open ($tempFile);
459 $zar->extractTo ($lmTempDir);
461 require_once
"./Modules/ScormAicc/classes/class.ilScormAiccImporter.php";
463 if ($importer->importXmlRepresentation(
"sahs", Null, $lmTempDir,
"") ==
true)
464 $importFromXml =
true;
466 $mprops = $importer->moduleProperties;
467 $fed = $mprops[
"Fourth_edition"][0];
470 include_once(
"./Modules/ScormAicc/classes/class.ilObjSCORMLearningModule.php");
476 include_once(
"./Modules/Scorm2004/classes/class.ilObjSCORM2004LearningModule.php");
478 $newObj->setEditable(
$_POST[
"editable"]==
'y');
479 $newObj->setImportSequencing(
$_POST[
"import_sequencing"]);
480 $newObj->setSequencingExpertMode(
$_POST[
"import_sequencing"]);
481 $subType =
"scorm2004";
487 $newObj->setTitle($name);
488 $newObj->setSubType(
$_POST[
"sub_type"]);
489 $newObj->setDescription(
"");
490 $newObj->create(
true);
491 $newObj->createReference();
492 $newObj->putInTree(
$_GET[
"ref_id"]);
493 $newObj->setPermissions(
$_GET[
"ref_id"]);
496 $newObj->createDataDirectory();
498 if ($_FILES[
"scormfile"][
"name"])
502 $lmTempDir = $lmDir . $timeStamp;
503 $scormFile = $importer->manifest[
"scormFile"][0];
504 $scormFilePath = $lmTempDir .
"/" . $scormFile;
505 $targetPath = $newObj->getDataDirectory().
"/".$scormFile;
506 $file_path = $targetPath;
507 require_once(
'./Services/Utilities/classes/class.ilFileUtils.php');
513 $file_path = $newObj->getDataDirectory().
"/".$_FILES[
"scormfile"][
"name"];
516 $_FILES[
"scormfile"][
"name"], $file_path);
522 $file_path = $newObj->getDataDirectory().
"/".
$_POST[
"uploaded_file"];
530 $title = $newObj->readObject();
543 switch (
$_POST[
"sub_type"])
548 $newObj->setLearningProgressSettingsAtUpload();
554 $importer->writeData(
"sahs",
"5.1.0", $newObj->getId());
558 ilUtil::redirect(
"ilias.php?baseClass=ilSAHSEditGUI&ref_id=".$newObj->getRefId());
573 if (trim(
$_POST[
"title"]) ==
"")
575 $this->
ilias->raiseError($this->lng->txt(
"msg_no_title"),$this->ilias->error_obj->MESSAGE);
578 include_once(
"./Modules/Scorm2004/classes/class.ilObjSCORM2004LearningModule.php");
581 $newObj->setSubType(
"scorm2004");
582 $newObj->setEditable(
true);
585 $newObj->createReference();
586 $newObj->putInTree(
$_GET[
"ref_id"]);
587 $newObj->setPermissions(
$_GET[
"ref_id"]);
588 $newObj->createDataDirectory();
589 $newObj->createScorm2004Tree();
591 ilUtil::redirect(
"ilias.php?baseClass=ilSAHSEditGUI&ref_id=".$newObj->getRefId());
608 $this->ownerObject();
618 $this->tpl->getStandardTemplate();
627 $this->tpl->setTitle($this->object->getTitle());
628 if(strtolower(
$_GET[
"baseClass"]) ==
"ilsahseditgui") $this->
getTabs($this->tabs_gui);
637 include_once
"./Services/Certificate/classes/class.ilCertificateGUI.php";
638 include_once
"./Modules/ScormAicc/classes/class.ilSCORMCertificateAdapter.php";
640 $output_gui->certificateEditor();
650 global $rbacsystem,
$ilCtrl, $ilHelp;
652 if ($this->ctrl->getCmd() ==
"delete")
657 switch ($this->object->getSubType())
660 $ilHelp->setScreenIdComponent(
"sahs13");
664 $ilHelp->setScreenIdComponent(
"sahs12");
670 $ilCtrl->setParameterByClass(
"ilfilesystemgui",
"resetoffset", 1);
671 $this->tabs_gui->addTarget(
"cont_list_files",
672 $this->ctrl->getLinkTargetByClass(
"ilfilesystemgui",
"listFiles"),
"",
674 $ilCtrl->setParameterByClass(
"ilfilesystemgui",
"resetoffset",
"");
677 $force_active = ($this->ctrl->getNextClass() ==
"ilinfoscreengui")
680 $this->tabs_gui->addTarget(
"info_short",
681 $this->ctrl->getLinkTargetByClass(
"ilinfoscreengui",
"showSummary"),
"",
682 "ilinfoscreengui",
"", $force_active);
685 $this->tabs_gui->addTarget(
"settings",
686 $this->ctrl->getLinkTarget($this,
"properties"), array(
"",
"properties"),
690 include_once
'./Services/Tracking/classes/class.ilLearningProgressAccess.php';
694 if ($this->object->getSubType() ==
"scorm2004" || $this->
object->getSubType() ==
"scorm") {
695 if ($this->object->getOfflineMode() ==
true) {
696 $this->tabs_gui->addTarget(
"offline_mode_manager",
697 $this->ctrl->getLinkTarget($this,
"offlineModeManager"),
698 "offlineModeManager",
699 "ilobjscormlearningmodulegui");
703 $this->tabs_gui->addTarget(
'learning_progress',
704 $this->ctrl->getLinkTargetByClass(array(
'illearningprogressgui'),
''),
706 array(
'illplistofobjectsgui',
'illplistofsettingsgui',
'illearningprogressgui',
'illplistofprogressgui'));
710 if($rbacsystem->checkAccess(
"read_learning_progress", $this->object->getRefId()) || $rbacsystem->checkAccess(
"edit_learning_progress", $this->object->getRefId()))
712 if ($this->object->getSubType() ==
"scorm2004" || $this->
object->getSubType() ==
"scorm") {
713 include_once(
'./Services/PrivacySecurity/classes/class.ilPrivacySettings.php');
715 if($privacy->enabledSahsProtocolData())
717 $this->tabs_gui->addTarget(
"cont_tracking_data",
718 $this->ctrl->getLinkTarget($this,
"showTrackingItems"),
"showTrackingItems",
723 include_once(
"Services/License/classes/class.ilLicenseAccess.php");
724 if ($rbacsystem->checkAccess(
'edit_permission',$this->object->getRefId())
727 $this->tabs_gui->addTarget(
"license",
728 $this->ctrl->getLinkTargetByClass(
'illicensegui',
''),
733 include_once
"Services/Object/classes/class.ilObjectMetaDataGUI.php";
735 $mdtab = $mdgui->getTab();
738 $this->tabs_gui->addTarget(
"meta_data",
740 "",
"ilmdeditorgui");
744 if ($rbacsystem->checkAccess(
"edit_permission",
"", $this->object->getRefId()))
746 $this->tabs_gui->addTarget(
"export",
747 $this->ctrl->getLinkTarget($this,
"export"), array(
"",
"export"),
752 if ($rbacsystem->checkAccess(
'edit_permission',$this->object->getRefId()))
754 $this->tabs_gui->addTarget(
"perm_settings",
755 $this->ctrl->getLinkTargetByClass(array(get_class($this),
'ilpermissiongui'),
"perm"), array(
"perm",
"info",
"owner"),
'ilpermissiongui');
762 public static function _goto($a_target)
766 $parts = explode(
"_", $a_target);
768 if ($ilAccess->checkAccess(
"write",
"", $parts[0]))
771 $_GET[
"baseClass"] =
"ilSAHSEditGUI";
772 $_GET[
"ref_id"] = $parts[0];
773 $_GET[
"obj_id"] = $parts[1];
774 include(
"ilias.php");
777 if ($ilAccess->checkAccess(
"visible",
"", $parts[0]) || $ilAccess->checkAccess(
"read",
"", $parts[0]))
779 $_GET[
"cmd"] =
"infoScreen";
780 $_GET[
"baseClass"] =
"ilSAHSPresentationGUI";
781 $_GET[
"ref_id"] = $parts[0];
782 include(
"ilias.php");
787 if ($ilAccess->checkAccess(
"read",
"", ROOT_FOLDER_ID))
802 if (is_object($this->
object))
804 $ilLocator->addItem($this->object->getTitle(),
805 $this->ctrl->getLinkTargetByClass(
"ilinfoscreengui",
"showSummary"),
"",
$_GET[
"ref_id"]);
819 if (!$this->object->getEditable())
821 $ilCtrl->redirectByClass(
"ilfilesystemgui",
"listFiles");
825 $ilCtrl->redirectByClass(
"ilobjscorm2004learningmodulegui",
"editOrganization");
836 $ilTabs->addSubTabTarget(
"cont_settings",
837 $this->ctrl->getLinkTarget($this,
"properties"), array(
"edit",
""),
840 $ilTabs->addSubTabTarget(
"cont_sc_new_version",
841 $this->ctrl->getLinkTarget($this,
"newModuleVersion"), array(
"edit",
""),
844 include_once
"Services/Certificate/classes/class.ilCertificate.php";
853 $ilTabs->addSubTabTarget(
855 $this->ctrl->getLinkTargetByClass(
"ilcertificategui",
"certificateeditor"),
856 "",
"ilcertificategui");
859 $ilTabs->setTabActive(
'settings');
865 $ilTabs->activateTab(
"export");
866 include_once(
"./Services/Export/classes/class.ilExportGUI.php");
869 $exp_gui->addFormat(
"xml");
870 $ret = $this->ctrl->forwardCommand($exp_gui);
879 require_once
"./Modules/ScormAicc/classes/class.ilScormAiccExporter.php";
881 $xml = $exporter->getXmlRepresentation(
"sahs",
"5.1.0", $moduleId);
sprintf('%.4f', $callTime)
An exception for terminatinating execution or to throw for unit testing.
GUI class to create PDF certificates.
static getInstanceFromAjaxCall()
(Re-)Build instance from ajax call
Export User Interface Class.
File System Explorer GUI class.
static rename($a_source, $a_target)
Rename a file.
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.
SCORM/AICC/HACP Learning Modules.
saveProperties()
save properties
getTabs()
adds tabs to tab gui object
addLocatorItems()
should be overwritten to add object specific items (repository items are preloaded)
saveObject()
save new learning module to db
executeCommand()
execute command
static _goto($a_target)
goto target course
initUploadForm()
Init upload form.
__construct($a_data, $a_id, $a_call_by_reference, $a_prepare_output=true)
Constructor.
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.
prepareOutput($a_show_subobjects=true)
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
static _lookupTitle($a_id)
lookup object title
static _lookupObjectId($a_ref_id)
lookup object id
static _writeTitle($a_obj_id, $a_title)
write title to db (static)
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 getWebspaceDir($mode="filesystem")
get webspace directory
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.
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
redirection script todo: (a better solution should control the processing via a xml file)
if(!file_exists("$old.txt")) if( $old===$new) if(file_exists("$new.txt")) $file
if(!is_array($argv)) $options