ILIAS  release_7 Revision v7.30-3-g800a261c036
ilObjSAHSLearningModuleGUI Class Reference

SCORM Learning Modules. More...

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

Public Member Functions

 __construct ($a_data, $a_id, $a_call_by_reference, $a_prepare_output=true)
 Constructor. More...
 
 executeCommand ()
 execute command More...
 
 viewObject ()
 viewObject container presentation for "administration -> repository, trash, permissions" More...
 
 properties ()
 module properties More...
 
 saveProperties ()
 save properties More...
 
 initCreationForms ($a_new_type)
 no manual SCORM creation, only import at the time More...
 
 initCreationForm ()
 Init form. More...
 
 initUploadForm ()
 Init upload form. More...
 
 uploadObject ()
 display status information or report errors messages in case of error More...
 
 upload ()
 
 saveObject ()
 save new learning module to db More...
 
 info ()
 permission form More...
 
 owner ()
 show owner of learning module More...
 
 getTemplate ()
 output main header (title and locator) More...
 
 setTabs ()
 output tabs More...
 
 certificate ()
 Shows the certificate editor. More...
 
 getTabs ()
 adds tabs to tab gui object More...
 
 addLocatorItems ()
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 editContent ()
 List files. More...
 
 setSettingsSubTabs ()
 set Tabs for settings More...
 
 export ()
 
 exportModule ()
 
 getType ()
 
- Public Member Functions inherited from ilObjectGUI
 executeCommand ()
 execute command More...
 
 withReferences ()
 determines wether objects are referenced or not (got ref ids or not) More...
 
 setCreationMode ($a_mode=true)
 if true, a creation screen is displayed the current $_GET[ref_id] don't belong to the current class! the mode is determined in ilrepositorygui More...
 
 getCreationMode ()
 get creation mode More...
 
 prepareOutput ($a_show_subobjects=true)
 prepare output More...
 
 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...
 
 cancelDeleteObject ()
 cancel deletion of object More...
 
 cancelObject ()
 cancel action and go back to previous page @access public More...
 
 createObject ()
 create new object form More...
 
 cancelCreation ()
 cancel create action and go back to repository parent More...
 
 saveObject ()
 save object More...
 
 getDidacticTemplateVar ($a_type)
 Get didactic template setting from creation screen. More...
 
 putObjectInTree (ilObject $a_obj, $a_parent_node_id=null)
 Add object to tree at given position. More...
 
 editObject ()
 edit object More...
 
 addExternalEditFormCustom (ilPropertyFormGUI $a_form)
 
 updateObject ()
 updates object entry in object_data More...
 
 getFormAction ($a_cmd, $a_formaction="")
 get form action for command (command is method name without "Object", e.g. More...
 
 isVisible ($a_ref_id, $a_type)
 
 viewObject ()
 viewObject container presentation for "administration -> repository, trash, permissions" More...
 
 deleteObject ($a_error=false)
 Display deletion confirmation screen. More...
 
 cloneAllObject ()
 Clone single (not container object) Method is overwritten in ilContainerGUI. More...
 
 redirectAfterCreation ()
 Redirect after creation, see https://docu.ilias.de/goto_docu_wiki_wpage_5035_1357.html. More...
 
 addToDeskObject ()
 @inheritDoc More...
 
 removeFromDeskObject ()
 @inheritDoc More...
 
- Public Member Functions inherited from ILIAS\Object\ImplementsCreationCallback
 callCreationCallback (\ilObject $object, \ilObjectDefinition $obj_definition, int $requested_crtcb)
 

Static Public Member Functions

static _goto ($a_target)
 goto target course More...
 
- Static Public Member Functions inherited from ilObjectGUI
static _gotoRepositoryRoot ($a_raise_error=false)
 Goto repository root. More...
 
static _gotoRepositoryNode ($a_ref_id, $a_cmd="frameset")
 Goto repository root. More...
 

Additional Inherited Members

- Data Fields inherited from ilObjectGUI
const ALLOWED_TAGS_IN_TITLE_AND_DESCRIPTION
 
const COPY_WIZARD_NEEDS_PAGE = 1
 
 $objDefinition
 
 $tpl
 
 $tree
 
 $lng
 
 $data
 
 $object
 
 $ref_id
 
 $obj_id
 
 $maxcount
 
 $formaction
 
 $return_location
 
 $target_frame
 
 $tab_target_script
 
 $actions
 
 $sub_objects
 
 $omit_locator = false
 
const CFORM_NEW = 1
 
const CFORM_IMPORT = 2
 
const CFORM_CLONE = 3
 
- Protected Member Functions inherited from ilObjectGUI
 getObjectService ()
 Get object service. More...
 
 assignObject ()
 
 setTitleAndDescription ()
 called by prepare output More...
 
 initHeaderAction ($a_sub_type=null, $a_sub_id=null)
 Add header action menu. More...
 
 insertHeaderAction ($a_list_gui)
 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 @access public More...
 
 setAdminTabs ()
 set admin tabs @access public More...
 
 setLocator ()
 set Locator More...
 
 addLocatorItems ()
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 omitLocator ($a_omit=true)
 
 addAdminLocatorItems ($a_do_not_add_object=false)
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 initCreationForms ($a_new_type)
 Init creation froms. More...
 
 getCreationFormsHTML (array $a_forms)
 Get HTML for creation forms (accordion) More...
 
 initCreateForm ($a_new_type)
 Init object creation form. More...
 
 initDidacticTemplate (ilPropertyFormGUI $form)
 Show didactic template types. More...
 
 addDidacticTemplateOptions (array &$a_options)
 Add custom templates. More...
 
 afterSave (ilObject $a_new_object)
 Post (successful) object creation hook. More...
 
 initEditForm ()
 Init object edit form. More...
 
 initEditCustomForm (ilPropertyFormGUI $a_form)
 Add custom fields to update form. More...
 
 getEditFormValues ()
 Get values for edit form. More...
 
 getEditFormCustomValues (array &$a_values)
 Add values to custom edit fields. More...
 
 validateCustom (ilPropertyFormGUI $a_form)
 Validate custom values (if not possible with checkInput()) More...
 
 updateCustom (ilPropertyFormGUI $a_form)
 Insert custom update form values into object. More...
 
 afterUpdate ()
 Post (successful) object update hook. More...
 
 initImportForm ($a_new_type)
 Init object import form. More...
 
 importFileObject ($parent_id=null, $a_catch_errors=true)
 Import. More...
 
 afterImport (ilObject $a_new_object)
 Post (successful) object import hook. More...
 
 setFormAction ($a_cmd, $a_formaction)
 set specific form action for command More...
 
 getReturnLocation ($a_cmd, $a_location="")
 get return location for command (command is method name without "Object", e.g. More...
 
 setReturnLocation ($a_cmd, $a_location)
 set specific return location for command More...
 
 getTargetFrame ($a_cmd, $a_target_frame="")
 get target frame for command (command is method name without "Object", e.g. More...
 
 setTargetFrame ($a_cmd, $a_target_frame)
 set specific target frame for command More...
 
 showPossibleSubObjects ()
 show possible subobjects (pulldown menu) More...
 
 getTemplateFile ($a_cmd, $a_type="")
 get a template blockfile format: tpl. More...
 
 getTabs ()
 get tabs abstract method. More...
 
 __showButton ($a_cmd, $a_text, $a_target='')
 
 hitsperpageObject ()
 
__initTableGUI ()
 
 __setTableGUIBasicData (&$tbl, &$result_set, $a_from="")
 standard implementation for tables use 'from' variable use different initial setting of table More...
 
 redirectToRefId ($a_ref_id, $a_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 $_GET["ref_id"] value More...
 
 fillCloneTemplate ($a_tpl_varname, $a_type)
 Fill object clone template This method can be called from any object GUI class that wants to offer object cloning. More...
 
 getCenterColumnHTML ()
 Get center column. More...
 
 getRightColumnHTML ()
 Display right column. More...
 
 setColumnSettings (ilColumnGUI $column_gui)
 May be overwritten in subclasses. More...
 
 checkPermission ($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
 Check permission and redirect on error. More...
 
 checkPermissionBool ($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
 Check permission. More...
 
 enableDragDropFileUpload ()
 Enables the file upload into this object by dropping files. More...
 
 handleAutoRating (ilObject $a_new_obj)
 Activate rating automatically if parent container setting. More...
 
- Protected Attributes inherited from ilObjectGUI
const UPLOAD_TYPE_LOCAL = 1
 
const UPLOAD_TYPE_UPLOAD_DIRECTORY = 2
 
 $ilErr
 
 $locator
 
 $user
 
 $access
 
 $rbacsystem
 
 $settings
 
 $rbacreview
 
 $toolbar
 
 $tmp_import_dir
 
 $tabs_gui = null
 
 $ctrl
 
 $object_service
 
 $favourites
 
 $request
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilObjSAHSLearningModuleGUI::__construct (   $a_data,
  $a_id,
  $a_call_by_reference,
  $a_prepare_output = true 
)

Constructor.

@access public

Reimplemented in ilObjSCORM2004LearningModuleGUI, and ilObjSCORMLearningModuleGUI.

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

25 {
26 global $DIC;
27 $lng = $DIC['lng'];
28
29 $lng->loadLanguageModule("content");
30 $this->type = "sahs";
31 parent::__construct($a_data, $a_id, $a_call_by_reference, false);
32 }
global $DIC
Definition: goto.php:24
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc

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

+ Here is the call graph for this function:

Member Function Documentation

◆ _goto()

static ilObjSAHSLearningModuleGUI::_goto (   $a_target)
static

goto target course

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

780 {
781 global $DIC;
782 $ilAccess = $DIC['ilAccess'];
783 $ilErr = $DIC['ilErr'];
784 $lng = $DIC['lng'];
785
786 $parts = explode("_", $a_target);
787
788 if ($ilAccess->checkAccess("write", "", $parts[0])) {
789 $_GET["cmd"] = "";
790 $_GET["baseClass"] = "ilSAHSEditGUI";
791 $_GET["ref_id"] = $parts[0];
792 $_GET["obj_id"] = $parts[1];
793 include("ilias.php");
794 exit;
795 }
796 if ($ilAccess->checkAccess("visible", "", $parts[0]) || $ilAccess->checkAccess("read", "", $parts[0])) {
797 $_GET["cmd"] = "infoScreen";
798 $_GET["baseClass"] = "ilSAHSPresentationGUI";
799 $_GET["ref_id"] = $parts[0];
800 include("ilias.php");
801 exit;
802 } else {
803 if ($ilAccess->checkAccess("read", "", ROOT_FOLDER_ID)) {
804 ilUtil::sendInfo(sprintf(
805 $lng->txt("msg_no_perm_read_item"),
807 ), true);
809 }
810 }
811
812 $ilErr->raiseError($lng->txt("msg_no_perm_read"), $ilErr->FATAL);
813 }
$_GET["client_id"]
static _gotoRepositoryRoot($a_raise_error=false)
Goto repository root.
static _lookupObjId($a_id)
static _lookupTitle($a_id)
lookup object title
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
const ROOT_FOLDER_ID
Definition: constants.php:30
exit
Definition: login.php:29

References $_GET, $DIC, ilObjectGUI\$ilErr, ilObjectGUI\$lng, ilObjectGUI\_gotoRepositoryRoot(), ilObject\_lookupObjId(), ilObject\_lookupTitle(), exit, ROOT_FOLDER_ID, and ilUtil\sendInfo().

+ Here is the call graph for this function:

◆ addLocatorItems()

ilObjSAHSLearningModuleGUI::addLocatorItems ( )

should be overwritten to add object specific items (repository items are preloaded)

Reimplemented from ilObjectGUI.

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

816 {
817 global $DIC;
818 $ilLocator = $DIC['ilLocator'];
819
820 if (is_object($this->object)) {
821 $ilLocator->addItem(
822 $this->object->getTitle(),
823 $this->ctrl->getLinkTargetByClass("ilinfoscreengui", "showSummary"),
824 "",
825 $_GET["ref_id"]
826 );
827 }
828 }

References $_GET, and $DIC.

◆ certificate()

ilObjSAHSLearningModuleGUI::certificate ( )

Shows the certificate editor.

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

637 {
638 $guiFactory = new ilCertificateGUIFactory();
639 $output_gui = $guiFactory->create($this->object);
640
641 $output_gui->certificateEditor();
642 }

◆ editContent()

ilObjSAHSLearningModuleGUI::editContent ( )

List files.

Parameters

return

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

837 {
838 global $DIC;
839 $ilCtrl = $DIC['ilCtrl'];
840
841 if (!$this->object->getEditable()) {
842 $ilCtrl->redirectByClass("ilfilesystemgui", "listFiles");
843 } else {
844 $ilCtrl->redirectByClass("ilobjscorm2004learningmodulegui", "editOrganization");
845 }
846 }

References $DIC.

◆ executeCommand()

ilObjSAHSLearningModuleGUI::executeCommand ( )

execute command

Reimplemented from ilObjectGUI.

Reimplemented in ilObjSCORM2004LearningModuleGUI.

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

38 {
39 global $DIC;
40 $ilAccess = $DIC['ilAccess'];
41 $ilTabs = $DIC['ilTabs'];
42 $ilErr = $DIC['ilErr'];
43
44 $GLOBALS['DIC']["ilLog"]->write("bc:" . $_GET["baseClass"] . "; nc:" . $this->ctrl->getNextClass($this) . "; cmd:" . $this->ctrl->getCmd());
45 if (strtolower($_GET["baseClass"]) == "iladministrationgui" ||
46 strtolower($_GET["baseClass"]) == "ilsahspresentationgui" ||
47 $this->getCreationMode() == true) {
48 $this->prepareOutput();
49 } else {
50 $this->getTemplate();
51 $this->setLocator();
52 $this->setTabs();
53 $this->tpl->setTitleIcon(ilUtil::getImagePath("icon_lm.svg"));
54 $this->tpl->setTitle($this->object->getTitle());
55 }
56
57 $next_class = $this->ctrl->getNextClass($this);
58 $cmd = $this->ctrl->getCmd();
59
60 switch ($next_class) {
61 case 'illtiproviderobjectsettinggui':
62 $this->setSettingsSubTabs();
63 $ilTabs->setSubTabActive('lti_provider');
64 $lti_gui = new ilLTIProviderObjectSettingGUI($this->object->getRefId());
65 $lti_gui->setCustomRolesForSelection($GLOBALS['DIC']->rbac()->review()->getLocalRoles($this->object->getRefId()));
66 $lti_gui->offerLTIRolesForSelection(false);
67 $this->ctrl->forwardCommand($lti_gui);
68 break;
69
70
71 case 'ilobjectmetadatagui':
72 if (!$ilAccess->checkAccess('write', '', $this->object->getRefId())) {
73 $ilErr->raiseError($this->lng->txt('permission_denied'), $ilErr->WARNING);
74 }
75 include_once 'Services/Object/classes/class.ilObjectMetaDataGUI.php';
76 $md_gui = new ilObjectMetaDataGUI($this->object);
77 $this->ctrl->forwardCommand($md_gui);
78 break;
79
80 case 'ilexportgui':
81 case 'ilpermissiongui':
82 include_once("Services/AccessControl/classes/class.ilPermissionGUI.php");
83 $perm_gui = new ilPermissionGUI($this);
84 $ret = $this->ctrl->forwardCommand($perm_gui);
85 break;
86
87 case "ilfilesystemgui":
88 $this->fs_gui = new ilFileSystemGUI($this->object->getDataDirectory());
89 $this->fs_gui->setUseUploadDirectory(true);
90 $this->fs_gui->setTableId("sahsfs" . $this->object->getId());
91 $ret = $this->ctrl->forwardCommand($this->fs_gui);
92 break;
93
94 case "ilcertificategui":
95 $this->setSettingsSubTabs();
96 $ilTabs->setSubTabActive('certificate');
97
98 $guiFactory = new ilCertificateGUIFactory();
99 $output_gui = $guiFactory->create($this->object);
100
101 $ret = $this->ctrl->forwardCommand($output_gui);
102 break;
103
104 case "illearningprogressgui":
105 include_once './Services/Tracking/classes/class.ilLearningProgressGUI.php';
106
107 $new_gui = new ilLearningProgressGUI(ilLearningProgressGUI::LP_CONTEXT_REPOSITORY, $this->object->getRefId());
108 $this->ctrl->forwardCommand($new_gui);
109
110 break;
111
112 case "ilinfoscreengui":
113 include_once("./Services/InfoScreen/classes/class.ilInfoScreenGUI.php");
114
115 $info = new ilInfoScreenGUI($this);
116 $info->enablePrivateNotes();
117 $info->enableLearningProgress();
118
119 // add read / back button
120 if ($ilAccess->checkAccess("read", "", $_GET["ref_id"])) {
121 if (!$this->object->getEditable()) {
122 $ilToolbar = $GLOBALS['DIC']->toolbar();
123 $ilToolbar->addButtonInstance($this->object->getViewButton());
124 }
125 }
126
127 $info->enableNews();
128 if ($ilAccess->checkAccess("write", "", $_GET["ref_id"])) {
129 $info->enableNewsEditing();
130 $news_set = new ilSetting("news");
131 $enable_internal_rss = $news_set->get("enable_rss_for_internal");
132 if ($enable_internal_rss) {
133 $info->setBlockProperty("news", "settings", true);
134 }
135 }
136 // show standard meta data section
137 $info->addMetaDataSections($this->object->getId(), 0, $this->object->getType());
138
139 // forward the command
140 $this->ctrl->forwardCommand($info);
141 break;
142
143 case "ilcommonactiondispatchergui":
144 include_once("Services/Object/classes/class.ilCommonActionDispatcherGUI.php");
146 $this->ctrl->forwardCommand($gui);
147 break;
148
149 case "ilobjstylesheetgui":
150 //$this->addLocations();
151 $this->ctrl->setReturn($this, "properties");
152 $ilTabs->clearTargets();
153 $style_gui = new ilObjStyleSheetGUI("", $this->object->getStyleSheetId(), false, false);
154 $style_gui->omitLocator();
155 if ($cmd == "create" || $_GET["new_type"] == "sty") {
156 $style_gui->setCreationMode(true);
157 }
158 //$ret =& $style_gui->executeCommand();
159
160 if ($cmd == "confirmedDelete") {
161 $this->object->setStyleSheetId(0);
162 $this->object->update();
163 }
164 $ret = $this->ctrl->forwardCommand($style_gui);
165 if ($cmd == "save" || $cmd == "copyStyle" || $cmd == "importStyle") {
166 $style_id = $ret;
167 $this->object->setStyleSheetId($style_id);
168 $this->object->update();
169 $this->ctrl->redirectByClass("ilobjstylesheetgui", "edit");
170 }
171 break;
172
173
174 case 'ilobjectcopygui':
175 $this->prepareOutput();
176 include_once './Services/Object/classes/class.ilObjectCopyGUI.php';
177 $cp = new ilObjectCopyGUI($this);
178 $cp->setType('sahs');
179 $this->ctrl->forwardCommand($cp);
180 break;
181
182 default:
183 if ($this->object && !$this->object->getEditable()) {
184 $cmd = $this->ctrl->getCmd("properties");
185 } else {
186 $cmd = $this->ctrl->getCmd("frameset");
187 }
188 if ((strtolower($_GET["baseClass"]) == "iladministrationgui" ||
189 $this->getCreationMode() == true) &&
190 $cmd != "frameset") {
191 $cmd .= "Object";
192 }
193
194 // #9225
195 if ($cmd == "redrawHeaderAction") {
196 $cmd .= "Object";
197 }
198
199 $ret = $this->$cmd();
200 break;
201 }
202 }
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
Definition: PEAR.php:64
static getInstanceFromAjaxCall()
(Re-)Build instance from ajax call
File System Explorer GUI class.
Class ilInfoScreenGUI.
GUI class for LTI provider object settings.
Class ilObjUserTrackingGUI.
getTemplate()
output main header (title and locator)
Class ilObjStyleSheetGUI.
GUI class for the workflow of copying objects.
prepareOutput($a_show_subobjects=true)
prepare output
getCreationMode()
get creation mode
setLocator()
set Locator
Class ilObjectMetaDataGUI.
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
ILIAS Setting Class.
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
$ret
Definition: parser.php:6

References $_GET, $DIC, $GLOBALS, ilObjectGUI\$ilErr, $ret, ilObjectGUI\getCreationMode(), ilUtil\getImagePath(), ilCommonActionDispatcherGUI\getInstanceFromAjaxCall(), getTemplate(), ilLearningProgressBaseGUI\LP_CONTEXT_REPOSITORY, ilObjectGUI\prepareOutput(), ilObjectGUI\setLocator(), setSettingsSubTabs(), and setTabs().

+ Here is the call graph for this function:

◆ export()

ilObjSAHSLearningModuleGUI::export ( )

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

900 {
901 global $DIC;
902 $lng = $DIC['lng'];
903 $ilTabs = $DIC['ilTabs'];
904 $ilCtrl = $DIC['ilCtrl'];
905 $tpl = $DIC['tpl'];
906 $ilTabs->activateTab("export");
907 include_once("./Services/Export/classes/class.ilExportGUI.php");
908 $exp_gui = new ilExportGUI($this);
909 $ilCtrl->setCmd("");
910 $exp_gui->addFormat("xml");
911 $ret = $this->ctrl->forwardCommand($exp_gui);
912 return $ret;
913 }
Export User Interface Class.

References $DIC, ilObjectGUI\$lng, $ret, and ilObjectGUI\$tpl.

◆ exportModule()

ilObjSAHSLearningModuleGUI::exportModule ( )

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

916 {
917 global $DIC;
918 $ilDB = $DIC['ilDB'];
919
920 $moduleId = ilObject::_lookupObjectId($_GET["ref_id"]);
921 require_once "./Modules/ScormAicc/classes/class.ilScormAiccExporter.php";
922 $exporter = new ilScormAiccExporter();
923 $xml = $exporter->getXmlRepresentation("sahs", "5.1.0", $moduleId);
924 }
static _lookupObjectId($a_ref_id)
lookup object id
$xml
Definition: metadata.php:332
global $ilDB

References $_GET, $DIC, $ilDB, $xml, and ilObject\_lookupObjectId().

+ Here is the call graph for this function:

◆ getTabs()

ilObjSAHSLearningModuleGUI::getTabs ( )

adds tabs to tab gui object

Parameters
object$tabs_guiilTabsGUI object

Reimplemented from ilObjectGUI.

Reimplemented in ilObjSCORM2004LearningModuleGUI.

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

650 {
651 global $DIC;
652 $rbacsystem = $DIC['rbacsystem'];
653 $ilCtrl = $DIC['ilCtrl'];
654 $ilHelp = $DIC['ilHelp'];
655
656 if ($this->ctrl->getCmd() == "delete") {
657 return;
658 }
659
660 switch ($this->object->getSubType()) {
661 case "scorm2004":
662 $ilHelp->setScreenIdComponent("sahs13");
663 break;
664
665 case "scorm":
666 $ilHelp->setScreenIdComponent("sahs12");
667 break;
668 }
669
670 // file system gui tabs
671 // properties
672 $ilCtrl->setParameterByClass("ilfilesystemgui", "resetoffset", 1);
673 $this->tabs_gui->addTarget(
674 "cont_list_files",
675 $this->ctrl->getLinkTargetByClass("ilfilesystemgui", "listFiles"),
676 "",
677 "ilfilesystemgui"
678 );
679 $ilCtrl->setParameterByClass("ilfilesystemgui", "resetoffset", "");
680
681 // info screen
682 $force_active = ($this->ctrl->getNextClass() == "ilinfoscreengui")
683 ? true
684 : false;
685 $this->tabs_gui->addTarget(
686 "info_short",
687 $this->ctrl->getLinkTargetByClass("ilinfoscreengui", "showSummary"),
688 "",
689 "ilinfoscreengui",
690 "",
691 $force_active
692 );
693
694 // properties
695 $this->tabs_gui->addTarget(
696 "settings",
697 $this->ctrl->getLinkTarget($this, "properties"),
698 array("", "properties"),
699 get_class($this)
700 );
701
702 // learning progress and offline mode
703 include_once './Services/Tracking/classes/class.ilLearningProgressAccess.php';
704 if (ilLearningProgressAccess::checkAccess($this->object->getRefId()) || $rbacsystem->checkAccess("edit_permission", "", $this->object->getRefId())) {
705 //if scorm && offline_mode activated
706 if ($this->object->getSubType() == "scorm2004" || $this->object->getSubType() == "scorm") {
707 if ($this->object->getOfflineMode() == true) {
708 $this->tabs_gui->addTarget(
709 "offline_mode_manager",
710 $this->ctrl->getLinkTarget($this, "offlineModeManager"),
711 "offlineModeManager",
712 "ilobjscormlearningmodulegui"
713 );
714 }
715 }
716 }
717 if (ilLearningProgressAccess::checkAccess($this->object->getRefId())) {
718 $this->tabs_gui->addTarget(
719 'learning_progress',
720 $this->ctrl->getLinkTargetByClass(array('illearningprogressgui'), ''),
721 '',
722 array('illplistofobjectsgui','illplistofsettingsgui','illearningprogressgui','illplistofprogressgui')
723 );
724 }
725
726 // tracking data
727 if ($rbacsystem->checkAccess("read_learning_progress", $this->object->getRefId()) || $rbacsystem->checkAccess("edit_learning_progress", $this->object->getRefId())) {
728 if ($this->object->getSubType() == "scorm2004" || $this->object->getSubType() == "scorm") {
729 include_once('./Services/PrivacySecurity/classes/class.ilPrivacySettings.php');
731 if ($privacy->enabledSahsProtocolData()) {
732 $this->tabs_gui->addTarget(
733 "cont_tracking_data",
734 $this->ctrl->getLinkTarget($this, "showTrackingItems"),
735 "showTrackingItems",
736 get_class($this)
737 );
738 }
739 }
740 }
741
742 // edit meta
743 include_once "Services/Object/classes/class.ilObjectMetaDataGUI.php";
744 $mdgui = new ilObjectMetaDataGUI($this->object);
745 $mdtab = $mdgui->getTab();
746 if ($mdtab) {
747 $this->tabs_gui->addTarget(
748 "meta_data",
749 $mdtab,
750 "",
751 "ilmdeditorgui"
752 );
753 }
754
755 // export
756 if ($rbacsystem->checkAccess("edit_permission", "", $this->object->getRefId())) {
757 $this->tabs_gui->addTarget(
758 "export",
759 $this->ctrl->getLinkTarget($this, "export"),
760 array("", "export"),
761 get_class($this)
762 );
763 }
764
765 // perm
766 if ($rbacsystem->checkAccess('edit_permission', $this->object->getRefId())) {
767 $this->tabs_gui->addTarget(
768 "perm_settings",
769 $this->ctrl->getLinkTargetByClass(array(get_class($this),'ilpermissiongui'), "perm"),
770 array("perm","info","owner"),
771 'ilpermissiongui'
772 );
773 }
774 }
static checkAccess($a_ref_id, $a_allow_only_read=true)
check access to learning progress
static _getInstance()
Get instance of ilPrivacySettings.

References $DIC, ilObjectGUI\$rbacsystem, ilPrivacySettings\_getInstance(), and ilLearningProgressAccess\checkAccess().

Referenced by setTabs().

+ 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 612 of file class.ilObjSAHSLearningModuleGUI.php.

613 {
614 global $DIC;
615 $lng = $DIC['lng'];
616
617 $this->tpl->loadStandardTemplate();
618 }

References $DIC, and ilObjectGUI\$lng.

Referenced by ilObjSCORM2004LearningModuleGUI\executeCommand(), and executeCommand().

+ Here is the caller graph for this function:

◆ getType()

ilObjSAHSLearningModuleGUI::getType ( )

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

927 {
928 return "sahs";
929 }

◆ info()

ilObjSAHSLearningModuleGUI::info ( )

permission form

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

597 {
598 $this->infoObject();
599 }

◆ initCreationForm()

ilObjSAHSLearningModuleGUI::initCreationForm ( )

Init form.

Parameters
int$a_modeEdit Mode

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

255 {
256 global $DIC;
257 $lng = $DIC['lng'];
258 $ilCtrl = $DIC['ilCtrl'];
259
260 include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
261 $this->form = new ilPropertyFormGUI();
262
263 // title
264 $ti = new ilTextInputGUI($this->lng->txt("title"), "title");
265 $ti->setSize(min(40, ilObject::TITLE_LENGTH));
266 $ti->setMaxLength(ilObject::TITLE_LENGTH);
267 $ti->setRequired(true);
268 $this->form->addItem($ti);
269
270 // text area
271 $ta = new ilTextAreaInputGUI($this->lng->txt("description"), "desc");
272 $ta->setCols(40);
273 $ta->setRows(2);
274 $this->form->addItem($ta);
275
276
277 $this->form->addCommandButton("save", $lng->txt("sahs_add"));
278 $this->form->addCommandButton("cancel", $lng->txt("cancel"));
279
280 $this->form->setTitle($lng->txt("scorm_new"));
281 $this->form->setFormAction($ilCtrl->getFormAction($this));
282 $this->form->setTarget(ilFrameTargetInfo::_getFrame("MainContent"));
283 }
static _getFrame($a_class, $a_type='')
Get content frame name.
const TITLE_LENGTH
max length of object title
This class represents a property form user interface.
This class represents a text area property in a property form.
This class represents a text property in a property form.

References $DIC, ilObjectGUI\$lng, ilFrameTargetInfo\_getFrame(), and ilObject\TITLE_LENGTH.

Referenced by initCreationForms().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initCreationForms()

ilObjSAHSLearningModuleGUI::initCreationForms (   $a_new_type)

no manual SCORM creation, only import at the time

Reimplemented from ilObjectGUI.

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

235 {
236 $forms = array();
237
238 $this->initUploadForm();
239 $forms[self::CFORM_IMPORT] = $this->form;
240
241 $this->initCreationForm();
242 $forms[self::CFORM_NEW] = $this->form;
243
244 $forms[self::CFORM_CLONE] = $this->fillCloneTemplate(null, $a_new_type);
245
246 return $forms;
247 }
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...

References ilObjectGUI\CFORM_CLONE, ilObjectGUI\CFORM_IMPORT, ilObjectGUI\CFORM_NEW, ilObjectGUI\fillCloneTemplate(), initCreationForm(), and initUploadForm().

+ Here is the call graph for this function:

◆ initUploadForm()

ilObjSAHSLearningModuleGUI::initUploadForm ( )

Init upload form.

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

289 {
290 global $DIC;
291 $lng = $DIC['lng'];
292 $ilCtrl = $DIC['ilCtrl'];
293
294 include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
295 $this->form = new ilPropertyFormGUI();
296
297 // type selection
298 $options = array(
299 "scorm2004" => $lng->txt("lm_type_scorm2004"),
300 "scorm" => $lng->txt("lm_type_scorm"),
301 "exportFile" => $lng->txt("sahs_export_file")
302 );
303 $si = new ilSelectInputGUI($this->lng->txt("type"), "sub_type");
304 $si->setOptions($options);
305 $this->form->addItem($si);
306
307
308 // todo wysiwyg editor removement
309
310 $options = array();
311 include_once 'Services/FileSystem/classes/class.ilUploadFiles.php';
313 $options[""] = $this->lng->txt("cont_select_from_upload_dir");
315 foreach ($files as $file) {
316 $file = htmlspecialchars($file, ENT_QUOTES, "utf-8");
317 $options[$file] = $file;
318 }
319 }
320 if (count($options) > 1) {
321 // choose upload directory
322 $radg = new ilRadioGroupInputGUI($lng->txt("cont_choose_file_source"), "file_source");
323 $op0 = new ilRadioOption($this->lng->txt("cont_choose_local"), "local");
324 $radg->addOption($op0);
325 $op1 = new ilRadioOption($this->lng->txt("cont_choose_upload_dir"), "upload_dir");
326 $radg->addOption($op1);
327 $radg->setValue("local");
328
329 $fi = new ilFileInputGUI($this->lng->txt("select_file"), "scormfile");
330 $fi->setRequired(true);
331 $op0->addSubItem($fi);
332
333 $si = new ilSelectInputGUI($this->lng->txt("cont_uploaded_file"), "uploaded_file");
334 $si->setOptions($options);
335 $op1->addSubItem($si);
336
337 $this->form->addItem($radg);
338 } else {
339 $fi = new ilFileInputGUI($this->lng->txt("select_file"), "scormfile");
340 $fi->setRequired(true);
341 $this->form->addItem($fi);
342 }
343
344 // validate file
345 $cb = new ilCheckboxInputGUI($this->lng->txt("cont_validate_file"), "validate");
346 $cb->setValue("y");
347 //$cb->setChecked(true);
348 $this->form->addItem($cb);
349
350 // import for editing
351 $cb = new ilCheckboxInputGUI($this->lng->txt("sahs_authoring_mode"), "editable");
352 $cb->setValue("y");
353 $cb->setInfo($this->lng->txt("sahs_authoring_mode_info"));
354 $this->form->addItem($cb);
355
356 //
357 $radg = new ilRadioGroupInputGUI($lng->txt("sahs_sequencing"), "import_sequencing");
358 $radg->setValue(0);
359 $op1 = new ilRadioOption($lng->txt("sahs_std_sequencing"), 0, $lng->txt("sahs_std_sequencing_info"));
360 $radg->addOption($op1);
361 $op1 = new ilRadioOption($lng->txt("sahs_import_sequencing"), 1, $lng->txt("sahs_import_sequencing_info"));
362 $radg->addOption($op1);
363 $cb->addSubItem($radg);
364
365
366 $this->form->addCommandButton("upload", $lng->txt("import"));
367 $this->form->addCommandButton("cancel", $lng->txt("cancel"));
368
369 $this->form->setTitle($lng->txt("import_sahs"));
370 $this->form->setFormAction($ilCtrl->getFormAction($this, "upload"));
371 $this->form->setTarget(ilFrameTargetInfo::_getFrame("MainContent"));
372 }
This class represents a checkbox property in a property form.
This class represents a file property in a property form.
This class represents a property in a property form.
This class represents an option in a radio group.
This class represents a selection list property in a property form.
static _getUploadFiles()
Get a list of readable files in the upload directory.
static _getUploadDirectory()
Get the directory with uploaded files.

References $DIC, ilObjectGUI\$lng, $si, ilFrameTargetInfo\_getFrame(), ilUploadFiles\_getUploadDirectory(), and ilUploadFiles\_getUploadFiles().

Referenced by initCreationForms().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ owner()

ilObjSAHSLearningModuleGUI::owner ( )

show owner of learning module

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

605 {
606 $this->ownerObject();
607 }

◆ properties()

ilObjSAHSLearningModuleGUI::properties ( )

module properties

Reimplemented in ilObjSCORM2004LearningModuleGUI, and ilObjSCORMLearningModuleGUI.

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

217 {
218 }

◆ saveObject()

ilObjSAHSLearningModuleGUI::saveObject ( )

save new learning module to db

Reimplemented from ilObjectGUI.

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

568 {
569 if (trim($_POST["title"]) == "") {
570 $this->ilias->raiseError($this->lng->txt("msg_no_title"), $this->ilias->error_obj->MESSAGE);
571 }
572
573 include_once("./Modules/Scorm2004/classes/class.ilObjSCORM2004LearningModule.php");
574 $newObj = new ilObjSCORM2004LearningModule();
575 $newObj->setTitle(ilUtil::stripSlashes($_POST["title"]));
576 $newObj->setSubType("scorm2004");
577 $newObj->setEditable(true);
578 $newObj->setDescription(ilUtil::stripSlashes($_POST["desc"]));
579 $newObj->create();
580 $newObj->createReference();
581 $newObj->putInTree($_GET["ref_id"]);
582 $newObj->setPermissions($_GET["ref_id"]);
583 $newObj->createDataDirectory();
584 $newObj->createScorm2004Tree();
585 ilUtil::sendInfo($this->lng->txt($newObj->getType() . "_added"), true);
586
587 // #7375
588 $this->ctrl->setParameterByClass("ilObjSCORM2004LearningModuleGUI", "ref_id", $newObj->getRefId());
589 $this->ctrl->redirectByClass(array("ilSAHSEditGUI", "ilObjSCORM2004LearningModuleGUI"), "showOrganization");
590 }
$_POST["username"]
Class ilObjSCORM2004LearningModule.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
redirection script todo: (a better solution should control the processing via a xml file)

References $_GET, $_POST, ilUtil\sendInfo(), and ilUtil\stripSlashes().

+ Here is the call graph for this function:

◆ saveProperties()

ilObjSAHSLearningModuleGUI::saveProperties ( )

save properties

Reimplemented in ilObjSCORM2004LearningModuleGUI, and ilObjSCORMLearningModuleGUI.

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

224 {
225 }

◆ setSettingsSubTabs()

ilObjSAHSLearningModuleGUI::setSettingsSubTabs ( )

set Tabs for settings

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

852 {
853 global $DIC;
854 $lng = $DIC['lng'];
855 $ilTabs = $DIC['ilTabs'];
856 $ilCtrl = $DIC['ilCtrl'];
857
858 $ilTabs->addSubTabTarget(
859 "cont_settings",
860 $this->ctrl->getLinkTarget($this, "properties"),
861 array("edit", ""),
862 get_class($this)
863 );
864
865 $ilTabs->addSubTabTarget(
866 "cont_sc_new_version",
867 $this->ctrl->getLinkTarget($this, "newModuleVersion"),
868 array("edit", ""),
869 get_class($this)
870 );
871
872 $validator = new ilCertificateActiveValidator();
873 if (true === $validator->validate()) {
874 // // create and insert object in objecttree
875 // $ilTabs->addSubTabTarget("certificate",
876 // $this->ctrl->getLinkTarget($this, "certificate"),
877 // array("certificate", "certificateEditor", "certificateRemoveBackground", "certificateSave",
878 // "certificatePreview", "certificateDelete", "certificateUpload", "certificateImport")
879 // );
880 $ilTabs->addSubTabTarget(
881 "certificate",
882 $this->ctrl->getLinkTargetByClass("ilcertificategui", "certificateeditor"),
883 "",
884 "ilcertificategui"
885 );
886 }
887
888 $lti_settings = new ilLTIProviderObjectSettingGUI($this->object->getRefId());
889 if ($lti_settings->hasSettingsAccess()) {
890 $ilTabs->addSubTabTarget(
891 'lti_provider',
892 $this->ctrl->getLinkTargetByClass(ilLTIProviderObjectSettingGUI::class)
893 );
894 }
895
896 $ilTabs->setTabActive('settings');
897 }

References $DIC, and ilObjectGUI\$lng.

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

+ Here is the caller graph for this function:

◆ setTabs()

ilObjSAHSLearningModuleGUI::setTabs ( )

output tabs

Reimplemented from ilObjectGUI.

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

624 {
625 $this->tpl->setTitleIcon(ilUtil::getImagePath("icon_lm.svg"));
626 $this->tpl->setTitle($this->object->getTitle());
627 if (strtolower($_GET["baseClass"]) == "ilsahseditgui") {
628 $this->getTabs($this->tabs_gui);
629 }
630 //if(strtolower($_GET["baseClass"]) == "ilsahseditgui") $this->getTabs();
631 }

References $_GET, ilUtil\getImagePath(), and getTabs().

Referenced by ilObjSCORM2004LearningModuleGUI\executeCommand(), and executeCommand().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ upload()

ilObjSAHSLearningModuleGUI::upload ( )

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

558 {
559 $this->uploadObject();
560 }
uploadObject()
display status information or report errors messages in case of error

References uploadObject().

+ Here is the call graph for this function:

◆ uploadObject()

ilObjSAHSLearningModuleGUI::uploadObject ( )

display status information or report errors messages in case of error

@access public

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

381 {
382 global $DIC;
383 $rbacsystem = $DIC['rbacsystem'];
384
385 include_once 'Services/FileSystem/classes/class.ilUploadFiles.php';
386
387 // check create permission
388 if (!$rbacsystem->checkAccess("create", $_GET["ref_id"], "sahs")) {
389 $this->ilias->raiseError($this->lng->txt("no_create_permission"), $this->ilias->error_obj->WARNING);
390 } elseif ($_FILES["scormfile"]["name"]) {
391 // check if file was uploaded
392 $source = $_FILES["scormfile"]["tmp_name"];
393 if (($source == 'none') || (!$source)) {
394 $this->ilias->raiseError($this->lng->txt("msg_no_file"), $this->ilias->error_obj->MESSAGE);
395 }
396 // get_cfg_var("upload_max_filesize"); // get the may filesize form t he php.ini
397 switch ($_FILES["scormfile"]["error"]) {
398 case UPLOAD_ERR_INI_SIZE:
399 $this->ilias->raiseError($this->lng->txt("err_max_file_size_exceeds"), $this->ilias->error_obj->MESSAGE);
400 break;
401
402 case UPLOAD_ERR_FORM_SIZE:
403 $this->ilias->raiseError($this->lng->txt("err_max_file_size_exceeds"), $this->ilias->error_obj->MESSAGE);
404 break;
405
406 case UPLOAD_ERR_PARTIAL:
407 $this->ilias->raiseError($this->lng->txt("err_partial_file_upload"), $this->ilias->error_obj->MESSAGE);
408 break;
409
410 case UPLOAD_ERR_NO_FILE:
411 $this->ilias->raiseError($this->lng->txt("err_no_file_uploaded"), $this->ilias->error_obj->MESSAGE);
412 break;
413 }
414
415 $file = pathinfo($_FILES["scormfile"]["name"]);
416 } elseif ($_POST["uploaded_file"]) {
417 // check if the file is in the upload directory and readable
418 if (!ilUploadFiles::_checkUploadFile($_POST["uploaded_file"])) {
419 $this->ilias->raiseError($this->lng->txt("upload_error_file_not_found"), $this->ilias->error_obj->MESSAGE);
420 }
421
422 $file = pathinfo($_POST["uploaded_file"]);
423 } else {
424 $this->ilias->raiseError($this->lng->txt("msg_no_file"), $this->ilias->error_obj->MESSAGE);
425 }
426
427 $name = substr($file["basename"], 0, strlen($file["basename"]) - strlen($file["extension"]) - 1);
428 if ($name == "") {
429 $name = $this->lng->txt("no_title");
430 }
431
432 $description = "";
433
434 $subType = $_POST["sub_type"];
435
436 // always import authoring packages as scorm2004, see bug #27801
437 if ($_POST["editable"] == 'y') {
438 $subType = "scorm2004";
439 }
440
441 // create and insert object in objecttree
442 switch ($subType) {
443 case "scorm2004":
444 include_once("./Modules/Scorm2004/classes/class.ilObjSCORM2004LearningModule.php");
445 $newObj = new ilObjSCORM2004LearningModule();
446 $newObj->setEditable($_POST["editable"] == 'y');
447 $newObj->setImportSequencing($_POST["import_sequencing"]);
448 $newObj->setSequencingExpertMode($_POST["import_sequencing"]);
449 break;
450
451 case "scorm":
452 include_once("./Modules/ScormAicc/classes/class.ilObjSCORMLearningModule.php");
453 $newObj = new ilObjSCORMLearningModule();
454 break;
455
456 case "exportFile":
457 $sFile = $_FILES["scormfile"];
458 $fType = $sFile["type"];
459 $cFileTypes = ["application/zip", "application/x-compressed","application/x-zip-compressed"];
460 if (in_array($fType, $cFileTypes)) {
461 $tempFile = $sFile["tmp_name"];
462 $lmTempDir = ilUtil::ilTempnam();
463 ilUtil::makeDir($lmTempDir);
464 $zar = new ZipArchive();
465 $zar->open($tempFile);
466 $zar->extractTo($lmTempDir);
467 $zar->close();
468 ilUtil::renameExecutables($lmTempDir);
469 require_once "./Modules/ScormAicc/classes/class.ilScormAiccImporter.php";
470 $importer = new ilScormAiccImporter();
471// $import_dirname = $lmTempDir . '/' . substr($_FILES["scormfile"]["name"], 0, strlen($a_filename) - 4);
472 $import_dirname = $lmTempDir . '/' . substr($_FILES["scormfile"]["name"], 0, -4);
473 $importFromXml = false;
474 if ($importer->importXmlRepresentation("sahs", null, $import_dirname, "") == true) {
475 $importFromXml = true;
476 }
477 $mprops = [];
478 $mprops = $importer->moduleProperties;
479 if ($importFromXml && isset($mprops["SubType"])) {
480 $subType = $mprops["SubType"];
481 if ($subType == "scorm") {
482 include_once("./Modules/ScormAicc/classes/class.ilObjSCORMLearningModule.php");
483 $newObj = new ilObjSCORMLearningModule();
484 } else {
485 include_once("./Modules/Scorm2004/classes/class.ilObjSCORM2004LearningModule.php");
486 $newObj = new ilObjSCORM2004LearningModule();
487 // $newObj->setEditable($_POST["editable"]=='y');
488 // $newObj->setImportSequencing($_POST["import_sequencing"]);
489 // $newObj->setSequencingExpertMode($_POST["import_sequencing"]);
490 }
491 $name = $mprops['Title'];
492 $description = $mprops['Description'];
493 } else {
494 ilUtil::delDir($lmTempDir, false);
495 ilUtil::sendFailure($this->lng->txt("import_file_not_valid"), true);
496 return;
497 }
498 }
499 break;
500 }
501
502 $newObj->setTitle($name);
503 $newObj->setSubType($subType);
504 $newObj->setDescription($description);
505 $newObj->setOfflineStatus(true);
506 $newObj->create(true);
507 $newObj->createReference();
508 $newObj->putInTree($_GET["ref_id"]);
509 $newObj->setPermissions($_GET["ref_id"]);
510
511 // create data directory, copy file to directory
512 $newObj->createDataDirectory();
513
514 if ($_FILES["scormfile"]["name"]) {
515 if ($importFromXml) {
516 $scormFile = "content.zip";
517 $scormFilePath = $import_dirname . "/" . $scormFile;
518 $file_path = $newObj->getDataDirectory() . "/" . $scormFile;
519 ilFileUtils::rename($scormFilePath, $file_path);
520 ilUtil::unzip($file_path);
521 unlink($file_path);
522 ilUtil::delDir($lmTempDir, false);
523 } else {
524 // copy uploaded file to data directory
525 $file_path = $newObj->getDataDirectory() . "/" . $_FILES["scormfile"]["name"];
527 $_FILES["scormfile"]["tmp_name"],
528 $_FILES["scormfile"]["name"],
529 $file_path
530 );
531 ilUtil::unzip($file_path);
532 }
533 } else {
534 // copy uploaded file to data directory
535 $file_path = $newObj->getDataDirectory() . "/" . $_POST["uploaded_file"];
536 ilUploadFiles::_copyUploadFile($_POST["uploaded_file"], $file_path);
537 ilUtil::unzip($file_path);
538 }
539 ilUtil::renameExecutables($newObj->getDataDirectory());
540
541 $title = $newObj->readObject();
542 if ($title != "") {
543 ilObject::_writeTitle($newObj->getId(), $title);
544 }
545
546 //auto set learning progress settings
547 $newObj->setLearningProgressSettingsAtUpload();
548
549 if ($importFromXml) {
550 $importer->writeData("sahs", "5.1.0", $newObj->getId());
551 }
552
553 ilUtil::sendInfo($this->lng->txt($newObj->getType() . "_added"), true);
554 ilUtil::redirect("ilias.php?baseClass=ilSAHSEditGUI&ref_id=" . $newObj->getRefId());
555 }
static rename($a_source, $a_target)
Rename a file.
Class ilObjSCORMLearningModule.
static _writeTitle($a_obj_id, $a_title)
write title to db (static)
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 moveUploadedFile($a_file, $a_name, $a_target, $a_raise_errors=true, $a_mode="move_uploaded")
move uploaded file
static delDir($a_dir, $a_clean_only=false)
removes a dir and all its content (subdirs and files) recursively
static redirect($a_script)
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
static unzip(string $path_to_zip_file, bool $overwrite_existing=false, bool $unpack_flat=false)
static ilTempnam($a_temp_path=null)
Returns a unique and non existing Path for e temporary file or directory.
static makeDir($a_dir)
creates a new directory and inherits all filesystem permissions of the parent directory You may pass ...
static renameExecutables($a_dir)
Rename uploaded executables for security reasons.
if($format !==null) $name
Definition: metadata.php:230
$source
Definition: metadata.php:76

References $_GET, $_POST, $DIC, $name, ilObjectGUI\$rbacsystem, $source, ilUploadFiles\_checkUploadFile(), ilUploadFiles\_copyUploadFile(), ilObject\_writeTitle(), ilUtil\delDir(), ilUtil\ilTempnam(), ilUtil\makeDir(), ilUtil\moveUploadedFile(), ilUtil\redirect(), ilFileUtils\rename(), ilUtil\renameExecutables(), ilUtil\sendFailure(), ilUtil\sendInfo(), and ilUtil\unzip().

Referenced by upload().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ viewObject()

ilObjSAHSLearningModuleGUI::viewObject ( )

viewObject container presentation for "administration -> repository, trash, permissions"

Exceptions

ilObjectException

Reimplemented from ilObjectGUI.

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

206 {
207 if (strtolower($_GET["baseClass"]) == "iladministrationgui") {
208 parent::viewObject();
209 } else {
210 }
211 }

References $_GET.


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