ILIAS  release_8 Revision v8.24
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 ()
 
 initUploadForm ()
 
 uploadObject ()
 display status information or report errors messages in case of error More...
 
 upload ()
 
 getTemplate ()
 save new learning module to db More...
 
 certificate ()
 Shows the certificate editor. More...
 
 addLocatorItems ()
 
 setSettingsSubTabs ()
 
 export ()
 
 exportModule ()
 
 getType ()
 
- Public Member Functions inherited from ilObjectGUI
 __construct ($data, int $id=0, bool $call_by_reference=true, bool $prepare_output=true)
 
 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] don't belong to the current 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...
 
 cancelDeleteObject ()
 cancel deletion of object More...
 
 cancelObject ()
 cancel action and go back to previous page More...
 
 createObject ()
 create new object form More...
 
 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)
 
 redirectAfterCreation ()
 Redirect after creation, see https://docu.ilias.de/goto_docu_wiki_wpage_5035_1357.html Should be overwritten and redirect to settings screen. More...
 
 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 ()
 
 initCreationForms (string $a_new_type)
 no manual SCORM creation, only import at the time More...
 
 setTabs ()
 
 getTabs ()
 adds tabs to tab gui object More...
 
- Protected Member Functions inherited from ilObjectGUI
 getObjectService ()
 
 assignObject ()
 
 setTitleAndDescription ()
 
 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...
 
 initCreationForms (string $new_type)
 Init creation forms. More...
 
 getCreationFormsHTML (array $forms)
 Get HTML for creation forms (accordion) More...
 
 initCreateForm (string $new_type)
 
 initDidacticTemplate (ilPropertyFormGUI $form)
 
 addDidacticTemplateOptions (array &$a_options)
 Add custom templates. More...
 
 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...
 
 initImportForm (string $new_type)
 
 importFileObject (int $parent_id=null)
 
 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 ()
 @abstract 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...
 
 fillCloneTemplate (?string $tpl_name, string $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...
 
 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...
 
 showCustomIconsEditing ( $input_colspan=1, ilPropertyFormGUI $form=null, $as_section=true)
 show edit section of custom icons for container More...
 

Private Attributes

ilPropertyFormGUI $form
 

Additional Inherited Members

- Data Fields inherited from ilObjectGUI
const ALLOWED_TAGS_IN_TITLE_AND_DESCRIPTION
 
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
 
- 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
 
Factory $refinery
 
ilFavouritesManager $favourites
 
ilObjectCustomIconFactory $custom_icon_factory
 
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.

Reimplemented from ilObjectGUI.

Reimplemented in ilObjSCORMLearningModuleGUI.

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

40 {
41 global $DIC;
42 $lng = $DIC->language();
43 $rbacsystem = $DIC->access();
44 $lng->loadLanguageModule("content");
45 $this->type = "sahs";
47 }
loadLanguageModule(string $a_module)
Load language module.
ilLanguage $lng
global $DIC
Definition: feed.php:28
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc

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

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

747 : void
748 {
749 global $DIC;
750 $main_tpl = $DIC->ui()->mainTemplate();
751 $ilAccess = $DIC->access();
752 $ilErr = $DIC['ilErr'];
753 $lng = $DIC->language();
754
755 $targetParameters = explode('_', $a_target);
756 $id = (int) $targetParameters[0];
757
758 if ($id <= 0) {
759 $ilErr->raiseError($lng->txt('msg_no_perm_read'), $ilErr->FATAL);
760 }
761
762 if ($ilAccess->checkAccess("write", "", $id)) {
763 $DIC->ctrl()->setParameterByClass("ilSAHSEditGUI", "ref_id", (string) $id);
764 $DIC->ctrl()->redirectByClass("ilSAHSEditGUI", "infoScreen"); //cmd was "" in 7
765 }
766
767 if ($ilAccess->checkAccess("visible", "", $id) || $ilAccess->checkAccess("read", "", $id)) {
768 $DIC->ctrl()->setParameterByClass("ilSAHSPresentationGUI", "ref_id", (string) $id);
769 $DIC->ctrl()->redirectByClass("ilSAHSPresentationGUI", "infoScreen");
770 } else {
771 if ($ilAccess->checkAccess("read", "", ROOT_FOLDER_ID)) {
772 $main_tpl->setOnScreenMessage('info', sprintf(
773 $lng->txt("msg_no_perm_read_item"),
775 ), true);
777 }
778 }
779
780 $ilErr->raiseError($lng->txt("msg_no_perm_read"), $ilErr->FATAL);
781 }
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...
static _gotoRepositoryRoot(bool $raise_error=false)
Goto repository root.
static _lookupObjId(int $ref_id)
static _lookupTitle(int $obj_id)
const ROOT_FOLDER_ID
Definition: constants.php:32
$ilErr
Definition: raiseError.php:17

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

+ Here is the call graph for this function:

◆ addLocatorItems()

ilObjSAHSLearningModuleGUI::addLocatorItems ( )
Exceptions
ilCtrlException

Reimplemented from ilObjectGUI.

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

786 : void
787 {
788 global $DIC;
789 $ilLocator = $DIC['ilLocator'];
790
791 if (is_object($this->object)) {
792 $ilLocator->addItem(
793 $this->object->getTitle(),
794 $this->ctrl->getLinkTargetByClass("ilinfoscreengui", "showSummary"),
795 "",
796 $DIC->http()->wrapper()->query()->retrieve('ref_id', $DIC->refinery()->kindlyTo()->int())
797 );
798 }
799 }

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

+ Here is the call graph for this function:

◆ certificate()

ilObjSAHSLearningModuleGUI::certificate ( )

Shows the certificate editor.

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

600 : void
601 {
602 $guiFactory = new ilCertificateGUIFactory();
603 $output_gui = $guiFactory->create($this->object);
604
605 $output_gui->certificateEditor();
606 }

◆ executeCommand()

ilObjSAHSLearningModuleGUI::executeCommand ( )

execute command

Exceptions
ilCtrlException
ilException

Reimplemented from ilObjectGUI.

Reimplemented in ilObjSCORM2004LearningModuleGUI.

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

54 : void
55 {
56 global $DIC;
57 $ilAccess = $DIC->access();
58 $ilTabs = $DIC->tabs();
59 $ilErr = $DIC['ilErr'];
60 $navigationHistory = $DIC['ilNavigationHistory'];
61
62 $baseClass = $refId = $DIC->http()->wrapper()->query()->retrieve('baseClass', $DIC->refinery()->kindlyTo()->string());
63 $ilLog = ilLoggerFactory::getLogger('sahs');
64 $ilLog->debug("bc:" . $baseClass . "; nc:" . $this->ctrl->getNextClass($this) . "; cmd:" . $this->ctrl->getCmd());
65 if (strtolower($baseClass) === "iladministrationgui" ||
66 strtolower($baseClass) === "ilsahspresentationgui" ||
67 $this->getCreationMode() == true) {
68 $this->prepareOutput();
69 } else {
70 $this->getTemplate();
71 $this->setLocator();
72 $this->setTabs();
73 $this->tpl->setTitleIcon(ilUtil::getImagePath("icon_lm.svg"));
74 $this->tpl->setTitle($this->object->getTitle());
75 $navigationHistory->addItem(
76 $this->object->getRefId(),
77 ilLink::_getLink($this->object->getRefId(), $this->object->getType()),
78 $this->object->getType()
79 );
80 }
81
82 $next_class = $this->ctrl->getNextClass($this);
83 $cmd = $this->ctrl->getCmd();
84
85 switch ($next_class) {
86 case 'illtiproviderobjectsettinggui':
87 $this->setSettingsSubTabs();
88 $ilTabs->setSubTabActive('lti_provider');
89 $lti_gui = new ilLTIProviderObjectSettingGUI($this->object->getRefId());
90 $lti_gui->setCustomRolesForSelection($GLOBALS['DIC']->rbac()->review()->getLocalRoles($this->object->getRefId()));
91 $lti_gui->offerLTIRolesForSelection(false);
92 $this->ctrl->forwardCommand($lti_gui);
93 break;
94
95
96 case 'ilobjectmetadatagui':
97 if (!$ilAccess->checkAccess('write', '', $this->object->getRefId())) {
98 $ilErr->raiseError($this->lng->txt('permission_denied'), $ilErr->WARNING);
99 }
100 $md_gui = new ilObjectMetaDataGUI($this->object);
101 $this->ctrl->forwardCommand($md_gui);
102 break;
103
104 // case 'ilexportgui':
105 // $exp = new ilExportGUI($this);
106 // $exp->addFormat('xml');
107 // $this->ctrl->forwardCommand($exp);
108 // break;
109
110 case 'ilpermissiongui':
111 $perm_gui = new ilPermissionGUI($this);
112 $this->ctrl->forwardCommand($perm_gui);
113 break;
114
115 case "ilfilesystemgui":
116 $fs_gui = new ilFileSystemGUI($this->object->getDataDirectory());
117 $fs_gui->setUseUploadDirectory(true);
118 $fs_gui->setTableId("sahsfs" . $this->object->getId());
119 $this->ctrl->forwardCommand($fs_gui);
120 break;
121
122 case "ilcertificategui":
123 $this->setSettingsSubTabs();
124 $ilTabs->setSubTabActive('certificate');
125
126 $guiFactory = new ilCertificateGUIFactory();
127 $output_gui = $guiFactory->create($this->object);
128
129 $this->ctrl->forwardCommand($output_gui);
130 break;
131
132 case "illearningprogressgui":
134 $this->ctrl->forwardCommand($new_gui);
135
136 break;
137
138 case "ilinfoscreengui":
139 $ilTabs->setTabActive('info_short');
140 $this->infoScreenForward();
141 break;
142
143 case "ilcommonactiondispatchergui":
145 if ($gui !== null) {
146 $this->ctrl->forwardCommand($gui);
147 }
148 break;
149
150 case 'ilobjectcopygui':
151 $this->prepareOutput();
152 $cp = new ilObjectCopyGUI($this);
153 $cp->setType('sahs');
154 $this->ctrl->forwardCommand($cp);
155 break;
156
157 default:
158 // if ($this->object && !$this->object->getEditable()) {
159 $cmd = $this->ctrl->getCmd("properties");
160 // }
161 if ((strtolower($baseClass) === "iladministrationgui" ||
162 $this->getCreationMode() == true) &&
163 $cmd !== "frameset") {
164 $cmd .= "Object";
165 }
166
167 // #9225
168 if ($cmd === "redrawHeaderAction") {
169 $cmd .= "Object";
170 }
171
172 $this->$cmd();
173 break;
174 }
175 }
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.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getLogger(string $a_component_id)
Get component logger.
getTemplate()
save new learning module to db
GUI class for the workflow of copying objects.
prepareOutput(bool $show_sub_objects=true)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
static getImagePath(string $img, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
$refId
Definition: xapitoken.php:58

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

+ Here is the call graph for this function:

◆ export()

ilObjSAHSLearningModuleGUI::export ( )
Returns
mixed
Exceptions
ilCtrlException

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

875 {
876 $GLOBALS['DIC']->tabs()->setTabActive('export');
877 $exp_gui = new ilExportGUI($this);
878 $this->ctrl->setCmd("listExportFiles");
879 $exp_gui->addFormat("xml");
880 return $this->ctrl->forwardCommand($exp_gui);
881 }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

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

+ Here is the call graph for this function:

◆ exportModule()

ilObjSAHSLearningModuleGUI::exportModule ( )

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

883 : void
884 {
885 global $DIC;
886 // $ilDB = $DIC->database();
887 //
888 $moduleId = ilObject::_lookupObjectId($DIC->http()->wrapper()->query()->retrieve('ref_id', $DIC->refinery()->kindlyTo()->int()));
889 $exporter = new ilScormAiccExporter();
890 // $xml = $exporter->getXmlRepresentation("sahs", "5.1.0", $moduleId);
891 }
static _lookupObjectId(int $ref_id)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

References $DIC, and ilObject\_lookupObjectId().

+ Here is the call graph for this function:

◆ getTabs()

ilObjSAHSLearningModuleGUI::getTabs ( )
protected

adds tabs to tab gui object

Exceptions
ilCtrlException

Reimplemented from ilObjectGUI.

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

612 : void
613 {
614 global $DIC;
615 $rbacsystem = $DIC->access();
616 $ilCtrl = $DIC->ctrl();
617 $ilHelp = $DIC->help();
618
619 if ($this->ctrl->getCmd() === "delete") {
620 return;
621 }
622
623 switch ($this->object->getSubType()) {
624 case "scorm2004":
625 $ilHelp->setScreenIdComponent("sahs13");
626 break;
627
628 case "scorm":
629 $ilHelp->setScreenIdComponent("sahs12");
630 break;
631 }
632
633 // file system gui tabs
634 // properties
635 if ($rbacsystem->checkAccess("write", "", $this->object->getRefId())) {
636 $ilCtrl->setParameterByClass("ilfilesystemgui", "resetoffset", 1);
637 $this->tabs_gui->addTarget(
638 "cont_list_files",
639 $this->ctrl->getLinkTargetByClass("ilfilesystemgui", "listFiles"),
640 "",
641 "ilfilesystemgui"
642 );
643 $ilCtrl->setParameterByClass("ilfilesystemgui", "resetoffset", "");
644 }
645 // info screen
646 $force_active = ($this->ctrl->getNextClass() === "ilinfoscreengui")
647 ? true
648 : false;
649 $this->tabs_gui->addTarget(
650 "info_short",
651 $this->ctrl->getLinkTargetByClass("ilinfoscreengui", "showSummary"),
652 "",
653 "ilinfoscreengui",
654 "",
655 $force_active
656 );
657
658 // properties
659 $this->tabs_gui->addTarget(
660 "settings",
661 $this->ctrl->getLinkTarget($this, "properties"),
662 array("", "properties"),
663 get_class($this)
664 );
665
666 // if (ilLearningProgressAccess::checkAccess($this->object->getRefId())) {
667 // $this->tabs_gui->addTarget(
668 // 'learning_progress',
669 // $this->ctrl->getLinkTargetByClass(array('illearningprogressgui'), ''),
670 // '',
671 // array('illplistofobjectsgui','illplistofsettingsgui','illearningprogressgui','illplistofprogressgui')
672 // );
673 // }
674
675 // tracking data
676 if ($rbacsystem->checkAccess("read_learning_progress", "", $this->object->getRefId()) || $rbacsystem->checkAccess("edit_learning_progress", "", $this->object->getRefId())) {
677 $ar_rights = [];
678 if ($rbacsystem->checkAccess("read_learning_progress", "", $this->object->getRefId())) {
679 $ar_rights = ['illplistofobjectsgui'];
680 }
681 if ($rbacsystem->checkAccess("edit_learning_progress", "", $this->object->getRefId())) {
682 $ar_rights[] = 'illplistofsettingsgui';
683 }
684 if (ilLearningProgressAccess::checkAccess($this->object->getRefId())) {
685 $this->tabs_gui->addTarget(
686 'learning_progress',
687 $this->ctrl->getLinkTargetByClass(array('illearningprogressgui'), ''),
688 '',
689 $ar_rights
690 );
691 }
692
693 if ($this->object->getSubType() === "scorm2004" || $this->object->getSubType() === "scorm") {
695 if ($privacy->enabledSahsProtocolData()) {
696 $scormClass = "ilobjscormlearningmodulegui";
697 if ($this->object->getSubType() === "scorm2004") {
698 $scormClass = "ilobjscorm2004learningmodulegui";
699 }
700 $this->ctrl->setParameterByClass($scormClass, "ref_id", $this->object->getRefId());
701 $this->tabs_gui->addTarget(
702 "cont_tracking_data",
703 $this->ctrl->getLinkTargetByClass(['ilsahseditgui',$scormClass], "showTrackingItems"),
704 "showTrackingItems"
705 );
706 }
707 }
708 }
709
710 if ($rbacsystem->checkAccess("write", "", $this->object->getRefId())) {
711 $mdgui = new ilObjectMetaDataGUI($this->object);
712 $mdtab = $mdgui->getTab();
713 if ($mdtab) {
714 $this->tabs_gui->addTarget(
715 "meta_data",
716 $mdtab,
717 "",
718 "ilmdeditorgui"
719 );
720 }
721 }
722 // export - Jour Fixe Date for Decission not to allow for Users with Right Wirite?
723 if ($rbacsystem->checkAccess("edit", "", $this->object->getRefId())) {
724 $this->tabs_gui->addTarget(
725 "export",
726 $this->ctrl->getLinkTarget($this, "export"),
727 array("", "export"),
728 get_class($this)
729 );
730 }
731
732 // perm
733 if ($rbacsystem->checkAccess('edit_permission', "", $this->object->getRefId())) {
734 $this->tabs_gui->addTarget(
735 "perm_settings",
736 $this->ctrl->getLinkTargetByClass(array(get_class($this),'ilpermissiongui'), "perm"),
737 array("perm","info","owner"),
738 'ilpermissiongui'
739 );
740 }
741 }
static checkAccess(int $a_ref_id, bool $a_allow_only_read=true)
check access to learning progress

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

Referenced by setTabs().

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

◆ getTemplate()

ilObjSAHSLearningModuleGUI::getTemplate ( )

save new learning module to db

output main header (title and locator)

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

567 : void
568 {
569 global $DIC;
570 $lng = $DIC->language();
571
572 $this->tpl->loadStandardTemplate();
573 }

References $DIC, and ilObjectGUI\$lng.

Referenced by executeCommand().

+ Here is the caller graph for this function:

◆ getType()

ilObjSAHSLearningModuleGUI::getType ( )

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

893 : string
894 {
895 return "sahs";
896 }

◆ infoScreen()

ilObjSAHSLearningModuleGUI::infoScreen ( )
protected

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

177 : void
178 {
179 $this->ctrl->setCmd("showSummary");
180 $this->ctrl->setCmdClass("ilinfoscreengui");
181 $this->infoScreenForward();
182 }

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

+ Here is the call graph for this function:

◆ infoScreenForward()

ilObjSAHSLearningModuleGUI::infoScreenForward ( )
protected

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

184 : void
185 {
186 if (!$this->checkPermissionBool("visible") && !$this->checkPermissionBool("read")) {
187 $this->error->raiseError($this->lng->txt("msg_no_perm_read"));
188 }
189
190 $info = new ilInfoScreenGUI($this);
191 $info->enablePrivateNotes();
192 $info->enableLearningProgress();
193
194 // add read / back button
195 if ($this->checkPermissionBool("read")) {
196 $ilToolbar = $GLOBALS['DIC']->toolbar();
197 $ilToolbar->addButtonInstance($this->object->getViewButton());
198 }
199
200 $info->enableNewsEditing(false);
201 if ($this->checkPermissionBool("write")) {
202 $news_set = new ilSetting("news");
203 $enable_internal_rss = $news_set->get("enable_rss_for_internal");
204 if ($enable_internal_rss) {
205 $info->setBlockProperty("news", "settings", "");
206 $info->setBlockProperty("news", "public_notifications_option", "true");
207 }
208 }
209 // show standard meta data section
210 $info->addMetaDataSections($this->object->getId(), 0, $this->object->getType());
211
212 // forward the command
213 $this->ctrl->forwardCommand($info);
214 }
error(string $a_errmsg)
Class ilInfoScreenGUI.
checkPermissionBool(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...

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

Referenced by executeCommand(), and infoScreen().

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

◆ initCreationForms()

ilObjSAHSLearningModuleGUI::initCreationForms ( string  $a_new_type)
protected

no manual SCORM creation, only import at the time

Returns
array|ilPropertyFormGUI[]
Exceptions
ilCtrlException

Reimplemented from ilObjectGUI.

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

255 : array
256 {
257 $forms = [];
258
259 $this->initUploadForm();
261
262 $forms[self::CFORM_CLONE] = $this->fillCloneTemplate(null, $a_new_type);
263
264 return $forms;
265 }
fillCloneTemplate(?string $tpl_name, string $type)
Fill object clone template This method can be called from any object GUI class that wants to offer ob...

References $form, ilObjectGUI\CFORM_CLONE, ilObjectGUI\CFORM_IMPORT, ilObjectGUI\fillCloneTemplate(), and initUploadForm().

+ Here is the call graph for this function:

◆ initUploadForm()

ilObjSAHSLearningModuleGUI::initUploadForm ( )
Exceptions
ilCtrlException

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

270 : void
271 {
272 global $DIC;
273 $lng = $DIC->language();
274 $ilCtrl = $DIC->ctrl();
275 $this->form = new ilPropertyFormGUI();
276
277 // type selection
278 $options = array(
279 "scorm2004" => $lng->txt("lm_type_scorm2004"),
280 "scorm" => $lng->txt("lm_type_scorm"),
281 "exportFile" => $lng->txt("sahs_export_file")
282 );
283 $si = new ilSelectInputGUI($this->lng->txt("type"), "sub_type");
284 $si->setOptions($options);
285 $this->form->addItem($si);
286
287 $options = array();
289 $options[""] = $this->lng->txt("cont_select_from_upload_dir");
291 foreach ($files as $file) {
292 $file = htmlspecialchars($file, ENT_QUOTES, "utf-8");
293 $options[$file] = $file;
294 }
295 }
296 if (count($options) > 1) {
297 // choose upload directory
298 $radg = new ilRadioGroupInputGUI($lng->txt("cont_choose_file_source"), "file_source");
299 $op0 = new ilRadioOption($this->lng->txt("cont_choose_local"), "local");
300 $radg->addOption($op0);
301 $op1 = new ilRadioOption($this->lng->txt("cont_choose_upload_dir"), "upload_dir");
302 $radg->addOption($op1);
303 $radg->setValue("local");
304
305 $fi = new ilFileInputGUI($this->lng->txt("select_file"), "scormfile");
306 $fi->setRequired(true);
307 $op0->addSubItem($fi);
308
309 $si = new ilSelectInputGUI($this->lng->txt("cont_uploaded_file"), "uploaded_file");
310 $si->setOptions($options);
311 $op1->addSubItem($si);
312
313 $this->form->addItem($radg);
314 } else {
315 $fi = new ilFileInputGUI($this->lng->txt("select_file"), "scormfile");
316 $fi->setRequired(true);
317 $this->form->addItem($fi);
318 }
319
320 $this->form->addCommandButton("upload", $lng->txt("import"));
321 $this->form->addCommandButton("cancel", $lng->txt("cancel"));
322
323 $this->form->setTitle($lng->txt("import_sahs"));
324 $this->form->setFormAction($ilCtrl->getFormAction($this, "upload"));
325 $this->form->setTarget(ilFrameTargetInfo::_getFrame("MainContent"));
326 }
This class represents a file property in a property form.
static _getFrame(string $a_class)
This class represents a property form user interface.
This class represents a property in a property form.
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This class represents a selection list property in a property form.
static _getUploadDirectory()
form( $class_path, string $cmd)

References $DIC, ilObjectGUI\$lng, ilFrameTargetInfo\_getFrame(), ilUploadFiles\_getUploadDirectory(), ilUploadFiles\_getUploadFiles(), ILIAS\Repository\form(), ILIAS\Repository\lng(), and ilLanguage\txt().

Referenced by initCreationForms().

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

◆ properties()

ilObjSAHSLearningModuleGUI::properties ( )

module properties

Reimplemented in ilObjSCORM2004LearningModuleGUI, and ilObjSCORMLearningModuleGUI.

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

232 : void
233 {
234 $this->ctrl->setParameterByClass(
235 "ilSAHSEditGUI",
236 "ref_id",
237 $this->ref_id
238 );
239 $this->ctrl->redirectByClass(ilSAHSEditGUI::class);
240 }

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ saveProperties()

ilObjSAHSLearningModuleGUI::saveProperties ( )

Reimplemented in ilObjSCORM2004LearningModuleGUI, and ilObjSCORMLearningModuleGUI.

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

242 : void
243 {
244 }

◆ setSettingsSubTabs()

ilObjSAHSLearningModuleGUI::setSettingsSubTabs ( )
Exceptions
ilCtrlException

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

822 : void
823 {
824 global $DIC;
825 $lng = $DIC->language();
826 $ilTabs = $DIC->tabs();
827 $ilCtrl = $DIC->ctrl();
828
829 $ilTabs->addSubTabTarget(
830 "cont_settings",
831 $this->ctrl->getLinkTarget($this, "properties"),
832 array("edit", ""),
833 get_class($this)
834 );
835
836 $ilTabs->addSubTabTarget(
837 "cont_sc_new_version",
838 $this->ctrl->getLinkTarget($this, "newModuleVersion"),
839 array("edit", ""),
840 get_class($this)
841 );
842
843 $validator = new ilCertificateActiveValidator();
844 if (true === $validator->validate()) {
845 // // create and insert object in objecttree
846 // $ilTabs->addSubTabTarget("certificate",
847 // $this->ctrl->getLinkTarget($this, "certificate"),
848 // array("certificate", "certificateEditor", "certificateRemoveBackground", "certificateSave",
849 // "certificatePreview", "certificateDelete", "certificateUpload", "certificateImport")
850 // );
851 $ilTabs->addSubTabTarget(
852 "certificate",
853 $this->ctrl->getLinkTargetByClass([static::class, "ilcertificategui"], "certificateeditor"),
854 "",
855 "ilcertificategui"
856 );
857 }
858
859 $lti_settings = new ilLTIProviderObjectSettingGUI($this->object->getRefId());
860 if ($lti_settings->hasSettingsAccess()) {
861 $ilTabs->addSubTabTarget(
862 'lti_provider',
863 $this->ctrl->getLinkTargetByClass(ilLTIProviderObjectSettingGUI::class)
864 );
865 }
866
867 $ilTabs->setTabActive('settings');
868 }

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

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

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

◆ setTabs()

ilObjSAHSLearningModuleGUI::setTabs ( )
protected
Exceptions
ilCtrlException

Reimplemented from ilObjectGUI.

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

578 : void
579 {
580 global $DIC;
581 $baseClass = $refId = $DIC->http()->wrapper()->query()->retrieve('baseClass', $DIC->refinery()->kindlyTo()->string());
582 $this->tpl->setTitleIcon(ilUtil::getImagePath("icon_lm.svg"));
583 $this->tpl->setTitle($this->object->getTitle());
584 $this->tpl->setDescription($this->object->getDescription());
585 if ($this->object && $this->object->getOfflineStatus()) {
586 $this->tpl->setAlertProperties(array(
587 array("alert" => true,
588 "property" => $this->lng->txt("status"),
589 "value" => $this->lng->txt("offline"))
590 ));
591 }
592 if (strtolower($baseClass) === "ilsahseditgui" || strtolower($baseClass) === "ilrepositorygui") {
593 $this->getTabs();
594 }
595 }

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

Referenced by executeCommand().

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

511 : void
512 {
513 $this->uploadObject();
514 }
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

Exceptions
ilDatabaseException
ilException
ilFileUtilsException
ilObjectNotFoundException

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

336 : void
337 {
338 global $DIC;
339 $rbacsystem = $DIC->access();
340 $ilErr = $DIC['ilErr'];
341 $ilLog = ilLoggerFactory::getLogger('sahs');
342 $refId = $DIC->http()->wrapper()->query()->retrieve('ref_id', $DIC->refinery()->kindlyTo()->int());
343 $importFromXml = false;
344
345 // check create permission
346 if (!$rbacsystem->checkAccess("create", '', $refId, "sahs")) {
347 $ilErr->raiseError($this->lng->txt("no_create_permission"), $ilErr->WARNING);
348 } elseif ($_FILES["scormfile"]["name"]) {
349 // check if file was uploaded
350 $source = $_FILES["scormfile"]["tmp_name"];
351 if (($source === 'none') || (!$source)) {
352 $ilErr->raiseError($this->lng->txt("msg_no_file"), $ilErr->MESSAGE);
353 }
354 // get_cfg_var("upload_max_filesize"); // get the may filesize form t he php.ini
355 switch ($_FILES["scormfile"]["error"]) {
356 case UPLOAD_ERR_INI_SIZE:
357 case UPLOAD_ERR_FORM_SIZE:
358 $ilErr->raiseError($this->lng->txt("err_max_file_size_exceeds"), $ilErr->MESSAGE);
359 break;
360
361 case UPLOAD_ERR_PARTIAL:
362 $ilErr->raiseError($this->lng->txt("err_partial_file_upload"), $ilErr->MESSAGE);
363 break;
364
365 case UPLOAD_ERR_NO_FILE:
366 $ilErr->raiseError($this->lng->txt("err_no_file_uploaded"), $ilErr->MESSAGE);
367 break;
368 }
369
370 $file = pathinfo($_FILES["scormfile"]["name"]);
371 } elseif ($DIC->http()->wrapper()->post()->has('uploaded_file')) {
372 $uploadedFile = $DIC->http()->wrapper()->post()->retrieve('uploaded_file', $DIC->refinery()->kindlyTo()->string());
373 // check if the file is in the upload directory and readable
375 $ilErr->raiseError($this->lng->txt("upload_error_file_not_found"), $ilErr->MESSAGE);
376 }
377
378 $file = pathinfo($uploadedFile);
379 } else {
380 $ilErr->raiseError($this->lng->txt("msg_no_file"), $ilErr->MESSAGE);
381 }
382
383 $name = substr($file["basename"], 0, strlen($file["basename"]) - strlen($file["extension"]) - 1);
384 if ($name == "") {
385 $name = $this->lng->txt("no_title");
386 }
387
388 $description = "";
389
390 $subType = "scorm2004";
391 if ($DIC->http()->wrapper()->post()->has('sub_type')) {
392 $subType = $DIC->http()->wrapper()->post()->retrieve('sub_type', $DIC->refinery()->kindlyTo()->string());
393 }
394
395 // always import authoring packages as scorm2004, see bug #27801
396 // if ($_POST["editable"] == 'y') {
397 // $subType = "scorm2004";
398 // }
399
400 // create and insert object in objecttree
401 switch ($subType) {
402 case "scorm2004":
403 $newObj = new ilObjSCORM2004LearningModule();
404 break;
405
406 case "scorm":
407 $newObj = new ilObjSCORMLearningModule();
408 break;
409
410 case "exportFile":
411 $sFile = $_FILES["scormfile"];
412 $fType = $sFile["type"];
413 $cFileTypes = ["application/zip", "application/x-compressed","application/x-zip-compressed"];
414 if (in_array($fType, $cFileTypes)) {
415 $tempFile = $sFile["tmp_name"];
416 $lmTempDir = ilFileUtils::ilTempnam();
417 ilFileUtils::makeDir($lmTempDir);
418 $zar = new ZipArchive();
419 $zar->open($tempFile);
420 $zar->extractTo($lmTempDir);
421 $zar->close();
423 $importer = new ilScormAiccImporter();
424 $import_dirname = $lmTempDir . '/' . substr($_FILES["scormfile"]["name"], 0, -4);
425 $importer->importXmlRepresentation("sahs", "", $import_dirname, null);
426 $import_result = $importer->getResult();
427
428 $importFromXml = true;
429 if ($import_result->isOK()) {
430 $properties = $import_result->value();
431 if (($subType = $properties['SubType']) === 'scorm') {
432 $newObj = new ilObjSCORMLearningModule();
433 } else {
434 $newObj = new ilObjSCORM2004LearningModule();
435 }
436 $name = $properties['Title'];
437 $description = $properties['Description'];
438 } else {
439 ilFileUtils::delDir($lmTempDir, false);
440 $ilLog->error('SCORM import of ILIAS exportfile not possible because parsing error');
441 $ilLog->error($import_result->error());
442 $this->tpl->setOnScreenMessage('failure', $this->lng->txt("import_file_not_valid"), true);
443 return;
444 }
445 }
446 break;
447 }
448
449 $newObj->setTitle($name);
450 $newObj->setSubType($subType);
451 $newObj->setDescription($description);
452 $newObj->setOfflineStatus(false);
453 $newObj->create(true);
454 $newObj->createReference();
455 $newObj->putInTree($refId);
456 $newObj->setPermissions($refId);
457
458 // create data directory, copy file to directory
459 $newObj->createDataDirectory();
460
461 if ($_FILES["scormfile"]["name"]) {
462 if ($importFromXml) {
463 $scormFile = "content.zip";
464 $scormFilePath = $import_dirname . "/" . $scormFile;
465 $file_path = $newObj->getDataDirectory() . "/" . $scormFile;
466 ilFileUtils::rename($scormFilePath, $file_path);
467 ilFileUtils::unzip($file_path);
468 unlink($file_path);
469 ilFileUtils::delDir($lmTempDir, false);
470 } else {
471 // copy uploaded file to data directory
472 $file_path = $newObj->getDataDirectory() . "/" . $_FILES["scormfile"]["name"];
474 $_FILES["scormfile"]["tmp_name"],
475 $_FILES["scormfile"]["name"],
476 $file_path
477 );
478 ilFileUtils::unzip($file_path);
479 }
480 } else {
481 // copy uploaded file to data directory
482 $uploadedFile = $DIC->http()->wrapper()->post()->retrieve('uploaded_file', $DIC->refinery()->kindlyTo()->string());
483 $file_path = $newObj->getDataDirectory() . "/" . $uploadedFile;
485 ilFileUtils::unzip($file_path);
486 }
487 ilFileUtils::renameExecutables($newObj->getDataDirectory());
488
489 $title = $newObj->readObject();
490 if ($title != "") {
491 ilObject::_writeTitle($newObj->getId(), $title);
492 }
493
494 //auto set learning progress settings
495 $newObj->setLearningProgressSettingsAtUpload();
496
497 if ($importFromXml) {
498 $importer->writeData("sahs", "5.1.0", $newObj->getId());
499 }
500
501 $this->tpl->setOnScreenMessage('info', $this->lng->txt($newObj->getType() . "_added"), true);
502 ilUtil::redirect("ilias.php?baseClass=ilSAHSEditGUI&ref_id=" . $newObj->getRefId());
503 }
static unzip(string $path_to_zip_file, bool $overwrite_existing=false, bool $unpack_flat=false)
static makeDir(string $a_dir)
creates a new directory and inherits all filesystem permissions of the parent directory You may pass ...
static ilTempnam(?string $a_temp_path=null)
Returns a unique and non existing Path for e temporary file or directory.
static rename(string $a_source, string $a_target)
static delDir(string $a_dir, bool $a_clean_only=false)
removes a dir and all its content (subdirs and files) recursively
static renameExecutables(string $a_dir)
static moveUploadedFile(string $a_file, string $a_name, string $a_target, bool $a_raise_errors=true, string $a_mode="move_uploaded")
move uploaded file
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _writeTitle(int $obj_id, string $title)
write title to db (static)
static _copyUploadFile(string $a_file, string $a_target, bool $a_raise_errors=true)
static _checkUploadFile(string $a_file)
static redirect(string $a_script)
if($DIC->http() ->wrapper() ->query() ->has('update')) $uploadedFile
Definition: imgupload.php:101
if($format !==null) $name
Definition: metadata.php:247
$source
Definition: metadata.php:93

References $DIC, $ilErr, $name, $refId, $source, $uploadedFile, ilUploadFiles\_checkUploadFile(), ilUploadFiles\_copyUploadFile(), ilObject\_writeTitle(), ilFileUtils\delDir(), ilLoggerFactory\getLogger(), ilFileUtils\ilTempnam(), ILIAS\Repository\lng(), ilFileUtils\makeDir(), ilFileUtils\moveUploadedFile(), ilUtil\redirect(), ilFileUtils\rename(), ilFileUtils\renameExecutables(), and ilFileUtils\unzip().

Referenced by upload().

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

Field Documentation

◆ $form

ilPropertyFormGUI ilObjSAHSLearningModuleGUI::$form
private

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

Referenced by initCreationForms().


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