3 declare(strict_types=1);
    45         $this->archives = $DIC->legacyArchives();
    46         $lng = $DIC->language();
    47         $rbacsystem = $DIC->access();
    61         $ilAccess = $DIC->access();
    62         $ilTabs = $DIC->tabs();
    64         $navigationHistory = $DIC[
'ilNavigationHistory'];
    66         $baseClass = 
$refId = $DIC->http()->wrapper()->query()->retrieve(
'baseClass', $DIC->refinery()->kindlyTo()->string());
    68         $ilLog->debug(
"bc:" . $baseClass . 
"; nc:" . $this->
ctrl->getNextClass($this) . 
"; cmd:" . $this->
ctrl->getCmd());
    69         if (strtolower($baseClass) === 
"iladministrationgui" ||
    70             strtolower($baseClass) === 
"ilsahspresentationgui" ||
    78             $this->tpl->setTitle($this->
object->getTitle());
    79             $navigationHistory->addItem(
    81                 ilLink::_getLink($this->
object->getRefId(), $this->
object->getType()),
    86         $next_class = $this->
ctrl->getNextClass($this);
    87         $cmd = $this->
ctrl->getCmd();
    89         switch ($next_class) {
    90             case 'illtiproviderobjectsettinggui':
    92                 $ilTabs->setSubTabActive(
'lti_provider');
    95                 $lti_gui->offerLTIRolesForSelection(
false);
    96                 $this->
ctrl->forwardCommand($lti_gui);
   100             case 'ilobjectmetadatagui':
   101                 if (!$ilAccess->checkAccess(
'write', 
'', $this->object->getRefId())) {
   102                     $ilErr->raiseError($this->
lng->txt(
'permission_denied'), 
$ilErr->WARNING);
   105                 $this->
ctrl->forwardCommand($md_gui);
   114             case 'ilpermissiongui':
   116                 $this->
ctrl->forwardCommand($perm_gui);
   119             case "ilfilesystemgui":
   122                 $fs_gui->setTableId(
"sahsfs" . $this->
object->getId());
   123                 $this->
ctrl->forwardCommand($fs_gui);
   126             case "ilcertificategui":
   128                 $ilTabs->setSubTabActive(
'certificate');
   131                 $output_gui = $guiFactory->create($this->
object);
   133                 $this->
ctrl->forwardCommand($output_gui);
   136             case "illearningprogressgui":
   138                 $this->
ctrl->forwardCommand($new_gui);
   142             case "ilinfoscreengui":
   143                 $ilTabs->setTabActive(
'info_short');
   147             case "ilcommonactiondispatchergui":
   150                     $this->
ctrl->forwardCommand($gui);
   154             case 'ilobjectcopygui':
   157                 $cp->setType(
'sahs');
   158                 $this->
ctrl->forwardCommand($cp);
   163                 $cmd = $this->
ctrl->getCmd(
"properties");
   165                 if ((strtolower($baseClass) === 
"iladministrationgui" ||
   167                     $cmd !== 
"frameset") {
   172                 if ($cmd === 
"redrawHeaderAction") {
   183         if (strtolower($this->
ctrl->getCmd() ?? 
'') === 
'infoscreen') {
   184             $this->
ctrl->redirectByClass(ilInfoScreenGUI::class, 
'showSummary');
   193             $this->error->raiseError($this->
lng->txt(
"msg_no_perm_read"), $this->error->MESSAGE);
   197         $info->enablePrivateNotes();
   198         $info->enableLearningProgress();
   202             $ilToolbar = 
$GLOBALS[
'DIC']->toolbar();
   203             $ilToolbar->addButtonInstance($this->
object->getViewButton());
   206         $info->enableNewsEditing(
false);
   209             $enable_internal_rss = $news_set->get(
"enable_rss_for_internal");
   210             if ($enable_internal_rss) {
   211                 $info->setBlockProperty(
"news", 
"settings", 
"");
   212                 $info->setBlockProperty(
"news", 
"public_notifications_option", 
"true");
   216         $info->addMetaDataSections($this->
object->getId(), 0, $this->
object->getType());
   219         $this->
ctrl->forwardCommand($info);
   240         $this->
ctrl->setParameterByClass(
   245         $this->
ctrl->redirectByClass(ilSAHSEditGUI::class);
   255         $lng = $DIC->language();
   256         $ilCtrl = $DIC->ctrl();
   262         $op0->
setInfo($this->
lng->txt(
"lm_type_scorm_info"));
   263         $radg->addOption($op0);
   264         $op0 = 
new ilRadioOption($this->
lng->txt(
"lm_type_scorm2004"), 
"scorm2004");
   265         $op0->
setInfo($this->
lng->txt(
"lm_type_scorm2004_info"));
   266         $radg->addOption($op0);
   267         $radg->setValue(
"scorm");
   272             $options[
""] = $this->
lng->txt(
"cont_select_from_upload_dir");
   274             foreach ($files as $file) {
   275                 $file = htmlspecialchars($file, ENT_QUOTES, 
"utf-8");
   276                 $options[$file] = $file;
   279         if (count($options) > 1) {
   283             $radg->addOption($op0);
   284             $op1 = 
new ilRadioOption($this->
lng->txt(
"cont_choose_upload_dir"), 
"upload_dir");
   285             $radg->addOption($op1);
   294             $op1->addSubItem($si);
   307         $form->
setFormAction($ilCtrl->getFormAction($this, 
"upload"));
   323         $rbacsystem = $DIC->access();
   326         $refId = $DIC->http()->wrapper()->query()->retrieve(
'ref_id', $DIC->refinery()->kindlyTo()->int());
   327         $importFromXml = 
false;
   330         if (!$rbacsystem->checkAccess(
"create", 
'', 
$refId, 
"sahs")) {
   331             $ilErr->raiseError($this->
lng->txt(
"no_create_permission"), 
$ilErr->WARNING);
   332         } elseif ($_FILES[
"scormfile"][
"name"]) {
   334             $source = $_FILES[
"scormfile"][
"tmp_name"];
   335             if (($source === 
'none') || (!$source)) {
   339             switch ($_FILES[
"scormfile"][
"error"]) {
   340                 case UPLOAD_ERR_INI_SIZE:
   341                 case UPLOAD_ERR_FORM_SIZE:
   342                     $ilErr->raiseError($this->
lng->txt(
"err_max_file_size_exceeds"), 
$ilErr->MESSAGE);
   345                 case UPLOAD_ERR_PARTIAL:
   346                     $ilErr->raiseError($this->
lng->txt(
"err_partial_file_upload"), 
$ilErr->MESSAGE);
   349                 case UPLOAD_ERR_NO_FILE:
   350                     $ilErr->raiseError($this->
lng->txt(
"err_no_file_uploaded"), 
$ilErr->MESSAGE);
   354             $file = pathinfo($_FILES[
"scormfile"][
"name"]);
   355         } elseif ($DIC->http()->wrapper()->post()->has(
'uploaded_file')) {
   356             $uploadedFile = $DIC->http()->wrapper()->post()->retrieve(
'uploaded_file', $DIC->refinery()->kindlyTo()->string());
   359                 $ilErr->raiseError($this->
lng->txt(
"upload_error_file_not_found"), 
$ilErr->MESSAGE);
   362             $file = pathinfo($uploadedFile);
   367         $name = substr($file[
"basename"], 0, strlen($file[
"basename"]) - strlen($file[
"extension"]) - 1);
   369             $name = $this->
lng->txt(
"no_title");
   374         $subType = 
"scorm2004";
   375         if ($DIC->http()->wrapper()->post()->has(
'sub_type')) {
   376             $subType = $DIC->http()->wrapper()->post()->retrieve(
'sub_type', $DIC->refinery()->kindlyTo()->string());
   395         $newObj->setTitle($name);
   396         $newObj->setSubType($subType);
   397         $newObj->setDescription($description);
   398         $newObj->create(
true);
   399         $newObj->createReference();
   400         $newObj->putInTree(
$refId);
   401         $newObj->setPermissions(
$refId);
   402         $newObj->setOfflineStatus(
false);
   405         $newObj->createDataDirectory();
   407         if ($_FILES[
"scormfile"][
"name"]) {
   409             $file_path = $newObj->getDataDirectory() . 
"/" . $_FILES[
"scormfile"][
"name"];
   411                 $_FILES[
"scormfile"][
"tmp_name"],
   412                 $_FILES[
"scormfile"][
"name"],
   415             $this->archives->unzip(
   417                 $newObj->getDataDirectory(),
   424             $uploadedFile = $DIC->http()->wrapper()->post()->retrieve(
'uploaded_file', $DIC->refinery()->kindlyTo()->string());
   425             $file_path = $newObj->getDataDirectory() . 
"/" . $uploadedFile;
   427             $this->archives->unzip(
   429                 $newObj->getDataDirectory(),
   437         $title = $newObj->readObject();
   443         $newObj->setLearningProgressSettingsAtUpload();
   445         if ($importFromXml) {
   446             $importer->writeData(
"sahs", 
"5.1.0", $newObj->getId());
   449         $this->tpl->setOnScreenMessage(
'info', $this->
lng->txt($newObj->getType() . 
"_added"), 
true);
   450         ilUtil::redirect(
"ilias.php?baseClass=ilSAHSEditGUI&ref_id=" . $newObj->getRefId());
   464     protected function importFile(
string $file_to_import, 
string $path_to_uploaded_file_in_temp_dir): void
   468         $ilLog = $DIC[
'log'];
   473         $zar->open($file_to_import);
   474         $zar->extractTo($lm_temp_dir);
   478         $import_dirname = $lm_temp_dir . 
'/' . substr(basename($file_to_import), 0, -4);
   479         $importer->importXmlRepresentation(
"sahs", 
"", $import_dirname, null);
   480         $import_result = $importer->getResult();
   482         if ($import_result->isOK()) {
   483             $properties = $import_result->value();
   484             if (($subType = $properties[
'SubType']) === 
'scorm') {
   489             $name = $properties[
'Title'];
   490             $description = $properties[
'Description'];
   494             $ilLog->error(
'SCORM import of ILIAS exportfile not possible because parsing error');
   495             $ilLog->error($import_result->error());
   496             $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
"import_file_not_valid_here"), 
true);
   500         $new_obj->setTitle($name);
   501         $new_obj->setSubType($subType);
   502         $new_obj->setDescription($description);
   503         $new_obj->create(
true);
   505         $new_obj->setOfflineStatus(
false);
   508         $new_obj->createDataDirectory();
   510         $scorm_file = 
"content.zip";
   511         $scorm_file_path = $import_dirname . 
"/" . $scorm_file;
   512         $file_path = $new_obj->getDataDirectory() . 
"/" . $scorm_file;
   514         $this->archives->unzip(
   516             $new_obj->getDataDirectory(),
   526         $new_obj->setLearningProgressSettingsAtUpload();
   528         $importer->writeData(
"sahs", 
"5.1.0", $new_obj->getId());
   530         $this->tpl->setOnScreenMessage(
'info', $this->
lng->txt($new_obj->getType() . 
"_added"), 
true);
   531         $this->
ctrl->setParameterByClass(self::class, 
'ref_id', $new_obj->getRefId());
   532         $this->
ctrl->redirectByClass(self::class);
   542         $lng = $DIC->language();
   544         $this->tpl->loadStandardTemplate();
   553         $baseClass = 
$refId = $DIC->http()->wrapper()->query()->retrieve(
'baseClass', $DIC->refinery()->kindlyTo()->string());
   555         $this->tpl->setTitle($this->
object->getTitle());
   556         $this->tpl->setDescription($this->
object->getDescription());
   557         if ($this->
object && $this->
object->getOfflineStatus()) {
   558             $this->tpl->setAlertProperties(array(
   559                 array(
"alert" => 
true,
   560                       "property" => $this->
lng->txt(
"status"),
   561                       "value" => $this->
lng->txt(
"offline"))
   564         if (strtolower($baseClass) === 
"ilsahseditgui" || strtolower($baseClass) === 
"ilrepositorygui") {
   575         $output_gui = $guiFactory->create($this->
object);
   577         $output_gui->certificateEditor();
   587         $rbacsystem = $DIC->access();
   588         $ilCtrl = $DIC->ctrl();
   589         $ilHelp = $DIC->help();
   591         if ($this->
ctrl->getCmd() === 
"delete") {
   595         switch ($this->
object->getSubType()) {
   597                 $ilHelp->setScreenIdComponent(
"sahs13");
   601                 $ilHelp->setScreenIdComponent(
"sahs12");
   607         if ($rbacsystem->checkAccess(
"write", 
"", $this->object->getRefId())) {
   608             $ilCtrl->setParameterByClass(
"ilfilesystemgui", 
"resetoffset", 1);
   609             $this->tabs_gui->addTarget(
   611                 $this->
ctrl->getLinkTargetByClass(
"ilfilesystemgui", 
"listFiles"),
   615             $ilCtrl->setParameterByClass(
"ilfilesystemgui", 
"resetoffset", 
"");
   618         $force_active = ($this->
ctrl->getNextClass() === 
"ilinfoscreengui")
   621         $this->tabs_gui->addTarget(
   623             $this->
ctrl->getLinkTargetByClass(
"ilinfoscreengui", 
"showSummary"),
   631         $this->tabs_gui->addTarget(
   633             $this->
ctrl->getLinkTarget($this, 
"properties"),
   634             array(
"", 
"properties"),
   648         if ($rbacsystem->checkAccess(
"read_learning_progress", 
"", $this->object->getRefId()) || $rbacsystem->checkAccess(
"edit_learning_progress", 
"", $this->object->getRefId())) {
   650             if ($rbacsystem->checkAccess(
"read_learning_progress", 
"", $this->object->getRefId())) {
   651                 $ar_rights = [
'illplistofobjectsgui'];
   653             if ($rbacsystem->checkAccess(
"edit_learning_progress", 
"", $this->object->getRefId())) {
   654                 $ar_rights[] = 
'illplistofsettingsgui';
   657                 $this->tabs_gui->addTarget(
   659                     $this->
ctrl->getLinkTargetByClass(array(
'illearningprogressgui'), 
''),
   665             if ($this->
object->getSubType() === 
"scorm2004" || $this->
object->getSubType() === 
"scorm") {
   667                 if ($privacy->enabledSahsProtocolData()) {
   668                     $scormClass = 
"ilobjscormlearningmodulegui";
   669                     if ($this->
object->getSubType() === 
"scorm2004") {
   670                         $scormClass = 
"ilobjscorm2004learningmodulegui";
   672                     $this->
ctrl->setParameterByClass($scormClass, 
"ref_id", $this->
object->getRefId());
   673                     $this->tabs_gui->addTarget(
   674                         "cont_tracking_data",
   675                         $this->
ctrl->getLinkTargetByClass([
'ilsahseditgui',$scormClass], 
"showTrackingItems"),
   682         if ($rbacsystem->checkAccess(
"write", 
"", $this->object->getRefId())) {
   684             $mdtab = $mdgui->getTab();
   686                 $this->tabs_gui->addTarget(
   695         if ($rbacsystem->checkAccess(
"edit", 
"", $this->object->getRefId())) {
   696             $this->tabs_gui->addTarget(
   698                 $this->
ctrl->getLinkTarget($this, 
"export"),
   705         if ($rbacsystem->checkAccess(
'edit_permission', 
"", $this->object->getRefId())) {
   706             $this->tabs_gui->addTarget(
   708                 $this->
ctrl->getLinkTargetByClass(array(get_class($this),
'ilpermissiongui'), 
"perm"),
   709                 array(
"perm",
"info",
"owner"),
   719     public static function _goto(
string $a_target): void
   722         $main_tpl = $DIC->ui()->mainTemplate();
   723         $ilAccess = $DIC->access();
   725         $lng = $DIC->language();
   727         $targetParameters = explode(
'_', $a_target);
   728         $id = (
int) $targetParameters[0];
   734         if ($ilAccess->checkAccess(
"write", 
"", 
$id)) {
   735             $DIC->ctrl()->setParameterByClass(
"ilSAHSEditGUI", 
"ref_id", (
string) 
$id);
   736             $DIC->ctrl()->redirectByClass(
"ilSAHSEditGUI", 
"infoScreen"); 
   739         if ($ilAccess->checkAccess(
"visible", 
"", 
$id) || $ilAccess->checkAccess(
"read", 
"", 
$id)) {
   740             $DIC->ctrl()->setParameterByClass(
"ilSAHSPresentationGUI", 
"ref_id", (
string) 
$id);
   741             $DIC->ctrl()->redirectByClass(
"ilSAHSPresentationGUI", 
"infoScreen");
   744                 $main_tpl->setOnScreenMessage(
'info', sprintf(
   745                     $lng->
txt(
"msg_no_perm_read_item"),
   761         $ilLocator = $DIC[
'ilLocator'];
   763         if (is_object($this->
object)) {
   765                 $this->
object->getTitle(),
   766                 $this->
ctrl->getLinkTargetByClass(
"ilinfoscreengui", 
"showSummary"),
   768                 $DIC->http()->wrapper()->query()->retrieve(
'ref_id', $DIC->refinery()->kindlyTo()->int())
   797         $lng = $DIC->language();
   798         $ilTabs = $DIC->tabs();
   799         $ilCtrl = $DIC->ctrl();
   801         $ilTabs->addSubTabTarget(
   803             $this->
ctrl->getLinkTarget($this, 
"properties"),
   808         $ilTabs->addSubTabTarget(
   809             "cont_sc_new_version",
   810             $this->
ctrl->getLinkTarget($this, 
"newModuleVersion"),
   816         if (
true === $validator->validate()) {
   823             $ilTabs->addSubTabTarget(
   825                 $this->
ctrl->getLinkTargetByClass([static::class, 
"ilcertificategui"], 
"certificateeditor"),
   832         if ($lti_settings->hasSettingsAccess()) {
   833             $ilTabs->addSubTabTarget(
   835                 $this->
ctrl->getLinkTargetByClass(ilLTIProviderObjectSettingGUI::class)
   839         $ilTabs->setTabActive(
'settings');
   847         $GLOBALS[
'DIC']->tabs()->setTabActive(
'export');
   851         $exp_gui->addFormat(
"xml");
   852         return $this->
ctrl->forwardCommand($exp_gui);
   860         $moduleId = 
ilObject::_lookupObjectId($DIC->http()->wrapper()->query()->retrieve(
'ref_id', $DIC->refinery()->kindlyTo()->int()));
 This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
 
static _writeTitle(int $obj_id, string $title)
write title to db (static) 
 
importFile(string $file_to_import, string $path_to_uploaded_file_in_temp_dir)
 
static getLogger(string $a_component_id)
Get component logger. 
 
static _copyUploadFile(string $a_file, string $a_target, bool $a_raise_errors=true)
 
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
 
GUI class for the workflow of copying objects. 
 
static _goto(string $a_target)
goto target course 
 
prepareOutput(bool $show_sub_objects=true)
 
certificate()
Shows the certificate editor. 
 
getTemplate()
output main header (title and locator) 
 
static _getUploadDirectory()
 
loadLanguageModule(string $a_module)
Load language module. 
 
__construct($data, int $id, bool $call_by_reference, bool $prepare_output=true)
Constructor. 
 
static checkAccess(int $a_ref_id, bool $a_allow_only_read=true)
check access to learning progress 
 
setSettingsSubTabs()
List files. 
 
initCreateForm(string $new_type)
 
static _lookupObjId(int $ref_id)
 
static renameExecutables(string $a_dir)
 
deleteUploadedImportFile(string $path_to_uploaded_file_in_temp_dir)
 
static _lookupTitle(int $obj_id)
 
GUI class for LTI provider object settings. 
 
Class ilObjectGUI Basic methods of all Output classes. 
 
static delDir(string $a_dir, bool $a_clean_only=false)
removes a dir and all its content (subdirs and files) recursively 
 
setValue(string $a_value)
 
static getImagePath(string $image_name, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory) 
 
static _lookupObjectId(int $ref_id)
 
setUseUploadDirectory(bool $a_val)
 
getTabs()
adds tabs to tab gui object 
 
static moveUploadedFile(string $a_file, string $a_name, string $a_target, bool $a_raise_errors=true, string $a_mode="move_uploaded")
move uploaded file 
 
setCustomRolesForSelection(array $a_roles)
Set custom roles for mapping to LTI roles. 
 
checkPermissionBool(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
 
static redirect(string $a_script)
 
putObjectInTree(ilObject $obj, int $parent_node_id=null)
Add object to tree at given position. 
 
static ilTempnam(?string $a_temp_path=null)
Returns a unique and non existing Path for e temporary file or directory. 
 
properties()
module properties 
 
__construct(Container $dic, ilPlugin $plugin)
 
const LP_CONTEXT_REPOSITORY
 
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
 
static _checkUploadFile(string $a_file)
 
static rename(string $a_source, string $a_target)
 
File System Explorer GUI class. 
 
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
 
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
 
static getInstanceFromAjaxCall()
(Re-)Build instance from ajax call 
 
static makeDir(string $a_dir)
creates a new directory and inherits all filesystem permissions of the parent directory You may pass ...
 
static _gotoRepositoryRoot(bool $raise_error=false)
Goto repository root. 
 
executeCommand()
execute command 
 
uploadObject()
display status information or report errors messages in case of error