ILIAS  trunk Revision v11.0_alpha-1723-g8e69f309bab
All Data Structures Namespaces Files Functions Variables Enumerations Enumerator Modules Pages
ilObjSAHSLearningModuleGUI Class Reference

SCORM Learning Modules. More...

+ Inheritance diagram for ilObjSAHSLearningModuleGUI:
+ Collaboration diagram for ilObjSAHSLearningModuleGUI:

Public Member Functions

 __construct ($data, int $id, bool $call_by_reference, bool $prepare_output=true)
 Constructor. More...
 
 executeCommand ()
 execute command More...
 
 properties ()
 module properties More...
 
 saveProperties ()
 
 uploadObject ()
 display status information or report errors messages in case of error More...
 
 upload ()
 
 getTemplate ()
 output main header (title and locator) More...
 
 certificate ()
 Shows the certificate editor. More...
 
 addLocatorItems ()
 
 setSettingsSubTabs ()
 List files. More...
 
 export ()
 
 exportModule ()
 
 getType ()
 
- Public Member Functions inherited from ilObjectGUI
 getRefId ()
 
 setAdminMode (string $mode)
 
 getAdminMode ()
 
 getObject ()
 
 executeCommand ()
 
 withReferences ()
 determines whether objects are referenced or not (got ref ids or not) More...
 
 setCreationMode (bool $mode=true)
 If true, a creation screen is displayed the current [ref_id] does belong to the parent class The mode is determined in ilRepositoryGUI. More...
 
 getCreationMode ()
 
 prepareOutput (bool $show_sub_objects=true)
 
 getAdminTabs ()
 administration tabs show only permissions and trash folder More...
 
 getHTML ()
 
 confirmedDeleteObject ()
 confirmed deletion of object -> objects are moved to trash or deleted immediately, if trash is disabled More...
 
 cancelObject ()
 cancel action and go back to previous page More...
 
 createObject ()
 create new object form More...
 
 editAvailabilityPeriodObject ()
 
 saveAvailabilityPeriodObject ()
 
 cancelCreation ()
 cancel create action and go back to repository parent More...
 
 saveObject ()
 
 getDidacticTemplateVar (string $type)
 Get didactic template setting from creation screen. More...
 
 putObjectInTree (ilObject $obj, ?int $parent_node_id=null)
 Add object to tree at given position. More...
 
 editObject ()
 
 addExternalEditFormCustom (ilPropertyFormGUI $form)
 
 updateObject ()
 updates object entry in object_data More...
 
 getFormAction (string $cmd, string $default_form_action="")
 Get form action for command (command is method name without "Object", e.g. More...
 
 isVisible (int $ref_id, string $type)
 
 viewObject ()
 viewObject container presentation for "administration -> repository, trash, permissions" More...
 
 deleteObject (bool $error=false)
 Display deletion confirmation screen. More...
 
 setColumnSettings (ilColumnGUI $column_gui)
 
 addToDeskObject ()
 
 removeFromDeskObject ()
 
- Public Member Functions inherited from ILIAS\Object\ImplementsCreationCallback
 callCreationCallback (\ilObject $object, \ilObjectDefinition $obj_definition, int $requested_crtcb)
 

Static Public Member Functions

static _goto (string $a_target)
 goto target course More...
 
- Static Public Member Functions inherited from ilObjectGUI
static _gotoRepositoryRoot (bool $raise_error=false)
 Goto repository root. More...
 
static _gotoRepositoryNode (int $ref_id, string $cmd="")
 
static _gotoSharedWorkspaceNode (int $wsp_id)
 

Protected Member Functions

 infoScreen ()
 
 infoScreenForward ()
 
 initCreateForm (string $new_type)
 
 importFile (string $file_to_import, string $path_to_uploaded_file_in_temp_dir)
 
 setTabs ()
 
 getTabs ()
 adds tabs to tab gui object More...
 
- Protected Member Functions inherited from ilObjectGUI
 getObjectService ()
 
 assignObject ()
 
 setTitleAndDescription ()
 
 createActionDispatcherGUI ()
 
 initHeaderAction (?string $sub_type=null, ?int $sub_id=null)
 Add header action menu. More...
 
 insertHeaderAction (?ilObjectListGUI $list_gui=null)
 Insert header action into main template. More...
 
 addHeaderAction ()
 Add header action menu. More...
 
 redrawHeaderActionObject ()
 Ajax call: redraw action header only. More...
 
 setTabs ()
 set admin tabs More...
 
 setAdminTabs ()
 set admin tabs More...
 
 setLocator ()
 
 addLocatorItems ()
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 omitLocator (bool $omit=true)
 
 addAdminLocatorItems (bool $do_not_add_object=false)
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 getCreationFormsHTML (StandardForm|ilPropertyFormGUI|array $form)
 
 getTitleForCreationFormPage ()
 
 getCreationFormTitle ()
 
 initCreateForm (string $new_type)
 
 didacticTemplatesToForm ()
 
 initDidacticTemplate (ilPropertyFormGUI $form)
 
 retrieveAdditionalDidacticTemplateOptions ()
 
 addAdoptContentLinkToToolbar ()
 
 addImportButtonToToolbar ()
 
 addAvailabilityPeriodButtonToToolbar (ilToolbarGUI $toolbar)
 
 parseDidacticTemplateVar (string $var, string $type)
 
 afterSave (ilObject $new_object)
 Post (successful) object creation hook. More...
 
 initEditForm ()
 
 initEditCustomForm (ilPropertyFormGUI $a_form)
 Add custom fields to update form. More...
 
 getEditFormValues ()
 
 getEditFormCustomValues (array &$a_values)
 Add values to custom edit fields. More...
 
 validateCustom (ilPropertyFormGUI $form)
 Validate custom values (if not possible with checkInput()) More...
 
 updateCustom (ilPropertyFormGUI $form)
 Insert custom update form values into object. More...
 
 afterUpdate ()
 Post (successful) object update hook. More...
 
 routeImportCmdObject ()
 
 importFile (string $file_to_import, string $path_to_uploaded_file_in_temp_dir)
 
 deleteUploadedImportFile (string $path_to_uploaded_file_in_temp_dir)
 
 afterImport (ilObject $new_object)
 Post (successful) object import hook. More...
 
 setFormAction (string $cmd, string $form_action)
 
 getReturnLocation (string $cmd, string $default_location="")
 Get return location for command (command is method name without "Object", e.g. More...
 
 setReturnLocation (string $cmd, string $location)
 set specific return location for command More...
 
 getTargetFrame (string $cmd, string $default_target_frame="")
 get target frame for command (command is method name without "Object", e.g. More...
 
 setTargetFrame (string $cmd, string $target_frame)
 Set specific target frame for command. More...
 
 showPossibleSubObjects ()
 show possible sub objects (pull down menu) More...
 
 getTabs ()
 overwrite in derived GUI class of your object type More...
 
 redirectToRefId (int $ref_id, string $cmd="")
 redirects to (repository) view per ref id usually to a container and usually used at the end of a save/import method where the object gui type (of the new object) doesn't match with the type of the current ["ref_id"] value of the request More...
 
 getCenterColumnHTML ()
 Get center column. More...
 
 getRightColumnHTML ()
 Display right column. More...
 
 checkPermission (string $perm, string $cmd="", string $type="", ?int $ref_id=null)
 
 checkPermissionBool (string $perm, string $cmd="", string $type="", ?int $ref_id=null)
 
 enableDragDropFileUpload ()
 Enables the file upload into this object by dropping files. More...
 
 getCreatableObjectTypes ()
 
 buildAddNewItemElements (array $subtypes, string $create_target_class=ilRepositoryGUI::class, ?int $redirect_target_ref_id=null,)
 
 buildGroup (string $create_target_class, array $obj_types_in_group, string $title, array $subtypes)
 

Private Attributes

ilPropertyFormGUI $form
 
 $archives
 

Additional Inherited Members

- Data Fields inherited from ilObjectGUI
const ADMIN_MODE_NONE = ""
 
const ADMIN_MODE_SETTINGS = "settings"
 
const ADMIN_MODE_REPOSITORY = "repository"
 
const UPLOAD_TYPE_LOCAL = 1
 
const UPLOAD_TYPE_UPLOAD_DIRECTORY = 2
 
const CFORM_NEW = 1
 
const CFORM_IMPORT = 2
 
const CFORM_CLONE = 3
 
const SUPPORTED_IMPORT_MIME_TYPES = [MimeType::APPLICATION__ZIP, MimeType::APPLICATION__X_ZIP_COMPRESSED]
 
- Protected Attributes inherited from ilObjectGUI
ILIAS Notes Service $notes_service
 
ServerRequestInterface $request
 
ilLocatorGUI $locator
 
ilObjUser $user
 
ilAccessHandler $access
 
ilSetting $settings
 
ilToolbarGUI $toolbar
 
ilRbacAdmin $rbac_admin
 
ilRbacSystem $rbac_system
 
ilRbacReview $rbac_review
 
ilObjectService $object_service
 
ilObjectDefinition $obj_definition
 
ilGlobalTemplateInterface $tpl
 
ilTree $tree
 
ilCtrl $ctrl
 
ilErrorHandling $error
 
ilLanguage $lng
 
ilTabsGUI $tabs_gui
 
ILIAS $ilias
 
ArrayBasedRequestWrapper $post_wrapper
 
RequestWrapper $request_wrapper
 
Refinery $refinery
 
ilFavouritesManager $favourites
 
ilObjectCustomIconFactory $custom_icon_factory
 
UIFactory $ui_factory
 
UIRenderer $ui_renderer
 
Filesystem $temp_file_system
 
ilObject $object = null
 
bool $creation_mode = false
 
 $data
 
int $id
 
bool $call_by_reference = false
 
bool $prepare_output
 
int $ref_id
 
int $obj_id
 
int $maxcount
 
array $form_action = []
 
array $return_location = []
 
array $target_frame = []
 
string $tmp_import_dir
 
string $sub_objects = ""
 
bool $omit_locator = false
 
string $type = ""
 
string $admin_mode = self::ADMIN_MODE_NONE
 
int $requested_ref_id = 0
 
int $requested_crtptrefid = 0
 
int $requested_crtcb = 0
 
string $requested_new_type = ""
 
string $link_params
 
string $html = ""
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilObjSAHSLearningModuleGUI::__construct (   $data,
int  $id,
bool  $call_by_reference,
bool  $prepare_output = true 
)

Constructor.

Definition at line 42 of file class.ilObjSAHSLearningModuleGUI.php.

References ilObjectGUI\$data, $DIC, ilObjectGUI\$lng, ILIAS\GlobalScreen\Provider\__construct(), and ilLanguage\loadLanguageModule().

43  {
44  global $DIC;
45  $this->archives = $DIC->legacyArchives();
46  $lng = $DIC->language();
47  $rbacsystem = $DIC->access();
48  $lng->loadLanguageModule("content");
49  $this->type = "sahs";
51  }
loadLanguageModule(string $a_module)
Load language module.
ilLanguage $lng
global $DIC
Definition: shib_login.php:22
__construct(Container $dic, ilPlugin $plugin)
+ Here is the call graph for this function:

Member Function Documentation

◆ _goto()

static ilObjSAHSLearningModuleGUI::_goto ( string  $a_target)
static

goto target course

Definition at line 719 of file class.ilObjSAHSLearningModuleGUI.php.

References $DIC, ilObjectGUI\$id, $ilErr, ilObjectGUI\$lng, ilObjectGUI\_gotoRepositoryRoot(), ilObject\_lookupObjId(), ilObject\_lookupTitle(), ILIAS\Repository\int(), ROOT_FOLDER_ID, and ilLanguage\txt().

Referenced by ILIAS\StaticURL\Handler\LegacyGotoHandler\handle().

719  : void
720  {
721  global $DIC;
722  $main_tpl = $DIC->ui()->mainTemplate();
723  $ilAccess = $DIC->access();
724  $ilErr = $DIC['ilErr'];
725  $lng = $DIC->language();
726 
727  $targetParameters = explode('_', $a_target);
728  $id = (int) $targetParameters[0];
729 
730  if ($id <= 0) {
731  $ilErr->raiseError($lng->txt('msg_no_perm_read'), $ilErr->FATAL);
732  }
733 
734  if ($ilAccess->checkAccess("write", "", $id)) {
735  $DIC->ctrl()->setParameterByClass("ilSAHSEditGUI", "ref_id", (string) $id);
736  $DIC->ctrl()->redirectByClass("ilSAHSEditGUI", "infoScreen"); //cmd was "" in 7
737  }
738 
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");
742  } else {
743  if ($ilAccess->checkAccess("read", "", ROOT_FOLDER_ID)) {
744  $main_tpl->setOnScreenMessage('info', sprintf(
745  $lng->txt("msg_no_perm_read_item"),
747  ), true);
749  }
750  }
751 
752  $ilErr->raiseError($lng->txt("msg_no_perm_read"), $ilErr->FATAL);
753  }
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...
const ROOT_FOLDER_ID
Definition: constants.php:32
$ilErr
Definition: raiseError.php:33
static _lookupObjId(int $ref_id)
ilLanguage $lng
static _lookupTitle(int $obj_id)
global $DIC
Definition: shib_login.php:22
static _gotoRepositoryRoot(bool $raise_error=false)
Goto repository root.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ addLocatorItems()

ilObjSAHSLearningModuleGUI::addLocatorItems ( )
Exceptions
ilCtrlException

Definition at line 758 of file class.ilObjSAHSLearningModuleGUI.php.

References $DIC, ILIAS\Repository\ctrl(), and ILIAS\Repository\object().

758  : void
759  {
760  global $DIC;
761  $ilLocator = $DIC['ilLocator'];
762 
763  if (is_object($this->object)) {
764  $ilLocator->addItem(
765  $this->object->getTitle(),
766  $this->ctrl->getLinkTargetByClass("ilinfoscreengui", "showSummary"),
767  "",
768  $DIC->http()->wrapper()->query()->retrieve('ref_id', $DIC->refinery()->kindlyTo()->int())
769  );
770  }
771  }
global $DIC
Definition: shib_login.php:22
+ Here is the call graph for this function:

◆ certificate()

ilObjSAHSLearningModuleGUI::certificate ( )

Shows the certificate editor.

Definition at line 572 of file class.ilObjSAHSLearningModuleGUI.php.

572  : void
573  {
574  $guiFactory = new ilCertificateGUIFactory();
575  $output_gui = $guiFactory->create($this->object);
576 
577  $output_gui->certificateEditor();
578  }

◆ executeCommand()

ilObjSAHSLearningModuleGUI::executeCommand ( )

execute command

Exceptions
ilCtrlException
ilException

Definition at line 58 of file class.ilObjSAHSLearningModuleGUI.php.

References $DIC, $GLOBALS, $ilErr, $refId, ILIAS\Repository\ctrl(), ilObjectGUI\getCreationMode(), ilUtil\getImagePath(), ilCommonActionDispatcherGUI\getInstanceFromAjaxCall(), ilLoggerFactory\getLogger(), getTemplate(), infoScreenForward(), ILIAS\Repository\lng(), ilLearningProgressBaseGUI\LP_CONTEXT_REPOSITORY, null, ILIAS\Repository\object(), ilObjectGUI\prepareOutput(), ILIAS\Repository\rbac(), ilLTIProviderObjectSettingGUI\setCustomRolesForSelection(), ilObjectGUI\setLocator(), setSettingsSubTabs(), setTabs(), and ilFileSystemGUI\setUseUploadDirectory().

58  : void
59  {
60  global $DIC;
61  $ilAccess = $DIC->access();
62  $ilTabs = $DIC->tabs();
63  $ilErr = $DIC['ilErr'];
64  $navigationHistory = $DIC['ilNavigationHistory'];
65 
66  $baseClass = $refId = $DIC->http()->wrapper()->query()->retrieve('baseClass', $DIC->refinery()->kindlyTo()->string());
67  $ilLog = ilLoggerFactory::getLogger('sahs');
68  $ilLog->debug("bc:" . $baseClass . "; nc:" . $this->ctrl->getNextClass($this) . "; cmd:" . $this->ctrl->getCmd());
69  if (strtolower($baseClass) === "iladministrationgui" ||
70  strtolower($baseClass) === "ilsahspresentationgui" ||
71  $this->getCreationMode() == true) {
72  $this->prepareOutput();
73  } else {
74  $this->getTemplate();
75  $this->setLocator();
76  $this->setTabs();
77  $this->tpl->setTitleIcon(ilUtil::getImagePath("standard/icon_lm.svg"));
78  $this->tpl->setTitle($this->object->getTitle());
79  $navigationHistory->addItem(
80  $this->object->getRefId(),
81  ilLink::_getLink($this->object->getRefId(), $this->object->getType()),
82  $this->object->getType()
83  );
84  }
85 
86  $next_class = $this->ctrl->getNextClass($this);
87  $cmd = $this->ctrl->getCmd();
88 
89  switch ($next_class) {
90  case 'illtiproviderobjectsettinggui':
91  $this->setSettingsSubTabs();
92  $ilTabs->setSubTabActive('lti_provider');
93  $lti_gui = new ilLTIProviderObjectSettingGUI($this->object->getRefId());
94  $lti_gui->setCustomRolesForSelection($GLOBALS['DIC']->rbac()->review()->getLocalRoles($this->object->getRefId()));
95  $lti_gui->offerLTIRolesForSelection(false);
96  $this->ctrl->forwardCommand($lti_gui);
97  break;
98 
99 
100  case 'ilobjectmetadatagui':
101  if (!$ilAccess->checkAccess('write', '', $this->object->getRefId())) {
102  $ilErr->raiseError($this->lng->txt('permission_denied'), $ilErr->WARNING);
103  }
104  $md_gui = new ilObjectMetaDataGUI($this->object);
105  $this->ctrl->forwardCommand($md_gui);
106  break;
107 
108  // case 'ilexportgui':
109  // $exp = new ilExportGUI($this);
110  // $exp->addFormat('xml');
111  // $this->ctrl->forwardCommand($exp);
112  // break;
113 
114  case 'ilpermissiongui':
115  $perm_gui = new ilPermissionGUI($this);
116  $this->ctrl->forwardCommand($perm_gui);
117  break;
118 
119  case "ilfilesystemgui":
120  $fs_gui = new ilFileSystemGUI($this->object->getDataDirectory());
121  $fs_gui->setUseUploadDirectory(true);
122  $fs_gui->setTableId("sahsfs" . $this->object->getId());
123  $this->ctrl->forwardCommand($fs_gui);
124  break;
125 
126  case "ilcertificategui":
127  $this->setSettingsSubTabs();
128  $ilTabs->setSubTabActive('certificate');
129 
130  $guiFactory = new ilCertificateGUIFactory();
131  $output_gui = $guiFactory->create($this->object);
132 
133  $this->ctrl->forwardCommand($output_gui);
134  break;
135 
136  case "illearningprogressgui":
138  $this->ctrl->forwardCommand($new_gui);
139 
140  break;
141 
142  case "ilinfoscreengui":
143  $ilTabs->setTabActive('info_short');
144  $this->infoScreenForward();
145  break;
146 
147  case "ilcommonactiondispatchergui":
149  if ($gui !== null) {
150  $this->ctrl->forwardCommand($gui);
151  }
152  break;
153 
154  case 'ilobjectcopygui':
155  $this->prepareOutput();
156  $cp = new ilObjectCopyGUI($this);
157  $cp->setType('sahs');
158  $this->ctrl->forwardCommand($cp);
159  break;
160 
161  default:
162  // if ($this->object && !$this->object->getEditable()) {
163  $cmd = $this->ctrl->getCmd("properties");
164  // }
165  if ((strtolower($baseClass) === "iladministrationgui" ||
166  $this->getCreationMode() == true) &&
167  $cmd !== "frameset") {
168  $cmd .= "Object";
169  }
170 
171  // #9225
172  if ($cmd === "redrawHeaderAction") {
173  $cmd .= "Object";
174  }
175 
176  $this->$cmd();
177  break;
178  }
179  }
Class ilObjectMetaDataGUI.
static getLogger(string $a_component_id)
Get component logger.
GUI class for the workflow of copying objects.
prepareOutput(bool $show_sub_objects=true)
getTemplate()
output main header (title and locator)
$refId
Definition: xapitoken.php:58
$ilErr
Definition: raiseError.php:33
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
$GLOBALS["DIC"]
Definition: wac.php:53
GUI class for LTI provider object settings.
global $DIC
Definition: shib_login.php:22
static getImagePath(string $image_name, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
setUseUploadDirectory(bool $a_val)
setCustomRolesForSelection(array $a_roles)
Set custom roles for mapping to LTI roles.
File System Explorer GUI class.
Class ilObjUserTrackingGUI.
static getInstanceFromAjaxCall()
(Re-)Build instance from ajax call
+ Here is the call graph for this function:

◆ export()

ilObjSAHSLearningModuleGUI::export ( )
Exceptions
ilCtrlException

Definition at line 845 of file class.ilObjSAHSLearningModuleGUI.php.

References $GLOBALS, and ILIAS\Repository\ctrl().

845  : mixed
846  {
847  $GLOBALS['DIC']->tabs()->setTabActive('export');
848  $exp_gui = new ilExportGUI($this);
849  // @todo: removed deprecated ilCtrl methods, this needs inspection by a maintainer.
850  // $this->ctrl->setCmd("listExportFiles");
851  $exp_gui->addFormat("xml");
852  return $this->ctrl->forwardCommand($exp_gui);
853  }
$GLOBALS["DIC"]
Definition: wac.php:53
+ Here is the call graph for this function:

◆ exportModule()

ilObjSAHSLearningModuleGUI::exportModule ( )

Definition at line 855 of file class.ilObjSAHSLearningModuleGUI.php.

References $DIC, and ilObject\_lookupObjectId().

855  : void
856  {
857  global $DIC;
858  // $ilDB = $DIC->database();
859  //
860  $moduleId = ilObject::_lookupObjectId($DIC->http()->wrapper()->query()->retrieve('ref_id', $DIC->refinery()->kindlyTo()->int()));
861  $exporter = new ilScormAiccExporter();
862  // $xml = $exporter->getXmlRepresentation("sahs", "5.1.0", $moduleId);
863  }
global $DIC
Definition: shib_login.php:22
static _lookupObjectId(int $ref_id)
+ Here is the call graph for this function:

◆ getTabs()

ilObjSAHSLearningModuleGUI::getTabs ( )
protected

adds tabs to tab gui object

Exceptions
ilCtrlException

Definition at line 584 of file class.ilObjSAHSLearningModuleGUI.php.

References $DIC, ilLearningProgressAccess\checkAccess(), ILIAS\Repository\ctrl(), ilPrivacySettings\getInstance(), and ILIAS\Repository\object().

Referenced by setTabs().

584  : void
585  {
586  global $DIC;
587  $rbacsystem = $DIC->access();
588  $ilCtrl = $DIC->ctrl();
589  $ilHelp = $DIC->help();
590 
591  if ($this->ctrl->getCmd() === "delete") {
592  return;
593  }
594 
595  switch ($this->object->getSubType()) {
596  case "scorm2004":
597  $ilHelp->setScreenIdComponent("sahs13");
598  break;
599 
600  case "scorm":
601  $ilHelp->setScreenIdComponent("sahs12");
602  break;
603  }
604 
605  // file system gui tabs
606  // properties
607  if ($rbacsystem->checkAccess("write", "", $this->object->getRefId())) {
608  $ilCtrl->setParameterByClass("ilfilesystemgui", "resetoffset", 1);
609  $this->tabs_gui->addTarget(
610  "cont_list_files",
611  $this->ctrl->getLinkTargetByClass("ilfilesystemgui", "listFiles"),
612  "",
613  "ilfilesystemgui"
614  );
615  $ilCtrl->setParameterByClass("ilfilesystemgui", "resetoffset", "");
616  }
617  // info screen
618  $force_active = ($this->ctrl->getNextClass() === "ilinfoscreengui")
619  ? true
620  : false;
621  $this->tabs_gui->addTarget(
622  "info_short",
623  $this->ctrl->getLinkTargetByClass("ilinfoscreengui", "showSummary"),
624  "",
625  "ilinfoscreengui",
626  "",
627  $force_active
628  );
629 
630  // properties
631  $this->tabs_gui->addTarget(
632  "settings",
633  $this->ctrl->getLinkTarget($this, "properties"),
634  array("", "properties"),
635  get_class($this)
636  );
637 
638  // if (ilLearningProgressAccess::checkAccess($this->object->getRefId())) {
639  // $this->tabs_gui->addTarget(
640  // 'learning_progress',
641  // $this->ctrl->getLinkTargetByClass(array('illearningprogressgui'), ''),
642  // '',
643  // array('illplistofobjectsgui','illplistofsettingsgui','illearningprogressgui','illplistofprogressgui')
644  // );
645  // }
646 
647  // tracking data
648  if ($rbacsystem->checkAccess("read_learning_progress", "", $this->object->getRefId()) || $rbacsystem->checkAccess("edit_learning_progress", "", $this->object->getRefId())) {
649  $ar_rights = [];
650  if ($rbacsystem->checkAccess("read_learning_progress", "", $this->object->getRefId())) {
651  $ar_rights = ['illplistofobjectsgui'];
652  }
653  if ($rbacsystem->checkAccess("edit_learning_progress", "", $this->object->getRefId())) {
654  $ar_rights[] = 'illplistofsettingsgui';
655  }
656  if (ilLearningProgressAccess::checkAccess($this->object->getRefId())) {
657  $this->tabs_gui->addTarget(
658  'learning_progress',
659  $this->ctrl->getLinkTargetByClass(array('illearningprogressgui'), ''),
660  '',
661  $ar_rights
662  );
663  }
664 
665  if ($this->object->getSubType() === "scorm2004" || $this->object->getSubType() === "scorm") {
666  $privacy = ilPrivacySettings::getInstance();
667  if ($privacy->enabledSahsProtocolData()) {
668  $scormClass = "ilobjscormlearningmodulegui";
669  if ($this->object->getSubType() === "scorm2004") {
670  $scormClass = "ilobjscorm2004learningmodulegui";
671  }
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"),
676  "showTrackingItems"
677  );
678  }
679  }
680  }
681 
682  if ($rbacsystem->checkAccess("write", "", $this->object->getRefId())) {
683  $mdgui = new ilObjectMetaDataGUI($this->object);
684  $mdtab = $mdgui->getTab();
685  if ($mdtab) {
686  $this->tabs_gui->addTarget(
687  "meta_data",
688  $mdtab,
689  "",
690  "ilmdeditorgui"
691  );
692  }
693  }
694  // export - Jour Fixe Date for Decission not to allow for Users with Right Wirite?
695  if ($rbacsystem->checkAccess("edit", "", $this->object->getRefId())) {
696  $this->tabs_gui->addTarget(
697  "export",
698  $this->ctrl->getLinkTarget($this, "export"),
699  array("", "export"),
700  get_class($this)
701  );
702  }
703 
704  // perm
705  if ($rbacsystem->checkAccess('edit_permission', "", $this->object->getRefId())) {
706  $this->tabs_gui->addTarget(
707  "perm_settings",
708  $this->ctrl->getLinkTargetByClass(array(get_class($this),'ilpermissiongui'), "perm"),
709  array("perm","info","owner"),
710  'ilpermissiongui'
711  );
712  }
713  }
Class ilObjectMetaDataGUI.
static checkAccess(int $a_ref_id, bool $a_allow_only_read=true)
check access to learning progress
global $DIC
Definition: shib_login.php:22
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getTemplate()

ilObjSAHSLearningModuleGUI::getTemplate ( )

output main header (title and locator)

Definition at line 539 of file class.ilObjSAHSLearningModuleGUI.php.

References $DIC, and ilObjectGUI\$lng.

Referenced by executeCommand().

539  : void
540  {
541  global $DIC;
542  $lng = $DIC->language();
543 
544  $this->tpl->loadStandardTemplate();
545  }
ilLanguage $lng
global $DIC
Definition: shib_login.php:22
+ Here is the caller graph for this function:

◆ getType()

ilObjSAHSLearningModuleGUI::getType ( )

Definition at line 865 of file class.ilObjSAHSLearningModuleGUI.php.

865  : string
866  {
867  return "sahs";
868  }

◆ importFile()

ilObjSAHSLearningModuleGUI::importFile ( string  $file_to_import,
string  $path_to_uploaded_file_in_temp_dir 
)
protected

ILIAS $DIC

Definition at line 464 of file class.ilObjSAHSLearningModuleGUI.php.

References $DIC, ILIAS\Repository\ctrl(), ilFileUtils\delDir(), ilObjectGUI\deleteUploadedImportFile(), ilFileUtils\ilTempnam(), ILIAS\Repository\lng(), ilFileUtils\makeDir(), null, ilObjectGUI\putObjectInTree(), ilFileUtils\rename(), and ilFileUtils\renameExecutables().

464  : void
465  {
467  global $DIC;
468  $ilLog = $DIC['log'];
469 
470  $lm_temp_dir = ilFileUtils::ilTempnam();
471  ilFileUtils::makeDir($lm_temp_dir);
472  $zar = new ZipArchive();
473  $zar->open($file_to_import);
474  $zar->extractTo($lm_temp_dir);
475  $zar->close();
476  ilFileUtils::renameExecutables($lm_temp_dir);
477  $importer = new ilScormAiccImporter();
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();
481 
482  if ($import_result->isOK()) {
483  $properties = $import_result->value();
484  if (($subType = $properties['SubType']) === 'scorm') {
485  $new_obj = new ilObjSCORMLearningModule();
486  } else {
487  $new_obj = new ilObjSCORM2004LearningModule();
488  }
489  $name = $properties['Title'];
490  $description = $properties['Description'];
491  } else {
492  ilFileUtils::delDir($lm_temp_dir, false);
493  $this->deleteUploadedImportFile($path_to_uploaded_file_in_temp_dir);
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);
497  return;
498  }
499 
500  $new_obj->setTitle($name);
501  $new_obj->setSubType($subType);
502  $new_obj->setDescription($description);
503  $new_obj->create(true);
504  $this->putObjectInTree($new_obj);
505  $new_obj->setOfflineStatus(false);
506 
507  // create data directory, copy file to directory
508  $new_obj->createDataDirectory();
509 
510  $scorm_file = "content.zip";
511  $scorm_file_path = $import_dirname . "/" . $scorm_file;
512  $file_path = $new_obj->getDataDirectory() . "/" . $scorm_file;
513  ilFileUtils::rename($scorm_file_path, $file_path);
514  $this->archives->unzip(
515  $file_path,
516  $new_obj->getDataDirectory(),
517  false,
518  false,
519  false
520  );
521  unlink($file_path);
522  ilFileUtils::delDir($lm_temp_dir, false);
523  ilFileUtils::renameExecutables($new_obj->getDataDirectory());
524 
525  //auto set learning progress settings
526  $new_obj->setLearningProgressSettingsAtUpload();
527 
528  $importer->writeData("sahs", "5.1.0", $new_obj->getId());
529 
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);
533  }
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
static renameExecutables(string $a_dir)
deleteUploadedImportFile(string $path_to_uploaded_file_in_temp_dir)
static delDir(string $a_dir, bool $a_clean_only=false)
removes a dir and all its content (subdirs and files) recursively
global $DIC
Definition: shib_login.php:22
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.
Class ilObjSCORM2004LearningModule.
static rename(string $a_source, string $a_target)
Class ilObjSCORMLearningModule.
static makeDir(string $a_dir)
creates a new directory and inherits all filesystem permissions of the parent directory You may pass ...
+ Here is the call graph for this function:

◆ infoScreen()

ilObjSAHSLearningModuleGUI::infoScreen ( )
protected

Definition at line 181 of file class.ilObjSAHSLearningModuleGUI.php.

References ILIAS\Repository\ctrl(), and infoScreenForward().

181  : void
182  {
183  if (strtolower($this->ctrl->getCmd() ?? '') === 'infoscreen') {
184  $this->ctrl->redirectByClass(ilInfoScreenGUI::class, 'showSummary');
185  }
186 
187  $this->infoScreenForward();
188  }
+ Here is the call graph for this function:

◆ infoScreenForward()

ilObjSAHSLearningModuleGUI::infoScreenForward ( )
protected

Definition at line 190 of file class.ilObjSAHSLearningModuleGUI.php.

References $GLOBALS, ilObjectGUI\checkPermissionBool(), ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), and ILIAS\Repository\object().

Referenced by executeCommand(), and infoScreen().

190  : void
191  {
192  if (!$this->checkPermissionBool("visible") && !$this->checkPermissionBool("read")) {
193  $this->error->raiseError($this->lng->txt("msg_no_perm_read"), $this->error->MESSAGE);
194  }
195 
196  $info = new ilInfoScreenGUI($this);
197  $info->enablePrivateNotes();
198  $info->enableLearningProgress();
199 
200  // add read / back button
201  if ($this->checkPermissionBool("read")) {
202  $ilToolbar = $GLOBALS['DIC']->toolbar();
203  $ilToolbar->addButtonInstance($this->object->getViewButton());
204  }
205 
206  $info->enableNewsEditing(false);
207  if ($this->checkPermissionBool("write")) {
208  $news_set = new ilSetting("news");
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");
213  }
214  }
215  // show standard meta data section
216  $info->addMetaDataSections($this->object->getId(), 0, $this->object->getType());
217 
218  // forward the command
219  $this->ctrl->forwardCommand($info);
220  }
$GLOBALS["DIC"]
Definition: wac.php:53
checkPermissionBool(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initCreateForm()

ilObjSAHSLearningModuleGUI::initCreateForm ( string  $new_type)
protected

Definition at line 252 of file class.ilObjSAHSLearningModuleGUI.php.

References $DIC, $form, ilObjectGUI\$lng, ilFrameTargetInfo\_getFrame(), ilUploadFiles\_getUploadDirectory(), ilUploadFiles\_getUploadFiles(), ilPropertyFormGUI\addCommandButton(), ilPropertyFormGUI\addItem(), ilSubEnabledFormPropertyGUI\addSubItem(), ILIAS\Repository\lng(), ilFormGUI\setFormAction(), ilFormPropertyGUI\setInfo(), ilSelectInputGUI\setOptions(), ilFormPropertyGUI\setRequired(), ilFormGUI\setTarget(), ilPropertyFormGUI\setTitle(), ilRadioOption\setValue(), and ilLanguage\txt().

253  {
254  global $DIC;
255  $lng = $DIC->language();
256  $ilCtrl = $DIC->ctrl();
257  $form = new ilPropertyFormGUI();
258 
259  // type selection
260  $radg = new ilRadioGroupInputGUI($lng->txt("type"), "sub_type");
261  $op0 = new ilRadioOption($this->lng->txt("lm_type_scorm"), "scorm");
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");
268  $form->addItem($radg);
269 
270  $options = array();
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;
277  }
278  }
279  if (count($options) > 1) {
280  // choose upload directory
281  $radg = new ilRadioGroupInputGUI($lng->txt("cont_choose_file_source"), "file_source");
282  $op0 = new ilRadioOption($this->lng->txt("cont_choose_local"), "local");
283  $radg->addOption($op0);
284  $op1 = new ilRadioOption($this->lng->txt("cont_choose_upload_dir"), "upload_dir");
285  $radg->addOption($op1);
286  $radg->setValue("local");
287 
288  $fi = new ilFileInputGUI($this->lng->txt("select_file"), "scormfile");
289  $fi->setRequired(true);
290  $op0->addSubItem($fi);
291 
292  $si = new ilSelectInputGUI($this->lng->txt("cont_uploaded_file"), "uploaded_file");
293  $si->setOptions($options);
294  $op1->addSubItem($si);
295 
296  $form->addItem($radg);
297  } else {
298  $fi = new ilFileInputGUI($this->lng->txt("select_file"), "scormfile");
299  $fi->setRequired(true);
300  $form->addItem($fi);
301  }
302 
303  $form->addCommandButton("upload", $lng->txt("create"));
304  $form->addCommandButton("cancel", $lng->txt("cancel"));
305 
306  $form->setTitle($lng->txt("import_sahs"));
307  $form->setFormAction($ilCtrl->getFormAction($this, "upload"));
309  return $form;
310  }
This class represents an option in a radio group.
This class represents a selection list property in a property form.
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...
This class represents a file property in a property form.
setTarget(string $a_target)
static _getUploadDirectory()
setOptions(array $a_options)
ilLanguage $lng
This class represents a property in a property form.
setFormAction(string $a_formaction)
setValue(string $a_value)
global $DIC
Definition: shib_login.php:22
setRequired(bool $a_required)
addCommandButton(string $a_cmd, string $a_text, string $a_id="")
static _getFrame(string $a_class)
+ Here is the call graph for this function:

◆ properties()

ilObjSAHSLearningModuleGUI::properties ( )

module properties

Returns
void
Exceptions
ilObjectException

Definition at line 238 of file class.ilObjSAHSLearningModuleGUI.php.

References ILIAS\Repository\ctrl().

238  : void
239  {
240  $this->ctrl->setParameterByClass(
241  "ilSAHSEditGUI",
242  "ref_id",
243  $this->ref_id
244  );
245  $this->ctrl->redirectByClass(ilSAHSEditGUI::class);
246  }
+ Here is the call graph for this function:

◆ saveProperties()

ilObjSAHSLearningModuleGUI::saveProperties ( )

Definition at line 248 of file class.ilObjSAHSLearningModuleGUI.php.

248  : void
249  {
250  }

◆ setSettingsSubTabs()

ilObjSAHSLearningModuleGUI::setSettingsSubTabs ( )

List files.

Parameters

Definition at line 794 of file class.ilObjSAHSLearningModuleGUI.php.

References $DIC, ilObjectGUI\$lng, ILIAS\Repository\ctrl(), and ILIAS\Repository\object().

Referenced by executeCommand(), ilObjSCORMLearningModuleGUI\newModuleVersion(), ilObjSCORMLearningModuleGUI\properties(), and ilObjSCORM2004LearningModuleGUI\properties().

794  : void
795  {
796  global $DIC;
797  $lng = $DIC->language();
798  $ilTabs = $DIC->tabs();
799  $ilCtrl = $DIC->ctrl();
800 
801  $ilTabs->addSubTabTarget(
802  "general",
803  $this->ctrl->getLinkTarget($this, "properties"),
804  array("edit", ""),
805  get_class($this)
806  );
807 
808  $ilTabs->addSubTabTarget(
809  "cont_sc_new_version",
810  $this->ctrl->getLinkTarget($this, "newModuleVersion"),
811  array("edit", ""),
812  get_class($this)
813  );
814 
815  $validator = new ilCertificateActiveValidator();
816  if (true === $validator->validate()) {
817  // // create and insert object in objecttree
818  // $ilTabs->addSubTabTarget("certificate",
819  // $this->ctrl->getLinkTarget($this, "certificate"),
820  // array("certificate", "certificateEditor", "certificateRemoveBackground", "certificateSave",
821  // "certificatePreview", "certificateDelete", "certificateUpload", "certificateImport")
822  // );
823  $ilTabs->addSubTabTarget(
824  "certificate",
825  $this->ctrl->getLinkTargetByClass([static::class, "ilcertificategui"], "certificateeditor"),
826  "",
827  "ilcertificategui"
828  );
829  }
830 
831  $lti_settings = new ilLTIProviderObjectSettingGUI($this->object->getRefId());
832  if ($lti_settings->hasSettingsAccess()) {
833  $ilTabs->addSubTabTarget(
834  'lti_provider',
835  $this->ctrl->getLinkTargetByClass(ilLTIProviderObjectSettingGUI::class)
836  );
837  }
838 
839  $ilTabs->setTabActive('settings');
840  }
ilLanguage $lng
GUI class for LTI provider object settings.
global $DIC
Definition: shib_login.php:22
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setTabs()

ilObjSAHSLearningModuleGUI::setTabs ( )
protected
Exceptions
ilCtrlException

Definition at line 550 of file class.ilObjSAHSLearningModuleGUI.php.

References $DIC, $refId, ilUtil\getImagePath(), getTabs(), ILIAS\Repository\lng(), and ILIAS\Repository\object().

Referenced by executeCommand().

550  : void
551  {
552  global $DIC;
553  $baseClass = $refId = $DIC->http()->wrapper()->query()->retrieve('baseClass', $DIC->refinery()->kindlyTo()->string());
554  $this->tpl->setTitleIcon(ilUtil::getImagePath("standard/icon_lm.svg"));
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"))
562  ));
563  }
564  if (strtolower($baseClass) === "ilsahseditgui" || strtolower($baseClass) === "ilrepositorygui") {
565  $this->getTabs();
566  }
567  }
$refId
Definition: xapitoken.php:58
global $DIC
Definition: shib_login.php:22
static getImagePath(string $image_name, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ upload()

ilObjSAHSLearningModuleGUI::upload ( )
Exceptions
ilDatabaseException
ilException
ilFileUtilsException
ilObjectNotFoundException

Definition at line 459 of file class.ilObjSAHSLearningModuleGUI.php.

References uploadObject().

459  : void
460  {
461  $this->uploadObject();
462  }
uploadObject()
display status information or report errors messages in case of error
+ Here is the call graph for this function:

◆ uploadObject()

ilObjSAHSLearningModuleGUI::uploadObject ( )

display status information or report errors messages in case of error

Exceptions
ilDatabaseException
ilException
ilFileUtilsException
ilObjectNotFoundException

Definition at line 320 of file class.ilObjSAHSLearningModuleGUI.php.

References $DIC, $ilErr, $refId, ilUploadFiles\_checkUploadFile(), ilUploadFiles\_copyUploadFile(), ilObject\_writeTitle(), ilLoggerFactory\getLogger(), ILIAS\Repository\lng(), ilFileUtils\moveUploadedFile(), ilUtil\redirect(), and ilFileUtils\renameExecutables().

Referenced by upload().

320  : void
321  {
322  global $DIC;
323  $rbacsystem = $DIC->access();
324  $ilErr = $DIC['ilErr'];
325  $ilLog = ilLoggerFactory::getLogger('sahs');
326  $refId = $DIC->http()->wrapper()->query()->retrieve('ref_id', $DIC->refinery()->kindlyTo()->int());
327  $importFromXml = false;
328 
329  // check create permission
330  if (!$rbacsystem->checkAccess("create", '', $refId, "sahs")) {
331  $ilErr->raiseError($this->lng->txt("no_create_permission"), $ilErr->WARNING);
332  } elseif ($_FILES["scormfile"]["name"]) {
333  // check if file was uploaded
334  $source = $_FILES["scormfile"]["tmp_name"];
335  if (($source === 'none') || (!$source)) {
336  $ilErr->raiseError($this->lng->txt("msg_no_file"), $ilErr->MESSAGE);
337  }
338  // get_cfg_var("upload_max_filesize"); // get the may filesize form t he php.ini
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);
343  break;
344 
345  case UPLOAD_ERR_PARTIAL:
346  $ilErr->raiseError($this->lng->txt("err_partial_file_upload"), $ilErr->MESSAGE);
347  break;
348 
349  case UPLOAD_ERR_NO_FILE:
350  $ilErr->raiseError($this->lng->txt("err_no_file_uploaded"), $ilErr->MESSAGE);
351  break;
352  }
353 
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());
357  // check if the file is in the upload directory and readable
358  if (!ilUploadFiles::_checkUploadFile($uploadedFile)) {
359  $ilErr->raiseError($this->lng->txt("upload_error_file_not_found"), $ilErr->MESSAGE);
360  }
361 
362  $file = pathinfo($uploadedFile);
363  } else {
364  $ilErr->raiseError($this->lng->txt("msg_no_file"), $ilErr->MESSAGE);
365  }
366 
367  $name = substr($file["basename"], 0, strlen($file["basename"]) - strlen($file["extension"]) - 1);
368  if ($name == "") {
369  $name = $this->lng->txt("no_title");
370  }
371 
372  $description = "";
373 
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());
377  }
378 
379  // always import authoring packages as scorm2004, see bug #27801
380  // if ($_POST["editable"] == 'y') {
381  // $subType = "scorm2004";
382  // }
383 
384  // create and insert object in objecttree
385  switch ($subType) {
386  case "scorm2004":
387  $newObj = new ilObjSCORM2004LearningModule();
388  break;
389 
390  case "scorm":
391  $newObj = new ilObjSCORMLearningModule();
392  break;
393  }
394 
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);
403 
404  // create data directory, copy file to directory
405  $newObj->createDataDirectory();
406 
407  if ($_FILES["scormfile"]["name"]) {
408  // copy uploaded file to data directory
409  $file_path = $newObj->getDataDirectory() . "/" . $_FILES["scormfile"]["name"];
411  $_FILES["scormfile"]["tmp_name"],
412  $_FILES["scormfile"]["name"],
413  $file_path
414  );
415  $this->archives->unzip(
416  $file_path,
417  $newObj->getDataDirectory(),
418  false,
419  false,
420  false
421  );
422  } else {
423  // copy uploaded file to data directory
424  $uploadedFile = $DIC->http()->wrapper()->post()->retrieve('uploaded_file', $DIC->refinery()->kindlyTo()->string());
425  $file_path = $newObj->getDataDirectory() . "/" . $uploadedFile;
426  ilUploadFiles::_copyUploadFile($uploadedFile, $file_path);
427  $this->archives->unzip(
428  $file_path,
429  $newObj->getDataDirectory(),
430  false,
431  false,
432  true
433  );
434  }
435  ilFileUtils::renameExecutables($newObj->getDataDirectory());
436 
437  $title = $newObj->readObject();
438  if ($title != "") {
439  ilObject::_writeTitle($newObj->getId(), $title);
440  }
441 
442  //auto set learning progress settings
443  $newObj->setLearningProgressSettingsAtUpload();
444 
445  if ($importFromXml) {
446  $importer->writeData("sahs", "5.1.0", $newObj->getId());
447  }
448 
449  $this->tpl->setOnScreenMessage('info', $this->lng->txt($newObj->getType() . "_added"), true);
450  ilUtil::redirect("ilias.php?baseClass=ilSAHSEditGUI&ref_id=" . $newObj->getRefId());
451  }
static _writeTitle(int $obj_id, string $title)
write title to db (static)
static getLogger(string $a_component_id)
Get component logger.
static _copyUploadFile(string $a_file, string $a_target, bool $a_raise_errors=true)
$refId
Definition: xapitoken.php:58
$ilErr
Definition: raiseError.php:33
static renameExecutables(string $a_dir)
global $DIC
Definition: shib_login.php:22
static moveUploadedFile(string $a_file, string $a_name, string $a_target, bool $a_raise_errors=true, string $a_mode="move_uploaded")
move uploaded file
static redirect(string $a_script)
Class ilObjSCORM2004LearningModule.
static _checkUploadFile(string $a_file)
Class ilObjSCORMLearningModule.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $archives

ilObjSAHSLearningModuleGUI::$archives
private

Definition at line 37 of file class.ilObjSAHSLearningModuleGUI.php.

◆ $form

ilPropertyFormGUI ilObjSAHSLearningModuleGUI::$form
private

Definition at line 36 of file class.ilObjSAHSLearningModuleGUI.php.

Referenced by initCreateForm().


The documentation for this class was generated from the following file: