3require_once
"./Services/Object/classes/class.ilObjectGUI.php";
4require_once(
"./Services/FileSystem/classes/class.ilFileSystemGUI.php");
24 public 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" ||
50 $this->tpl->setTitle($this->object->getTitle());
53 $next_class = $this->ctrl->getNextClass($this);
54 $cmd = $this->ctrl->getCmd();
56 switch ($next_class) {
57 case 'illtiproviderobjectsettinggui':
59 $ilTabs->setSubTabActive(
'lti_provider');
61 $lti_gui->setCustomRolesForSelection(
$GLOBALS[
'DIC']->rbac()->review()->getLocalRoles($this->object->getRefId()));
62 $lti_gui->offerLTIRolesForSelection(
false);
63 $this->ctrl->forwardCommand($lti_gui);
67 case 'ilobjectmetadatagui':
68 if (!$ilAccess->checkAccess(
'write',
'', $this->object->getRefId())) {
69 $ilErr->raiseError($this->lng->txt(
'permission_denied'),
$ilErr->WARNING);
71 include_once
'Services/Object/classes/class.ilObjectMetaDataGUI.php';
73 $this->ctrl->forwardCommand($md_gui);
77 case 'ilpermissiongui':
78 include_once(
"Services/AccessControl/classes/class.ilPermissionGUI.php");
80 $ret = $this->ctrl->forwardCommand($perm_gui);
83 case "ilfilesystemgui":
85 $this->fs_gui->setUseUploadDirectory(
true);
86 $this->fs_gui->setTableId(
"sahsfs" . $this->object->getId());
87 $ret = $this->ctrl->forwardCommand($this->fs_gui);
90 case "ilcertificategui":
92 $ilTabs->setSubTabActive(
'certificate');
93 include_once
"./Services/Certificate/classes/class.ilCertificateGUI.php";
94 include_once
"./Modules/ScormAicc/classes/class.ilSCORMCertificateAdapter.php";
96 $ret = $this->ctrl->forwardCommand($output_gui);
99 case "illearningprogressgui":
100 include_once
'./Services/Tracking/classes/class.ilLearningProgressGUI.php';
103 $this->ctrl->forwardCommand($new_gui);
108 include_once(
"./Services/License/classes/class.ilLicenseGUI.php");
110 $ret = $this->ctrl->forwardCommand($license_gui);
113 case "ilinfoscreengui":
114 include_once(
"./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
117 $info->enablePrivateNotes();
118 $info->enableLearningProgress();
121 if ($ilAccess->checkAccess(
"read",
"",
$_GET[
"ref_id"])) {
122 if (!$this->object->getEditable()) {
123 $ilToolbar =
$GLOBALS[
'DIC']->toolbar();
124 $ilToolbar->addButtonInstance($this->object->getViewButton());
129 if ($ilAccess->checkAccess(
"write",
"",
$_GET[
"ref_id"])) {
130 $info->enableNewsEditing();
132 $enable_internal_rss = $news_set->get(
"enable_rss_for_internal");
133 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") {
157 $style_gui->setCreationMode(
true);
161 if ($cmd ==
"confirmedDelete") {
162 $this->
object->setStyleSheetId(0);
163 $this->
object->update();
165 $ret = $this->ctrl->forwardCommand($style_gui);
166 if ($cmd ==
"save" || $cmd ==
"copyStyle" || $cmd ==
"importStyle") {
168 $this->
object->setStyleSheetId($style_id);
169 $this->
object->update();
170 $this->ctrl->redirectByClass(
"ilobjstylesheetgui",
"edit");
175 case 'ilobjectcopygui':
177 include_once
'./Services/Object/classes/class.ilObjectCopyGUI.php';
179 $cp->setType(
'sahs');
180 $this->ctrl->forwardCommand($cp);
184 if ($this->
object && !$this->object->getEditable()) {
185 $cmd = $this->ctrl->getCmd(
"properties");
187 $cmd = $this->ctrl->getCmd(
"frameset");
189 if ((strtolower(
$_GET[
"baseClass"]) ==
"iladministrationgui" ||
191 $cmd !=
"frameset") {
196 if ($cmd ==
"redrawHeaderAction") {
200 $ret = $this->$cmd();
208 if (strtolower(
$_GET[
"baseClass"]) ==
"iladministrationgui") {
209 parent::viewObject();
259 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
266 $ti->setRequired(
true);
267 $this->form->addItem($ti);
273 $this->form->addItem($ta);
276 $this->form->addCommandButton(
"save",
$lng->txt(
"sahs_add"));
277 $this->form->addCommandButton(
"cancel",
$lng->txt(
"cancel"));
279 $this->form->setTitle(
$lng->txt(
"scorm_new"));
280 $this->form->setFormAction(
$ilCtrl->getFormAction($this));
291 include_once(
"Services/Form/classes/class.ilPropertyFormGUI.php");
296 "scorm2004" =>
$lng->txt(
"lm_type_scorm2004"),
297 "scorm" =>
$lng->txt(
"lm_type_scorm"),
298 "exportFile" =>
$lng->txt(
"sahs_export_file")
302 $this->form->addItem(
$si);
305 $fi =
new ilFileInputGUI($this->lng->txt(
"select_file"),
"scormfile");
306 $fi->setRequired(
true);
307 $this->form->addItem($fi);
312 include_once
'Services/FileSystem/classes/class.ilUploadFiles.php';
315 $fi->setRequired(
false);
317 $options[
""] = $this->lng->txt(
"cont_select_from_upload_dir");
319 $file = htmlspecialchars(
$file, ENT_QUOTES,
"utf-8");
325 $this->form->addItem(
$si);
333 $this->form->addItem($cb);
338 $cb->setInfo($this->lng->txt(
"sahs_authoring_mode_info"));
339 $this->form->addItem($cb);
344 $op1 =
new ilRadioOption(
$lng->txt(
"sahs_std_sequencing"), 0,
$lng->txt(
"sahs_std_sequencing_info"));
345 $radg->addOption($op1);
346 $op1 =
new ilRadioOption(
$lng->txt(
"sahs_import_sequencing"), 1,
$lng->txt(
"sahs_import_sequencing_info"));
347 $radg->addOption($op1);
348 $cb->addSubItem($radg);
351 $this->form->addCommandButton(
"upload",
$lng->txt(
"import"));
352 $this->form->addCommandButton(
"cancel",
$lng->txt(
"cancel"));
354 $this->form->setTitle(
$lng->txt(
"import_sahs"));
355 $this->form->setFormAction(
$ilCtrl->getFormAction($this,
"upload"));
369 include_once
'Services/FileSystem/classes/class.ilUploadFiles.php';
373 $this->
ilias->raiseError($this->lng->txt(
"no_create_permission"), $this->ilias->error_obj->WARNING);
374 } elseif ($_FILES[
"scormfile"][
"name"]) {
376 $source = $_FILES[
"scormfile"][
"tmp_name"];
378 $this->
ilias->raiseError($this->lng->txt(
"msg_no_file"), $this->ilias->error_obj->MESSAGE);
381 switch ($_FILES[
"scormfile"][
"error"]) {
382 case UPLOAD_ERR_INI_SIZE:
383 $this->
ilias->raiseError($this->lng->txt(
"err_max_file_size_exceeds"), $this->ilias->error_obj->MESSAGE);
386 case UPLOAD_ERR_FORM_SIZE:
387 $this->
ilias->raiseError($this->lng->txt(
"err_max_file_size_exceeds"), $this->ilias->error_obj->MESSAGE);
390 case UPLOAD_ERR_PARTIAL:
391 $this->
ilias->raiseError($this->lng->txt(
"err_partial_file_upload"), $this->ilias->error_obj->MESSAGE);
394 case UPLOAD_ERR_NO_FILE:
395 $this->
ilias->raiseError($this->lng->txt(
"err_no_file_uploaded"), $this->ilias->error_obj->MESSAGE);
399 $file = pathinfo($_FILES[
"scormfile"][
"name"]);
400 } elseif (
$_POST[
"uploaded_file"]) {
403 $this->
ilias->raiseError($this->lng->txt(
"upload_error_file_not_found"), $this->ilias->error_obj->MESSAGE);
408 $this->
ilias->raiseError($this->lng->txt(
"msg_no_file"), $this->ilias->error_obj->MESSAGE);
411 $name = substr(
$file[
"basename"], 0, strlen(
$file[
"basename"]) - strlen(
$file[
"extension"]) - 1);
413 $name = $this->lng->txt(
"no_title");
416 $subType =
$_POST[
"sub_type"];
420 include_once(
"./Modules/Scorm2004/classes/class.ilObjSCORM2004LearningModule.php");
422 $newObj->setEditable(
$_POST[
"editable"]==
'y');
423 $newObj->setImportSequencing(
$_POST[
"import_sequencing"]);
424 $newObj->setSequencingExpertMode(
$_POST[
"import_sequencing"]);
428 include_once(
"./Modules/ScormAicc/classes/class.ilObjSCORMLearningModule.php");
433 $sFile = $_FILES[
"scormfile"];
434 $fType = $sFile[
"type"];
435 $cFileTypes = [
"application/zip",
"application/x-compressed",
"application/x-zip-compressed"];
436 if (in_array($fType, $cFileTypes)) {
438 $tempFile = $sFile[
"tmp_name"];
440 $lmTempDir = $lmDir . $timeStamp;
441 if (!file_exists($lmTempDir)) {
442 mkdir($lmTempDir, 0755,
true);
444 $zar =
new ZipArchive();
445 $zar->open($tempFile);
446 $zar->extractTo($lmTempDir);
448 require_once
"./Modules/ScormAicc/classes/class.ilScormAiccImporter.php";
450 $import_dirname = $lmTempDir .
'/' . substr($_FILES[
"scormfile"][
"name"], 0, strlen($a_filename) - 4);
451 if ($importer->importXmlRepresentation(
"sahs",
null, $import_dirname,
"") ==
true) {
452 $importFromXml =
true;
455 $mprops = $importer->moduleProperties;
456 $subType = $mprops[
"SubType"][0];
457 if ($subType ==
"scorm") {
458 include_once(
"./Modules/ScormAicc/classes/class.ilObjSCORMLearningModule.php");
461 include_once(
"./Modules/Scorm2004/classes/class.ilObjSCORM2004LearningModule.php");
471 $newObj->setTitle(
$name);
472 $newObj->setSubType($subType);
473 $newObj->setDescription(
"");
474 $newObj->create(
true);
475 $newObj->createReference();
476 $newObj->putInTree(
$_GET[
"ref_id"]);
477 $newObj->setPermissions(
$_GET[
"ref_id"]);
480 $newObj->createDataDirectory();
482 if ($_FILES[
"scormfile"][
"name"]) {
483 if ($importFromXml) {
484 $scormFile =
"content.zip";
485 $scormFilePath = $import_dirname .
"/" . $scormFile;
486 $file_path = $newObj->getDataDirectory() .
"/" . $scormFile;
493 $file_path = $newObj->getDataDirectory() .
"/" . $_FILES[
"scormfile"][
"name"];
494 ilUtil::moveUploadedFile(
495 $_FILES[
"scormfile"][
"tmp_name"],
496 $_FILES[
"scormfile"][
"name"],
503 $file_path = $newObj->getDataDirectory() .
"/" .
$_POST[
"uploaded_file"];
509 $title = $newObj->readObject();
515 $newObj->setLearningProgressSettingsAtUpload();
517 if ($importFromXml) {
518 $importer->writeData(
"sahs",
"5.1.0", $newObj->getId());
522 ilUtil::redirect(
"ilias.php?baseClass=ilSAHSEditGUI&ref_id=" . $newObj->getRefId());
537 if (trim(
$_POST[
"title"]) ==
"") {
538 $this->
ilias->raiseError($this->lng->txt(
"msg_no_title"), $this->ilias->error_obj->MESSAGE);
541 include_once(
"./Modules/Scorm2004/classes/class.ilObjSCORM2004LearningModule.php");
544 $newObj->setSubType(
"scorm2004");
545 $newObj->setEditable(
true);
548 $newObj->createReference();
549 $newObj->putInTree(
$_GET[
"ref_id"]);
550 $newObj->setPermissions(
$_GET[
"ref_id"]);
551 $newObj->createDataDirectory();
552 $newObj->createScorm2004Tree();
556 $this->ctrl->setParameterByClass(
"ilObjSCORM2004LearningModuleGUI",
"ref_id", $newObj->getRefId());
557 $this->ctrl->redirectByClass(array(
"ilSAHSEditGUI",
"ilObjSCORM2004LearningModuleGUI"),
"showOrganization");
574 $this->ownerObject();
584 $this->tpl->getStandardTemplate();
593 $this->tpl->setTitle($this->object->getTitle());
594 if (strtolower(
$_GET[
"baseClass"]) ==
"ilsahseditgui") {
595 $this->
getTabs($this->tabs_gui);
605 include_once
"./Services/Certificate/classes/class.ilCertificateGUI.php";
606 include_once
"./Modules/ScormAicc/classes/class.ilSCORMCertificateAdapter.php";
608 $output_gui->certificateEditor();
620 if ($this->ctrl->getCmd() ==
"delete") {
624 switch ($this->object->getSubType()) {
626 $ilHelp->setScreenIdComponent(
"sahs13");
630 $ilHelp->setScreenIdComponent(
"sahs12");
636 $ilCtrl->setParameterByClass(
"ilfilesystemgui",
"resetoffset", 1);
637 $this->tabs_gui->addTarget(
639 $this->ctrl->getLinkTargetByClass(
"ilfilesystemgui",
"listFiles"),
643 $ilCtrl->setParameterByClass(
"ilfilesystemgui",
"resetoffset",
"");
646 $force_active = ($this->ctrl->getNextClass() ==
"ilinfoscreengui")
649 $this->tabs_gui->addTarget(
651 $this->ctrl->getLinkTargetByClass(
"ilinfoscreengui",
"showSummary"),
659 $this->tabs_gui->addTarget(
661 $this->ctrl->getLinkTarget($this,
"properties"),
662 array(
"",
"properties"),
667 include_once
'./Services/Tracking/classes/class.ilLearningProgressAccess.php';
670 if ($this->object->getSubType() ==
"scorm2004" || $this->
object->getSubType() ==
"scorm") {
671 if ($this->object->getOfflineMode() ==
true) {
672 $this->tabs_gui->addTarget(
673 "offline_mode_manager",
674 $this->ctrl->getLinkTarget($this,
"offlineModeManager"),
675 "offlineModeManager",
676 "ilobjscormlearningmodulegui"
681 $this->tabs_gui->addTarget(
683 $this->ctrl->getLinkTargetByClass(array(
'illearningprogressgui'),
''),
685 array(
'illplistofobjectsgui',
'illplistofsettingsgui',
'illearningprogressgui',
'illplistofprogressgui')
690 if (
$rbacsystem->checkAccess(
"read_learning_progress", $this->object->getRefId()) ||
$rbacsystem->checkAccess(
"edit_learning_progress", $this->object->getRefId())) {
691 if ($this->object->getSubType() ==
"scorm2004" || $this->
object->getSubType() ==
"scorm") {
692 include_once(
'./Services/PrivacySecurity/classes/class.ilPrivacySettings.php');
694 if ($privacy->enabledSahsProtocolData()) {
695 $this->tabs_gui->addTarget(
696 "cont_tracking_data",
697 $this->ctrl->getLinkTarget($this,
"showTrackingItems"),
704 include_once(
"Services/License/classes/class.ilLicenseAccess.php");
705 if (
$rbacsystem->checkAccess(
'edit_permission', $this->object->getRefId())
707 $this->tabs_gui->addTarget(
709 $this->ctrl->getLinkTargetByClass(
'illicensegui',
''),
716 include_once
"Services/Object/classes/class.ilObjectMetaDataGUI.php";
718 $mdtab = $mdgui->getTab();
720 $this->tabs_gui->addTarget(
729 if (
$rbacsystem->checkAccess(
"edit_permission",
"", $this->object->getRefId())) {
730 $this->tabs_gui->addTarget(
732 $this->ctrl->getLinkTarget($this,
"export"),
739 if (
$rbacsystem->checkAccess(
'edit_permission', $this->object->getRefId())) {
740 $this->tabs_gui->addTarget(
742 $this->ctrl->getLinkTargetByClass(array(get_class($this),
'ilpermissiongui'),
"perm"),
743 array(
"perm",
"info",
"owner"),
752 public static function _goto($a_target)
756 $parts = explode(
"_", $a_target);
758 if ($ilAccess->checkAccess(
"write",
"", $parts[0])) {
760 $_GET[
"baseClass"] =
"ilSAHSEditGUI";
761 $_GET[
"ref_id"] = $parts[0];
762 $_GET[
"obj_id"] = $parts[1];
763 include(
"ilias.php");
766 if ($ilAccess->checkAccess(
"visible",
"", $parts[0]) || $ilAccess->checkAccess(
"read",
"", $parts[0])) {
767 $_GET[
"cmd"] =
"infoScreen";
768 $_GET[
"baseClass"] =
"ilSAHSPresentationGUI";
769 $_GET[
"ref_id"] = $parts[0];
770 include(
"ilias.php");
773 if ($ilAccess->checkAccess(
"read",
"", ROOT_FOLDER_ID)) {
775 $lng->txt(
"msg_no_perm_read_item"),
789 if (is_object($this->
object)) {
791 $this->object->getTitle(),
792 $this->ctrl->getLinkTargetByClass(
"ilinfoscreengui",
"showSummary"),
809 if (!$this->object->getEditable()) {
810 $ilCtrl->redirectByClass(
"ilfilesystemgui",
"listFiles");
812 $ilCtrl->redirectByClass(
"ilobjscorm2004learningmodulegui",
"editOrganization");
823 $ilTabs->addSubTabTarget(
825 $this->ctrl->getLinkTarget($this,
"properties"),
830 $ilTabs->addSubTabTarget(
831 "cont_sc_new_version",
832 $this->ctrl->getLinkTarget($this,
"newModuleVersion"),
837 include_once
"Services/Certificate/classes/class.ilCertificate.php";
845 $ilTabs->addSubTabTarget(
847 $this->ctrl->getLinkTargetByClass(
"ilcertificategui",
"certificateeditor"),
854 if ($lti_settings->hasSettingsAccess()) {
855 $ilTabs->addSubTabTarget(
857 $this->ctrl->getLinkTargetByClass(ilLTIProviderObjectSettingGUI::class)
861 $ilTabs->setTabActive(
'settings');
867 $ilTabs->activateTab(
"export");
868 include_once(
"./Services/Export/classes/class.ilExportGUI.php");
871 $exp_gui->addFormat(
"xml");
872 $ret = $this->ctrl->forwardCommand($exp_gui);
881 require_once
"./Modules/ScormAicc/classes/class.ilScormAiccExporter.php";
883 $xml = $exporter->getXmlRepresentation(
"sahs",
"5.1.0", $moduleId);
sprintf('%.4f', $callTime)
if(!isset( $_REQUEST[ 'ReturnTo'])) if(!isset($_REQUEST['AuthId'])) $options
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.
GUI class for LTI provider object settings.
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.
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.
GUI class for the workflow of copying objects.
Class ilObjectGUI Basic methods of all Output classes.
prepareOutput($a_show_subobjects=true)
prepare output
static _gotoRepositoryRoot($a_raise_error=false)
Goto repository root.
fillCloneTemplate($a_tpl_varname, $a_type)
Fill object clone template This method can be called from any object GUI class that wants to offer ob...
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 delDir($a_dir, $a_clean_only=false)
removes a dir and all its content (subdirs and files) recursively
static getWebspaceDir($mode="filesystem")
get webspace directory
static redirect($a_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(isset($_POST['submit'])) $form
if(!file_exists("$old.txt")) if( $old===$new) if(file_exists("$new.txt")) $file