3 require_once
"./Services/Object/classes/class.ilObjectGUI.php";
4 require_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');
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":
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();
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");
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");
323 $si =
new ilSelectInputGUI($this->lng->txt(
"cont_uploaded_file"),
"uploaded_file");
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);
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';
372 if (!$rbacsystem->checkAccess(
"create",
$_GET[
"ref_id"],
"sahs")) {
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"),
782 $ilErr->raiseError($lng->txt(
"msg_no_perm_read"), $ilErr->FATAL);
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);
This class represents an option in a radio group.
initUploadForm()
Init upload form.
saveObject()
save new learning module to db
GUI class for the workflow of copying objects.
const TITLE_LENGTH
max length of object title
static _isEnabled()
Check, if licencing is enabled This check is called from the ilAccessHandler class.
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
certificate()
Shows the certificate editor.
static _gotoRepositoryRoot($a_raise_error=false)
Goto repository root.
static unzip($a_file, $overwrite=false, $a_flat=false)
unzip file
getTemplate()
output main header (title and locator)
static _writeTitle($a_obj_id, $a_title)
write title to db (static)
static _lookupTitle($a_id)
lookup object title
static _getUploadDirectory()
Get the directory with uploaded files.
static _getUploadFiles()
Get a list of readable files in the upload directory.
setUseUploadDirectory($a_val)
Set use upload directory.
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...
setSettingsSubTabs()
set Tabs for settings
__construct($a_data, $a_id, $a_call_by_reference, $a_prepare_output=true)
Constructor.
static _lookupObjectId($a_ref_id)
lookup object id
static rename($a_source, $a_target)
Rename a file.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
Export User Interface Class.
static checkAccess($a_ref_id, $a_allow_only_read=true)
check access to learning progress
static _goto($a_target)
goto target course
setCustomRolesForSelection($a_roles)
Set custom roles for mapping to LTI roles.
prepareOutput($a_show_subobjects=true)
prepare output
owner()
show owner of learning module
if(isset($_POST['submit'])) $form
GUI class for LTI provider object settings.
addSubItem($a_item)
Add Subitem.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
Class ilObjectGUI Basic methods of all Output classes.
static _lookupObjId($a_id)
omitLocator($a_omit=true)
setSize($a_size)
Set Size.
This class represents a text property in a property form.
setCols($a_cols)
Set Cols.
GUI class to create PDF certificates.
getTabs()
adds tabs to tab gui object
redirection script todo: (a better solution should control the processing via a xml file) ...
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
saveProperties()
save properties
Create styles array
The data for the language used.
initCreationForms($a_new_type)
no manual SCORM creation, only import at the time
Create new PHPExcel object
obj_idprivate
Class ilObjStyleSheetGUI.
static renameExecutables($a_dir)
Rename uploaded executables for security reasons.
properties()
module properties
const LP_CONTEXT_REPOSITORY
Class ilObjSCORM2004LearningModule.
This class represents a text area property in a property form.
getCreationMode()
get creation mode
SCORM certificate adapter.
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
static _getInstance()
Get instance of ilPrivacySettings.
Add data(end) time
Method that wraps PHPs time in order to allow simulations with the workflow.
if(!file_exists("$old.txt")) if($old===$new) if(file_exists("$new.txt")) $file
static _checkUploadFile($a_file)
Check if a file exists in the upload directory and is readable.
initCreationForm()
Init form.
File System Explorer GUI class.
static redirect($a_script)
static _copyUploadFile($a_file, $a_target, $a_raise_errors=true)
copy an uploaded file to the target directory (including virus check)
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
Class ilObjUserTrackingGUI.
Class ilObjSCORMLearningModule.
static getInstanceFromAjaxCall()
(Re-)Build instance from ajax call
executeCommand()
execute command
if(!isset($_REQUEST['ReturnTo'])) if(!isset($_REQUEST['AuthId'])) $options
uploadObject()
display status information or report errors messages in case of error