ILIAS  trunk Revision v12.0_alpha-377-g3641b37b9db
ilObjCmiXapiGUI Class Reference
+ Inheritance diagram for ilObjCmiXapiGUI:
+ Collaboration diagram for ilObjCmiXapiGUI:

Public Member Functions

 __construct (int $a_id=0, int $a_id_type=self::REPOSITORY_NODE_ID, int $a_parent_node_id=0)
 
 getType ()
 Functions that must be overwritten. More...
 
 save ()
 
 initMetadata (ilObjCmiXapi $object)
 
 infoScreen ()
 
 infoScreenForward ()
 
- Public Member Functions inherited from ilObject2GUI
 __construct (int $id=0, int $id_type=self::REPOSITORY_NODE_ID, int $parent_node_id=0)
 
 executeCommand ()
 execute command More...
 
 getIdType ()
 
 delete ()
 Display delete confirmation form (repository/workspace switch) More...
 
 confirmedDelete ()
 Delete objects (repository/workspace switch) More...
 
 getHTML ()
 
 withReferences ()
 Final/Private declaration of unchanged parent methods. 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)
 
 isVisible (int $ref_id, string $type)
 
 setColumnSettings (ilColumnGUI $column_gui)
 
 view ()
 view object content (repository/workspace switch) More...
 
 getType ()
 Functions that must be overwritten. More...
 
 create ()
 CRUD. More...
 
 save ()
 
 edit ()
 
 update ()
 
 cancel ()
 
 putObjectInTree (ilObject $obj, ?int $parent_node_id=null)
 Add object to tree at given position. More...
 
- 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)
 
static getPrivacyIdentString (int $ident)
 
static getPrivacyNameString (int $ident)
 
- Static Public Member Functions inherited from ilObject2GUI
static handleAfterSaveCallback (ilObject $obj, ?int $callback_ref_id)
 After creation callback. 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)
 

Data Fields

const TAB_ID_INFO = 'tab_info'
 
const TAB_ID_SETTINGS = 'tab_settings'
 
const TAB_ID_STATEMENTS = 'tab_statements'
 
const TAB_ID_SCORING = 'tab_scoring'
 
const TAB_ID_LEARNING_PROGRESS = 'learning_progress'
 
const TAB_ID_METADATA = 'tab_metadata'
 
const TAB_ID_EXPORT = 'tab_export'
 
const TAB_ID_PERMISSIONS = 'perm_settings'
 
const CMD_INFO_SCREEN = 'infoScreen'
 
const CMD_FETCH_XAPI_STATEMENTS = 'fetchXapiStatements'
 
const DEFAULT_CMD = self::CMD_INFO_SCREEN
 
const NEW_OBJ_TITLE = ""
 
- Data Fields inherited from ilObject2GUI
const OBJECT_ID = 0
 
const REPOSITORY_NODE_ID = 1
 
const WORKSPACE_NODE_ID = 2
 
const REPOSITORY_OBJECT_ID = 3
 
const WORKSPACE_OBJECT_ID = 4
 
const PORTFOLIO_OBJECT_ID = 5
 
- 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 Member Functions

 initCreateForm (string $a_new_type)
 
 afterSave (ilObject $newObject)
 Post (successful) object creation hook. More...
 
 initHeaderAction (?string $sub_type=null, ?int $sub_id=null)
 Add header action menu. More...
 
 settings ()
 
 showSummary ()
 
 setTabs ()
 create tabs (repository/workspace switch) More...
 
 debug ()
 
 addLocatorItems ()
 Functions to be overwritten. More...
 
 trackObjectReadEvent ()
 
 initInfoScreenToolbar ()
 
 handleAvailablityMessage ()
 
 isFetchXapiStatementsRequired (ilCmiXapiUser $cmixUser)
 
 sendLastFetchInfo (ilCmiXapiUser $cmixUser)
 
 fetchXapiStatements ()
 
 getXapiStatementsReport (ilCmiXapiDateTime $since, ilCmiXapiDateTime $until)
 
 buildReportFilter (ilCmiXapiDateTime $since, ilCmiXapiDateTime $until)
 
- Protected Member Functions inherited from ilObject2GUI
 afterConstructor ()
 Do anything that should be done after constructor in here. More...
 
 assignObject ()
 create object instance as internal property (repository/workspace switch) More...
 
 getAccessHandler ()
 
 setLocator ()
 set Locator More...
 
 deleteConfirmedObjects ()
 Delete objects (workspace specific) This should probably be moved elsewhere as done with RepUtil. More...
 
 setTitleAndDescription ()
 
 omitLocator (bool $omit=true)
 
 getTargetFrame (string $cmd, string $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...
 
 getCenterColumnHTML ()
 Get center column. More...
 
 getRightColumnHTML ()
 Display right column. More...
 
 checkPermission (string $perm, string $cmd="", string $type="", ?int $ref_id=null)
 
 showPossibleSubObjects ()
 show possible sub objects (pull down menu) 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...
 
 addAdminLocatorItems (bool $do_not_add_object=false)
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 setTabs ()
 create tabs (repository/workspace switch) More...
 
 getReturnLocation (string $cmd, string $location="")
 Deprecated functions. More...
 
 setReturnLocation (string $cmd, string $location)
 set specific return location for command More...
 
 showActions ()
 
 getTabs ()
 @abstract overwrite in derived GUI class of your object type More...
 
 addLocatorItems ()
 Functions to be overwritten. More...
 
 checkPermissionBool (string $perm, string $cmd="", string $type="", ?int $node_id=null)
 
 initHeaderAction (?string $sub_type=null, ?int $sub_id=null)
 Add header action menu. More...
 
 redrawHeaderAction ()
 Updating icons after ajax call. 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 ()
 @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...
 
 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

ilCmiXapiAccess $cmixAccess
 
LOMServices $lom_services
 

Additional Inherited Members

- Protected Attributes inherited from ilObject2GUI
ilObjectDefinition $obj_definition
 
ilGlobalTemplateInterface $tpl
 
ilCtrl $ctrl
 
ilLanguage $lng
 
ilTabsGUI $tabs_gui
 
ilFavouritesManager $favourites
 
ilErrorHandling $error
 
ilLocatorGUI $locator
 
ilObjUser $user
 
ilAccessHandler $access
 
ilToolbarGUI $toolbar
 
Factory $refinery
 
ilRbacAdmin $rbac_admin
 
ilRbacSystem $rbac_system
 
ilRbacReview $rbac_review
 
int $request_ref_id
 
int $id_type
 
int $parent_id
 
string $type
 
string $html
 
int $object_id
 
int $node_id = null
 
array $creation_forms = []
 
 $access_handler
 
- Protected Attributes inherited from ilObjectGUI
ILIAS Notes Service $notes_service
 
GlobalHttpState $http
 
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
 
CustomIconFactory $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

Definition at line 44 of file class.ilObjCmiXapiGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilObjCmiXapiGUI::__construct ( int  $a_id = 0,
int  $a_id_type = self::REPOSITORY_NODE_ID,
int  $a_parent_node_id = 0 
)

Reimplemented from ilObject2GUI.

Definition at line 65 of file class.ilObjCmiXapiGUI.php.

66 {
67 global $DIC;
68
69 parent::__construct($a_id, $a_id_type, $a_parent_node_id);
70
71 if ($this->object instanceof ilObjCmiXapi) {
72 $this->cmixAccess = ilCmiXapiAccess::getInstance($this->object);
73 }
74
75 $this->lng->loadLanguageModule("cmix");
76 $this->lom_services = $DIC->learningObjectMetadata();
77 }
static getInstance(ilObjCmiXapi $object)
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
global $DIC
Definition: shib_login.php:26

References $DIC, ILIAS\GlobalScreen\Provider\__construct(), ilCmiXapiAccess\getInstance(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

Member Function Documentation

◆ _goto()

static ilObjCmiXapiGUI::_goto ( string  $a_target)
static

Definition at line 318 of file class.ilObjCmiXapiGUI.php.

318 : void
319 {
320 global $DIC;
321 $main_tpl = $DIC->ui()->mainTemplate();
322 /* @var \ILIAS\DI\Container $DIC */
323 $err = $DIC['ilErr'];
324 /* @var ilErrorHandling $err */
325 $ctrl = $DIC->ctrl();
326 $request = $DIC->http()->request();
327 $access = $DIC->access();
328 $lng = $DIC->language();
329
330 $targetParameters = explode('_', $a_target);
331 $id = (int) $targetParameters[0];
332
333 if ($id <= 0) {
334 $err->raiseError($lng->txt('msg_no_perm_read'), $err->FATAL);
335 }
336
337 if ($access->checkAccess('read', '', $id)) {
338 $ctrl->setTargetScript('ilias.php');
339 $ctrl->setParameterByClass(ilObjCmiXapiGUI::class, 'ref_id', $id);
340 $ctrl->redirectByClass([ilRepositoryGUI::class, ilObjCmiXapiGUI::class]);
341 } elseif ($access->checkAccess('visible', '', $id)) {
343 } elseif ($access->checkAccess('read', '', ROOT_FOLDER_ID)) {
344 $main_tpl->setOnScreenMessage('info', sprintf(
345 $lng->txt('msg_no_perm_read_item'),
347 ), true);
348
350 }
351
352 $err->raiseError($lng->txt("msg_no_perm_read_lm"), $err->FATAL);
353 }
redirectByClass( $a_class, ?string $a_cmd=null, ?string $a_anchor=null, bool $is_async=false)
@inheritDoc
setTargetScript(string $a_target_script)
@inheritDoc
setParameterByClass(string $a_class, string $a_parameter, $a_value)
@inheritDoc
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...
ilAccessHandler $access
static _gotoRepositoryRoot(bool $raise_error=false)
Goto repository root.
static _gotoRepositoryNode(int $ref_id, string $cmd="")
ServerRequestInterface $request
static _lookupObjId(int $ref_id)
static _lookupTitle(int $obj_id)
const ROOT_FOLDER_ID
Definition: constants.php:32
checkAccess(string $a_permission, string $a_cmd, int $a_ref_id, string $a_type="", ?int $a_obj_id=null, ?int $a_tree_id=null)
check access for an object (provide $a_type and $a_obj_id if available for better performance)

References ilObject2GUI\$access, ilObject2GUI\$ctrl, $DIC, ilObjectGUI\$id, ilObject2GUI\$lng, ilObjectGUI\$request, ilObjectGUI\_gotoRepositoryNode(), ilObjectGUI\_gotoRepositoryRoot(), ilObject\_lookupObjId(), ilObject\_lookupTitle(), ilRBACAccessHandler\checkAccess(), ILIAS\Repository\int(), ilCtrl\redirectByClass(), ROOT_FOLDER_ID, ilCtrl\setParameterByClass(), ilCtrl\setTargetScript(), and ilLanguage\txt().

+ Here is the call graph for this function:

◆ addLocatorItems()

ilObjCmiXapiGUI::addLocatorItems ( )
protected

Functions to be overwritten.

Reimplemented from ilObject2GUI.

Definition at line 616 of file class.ilObjCmiXapiGUI.php.

616 : void
617 {
618 global $DIC;
619 /* @var \ILIAS\DI\Container $DIC */
620
621 $locator = $DIC['ilLocator'];
622 /* @var ilLocatorGUI $locator */
623 $locator->addItem(
624 $this->object->getTitle(),
625 $this->ctrl->getLinkTarget($this, self::DEFAULT_CMD),
626 "",
627 $DIC->http()->wrapper()->query()->retrieve("ref_id", $DIC->refinery()->kindlyTo()->int())
628 );
629 }
ilLocatorGUI $locator

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

+ Here is the call graph for this function:

◆ afterSave()

ilObjCmiXapiGUI::afterSave ( ilObject  $new_object)
protected

Post (successful) object creation hook.

Reimplemented from ilObjectGUI.

Definition at line 203 of file class.ilObjCmiXapiGUI.php.

203 : void
204 {
205 /* @var ilObjCmiXapi $newObject */
206 $form = $this->initCreateForm($newObject->getType());
207
208 if ($form->checkInput()) {
209 $newObject->setContentType($form->getInput('content_type'));
210
211 $newObject->setLrsTypeId((int) $form->getInput('lrs_type_id'));
212 $newObject->initLrsType();
213
214 $newObject->setPrivacyIdent($newObject->getLrsType()->getPrivacyIdent());
215 $newObject->setPrivacyName($newObject->getLrsType()->getPrivacyName());
216
217 switch ($form->getInput('source_type')) {
218 case 'resource': // remote resource
219
220 $newObject->setTitle($form->getInput('title'));
221 $newObject->setSourceType(ilObjCmiXapi::SRC_TYPE_REMOTE);
222 break;
223
224 case 'upload': // upload from local client
225
226 try {
227 $uploadImporter = new ilCmiXapiContentUploadImporter($newObject);
228 $uploadImporter->importFormUpload((array) $form->getInput('uploadfile'));
229
230 $newObject->setSourceType(ilObjCmiXapi::SRC_TYPE_LOCAL);
232 $form->getItemByPostVar('uploadfile')->setAlert($e->getMessage());
233 $this->tpl->setOnScreenMessage('failure', 'something went wrong!', true);
234 $this->ctrl->redirectByClass(self::class, 'create');
235 }
236
237 break;
238
239 case 'server': // from upload directory
240
242 throw new ilCmiXapiException('access denied!');
243 }
244
245 $serverFile = $form->getInput('serverfile');
246
247 if (!ilUploadFiles::_checkUploadFile($serverFile)) {
248 throw new ilCmiXapiException($this->lng->txt('upload_error_file_not_found'));
249 }
250
251 $uploadImporter = new ilCmiXapiContentUploadImporter($newObject);
252
253 $uploadImporter->importServerFile(implode(DIRECTORY_SEPARATOR, [
255 $serverFile
256 ]));
257
258 $newObject->setSourceType(ilObjCmiXapi::SRC_TYPE_LOCAL);
259
260 break;
261
262 case 'external':
263
264 $newObject->setSourceType(ilObjCmiXapi::SRC_TYPE_EXTERNAL);
265 $newObject->setBypassProxyEnabled(true);
266 break;
267 }
268
269 $newObject->save();
270
271 $this->initMetadata($newObject);
272
273 $this->ctrl->redirectByClass(ilCmiXapiSettingsGUI::class);
274 }
275
276 throw new ilCmiXapiException('invalid creation form submit!');
277 }
initCreateForm(string $a_new_type)
initMetadata(ilObjCmiXapi $object)
static _checkUploadFile(string $a_file)
static _getUploadDirectory()

References Vendor\Package\$e, ilUploadFiles\_checkUploadFile(), ilUploadFiles\_getUploadDirectory(), ILIAS\Repository\ctrl(), ilObject\getType(), initCreateForm(), initMetadata(), ILIAS\Repository\lng(), ilObject\setTitle(), ilObjCmiXapi\SRC_TYPE_EXTERNAL, ilObjCmiXapi\SRC_TYPE_LOCAL, and ilObjCmiXapi\SRC_TYPE_REMOTE.

Referenced by save().

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

◆ buildReportFilter()

ilObjCmiXapiGUI::buildReportFilter ( ilCmiXapiDateTime  $since,
ilCmiXapiDateTime  $until 
)
protected

Definition at line 942 of file class.ilObjCmiXapiGUI.php.

946 global $DIC;
947 /* @var \ILIAS\DI\Container $DIC */
948
949 $filter = new ilCmiXapiStatementsReportFilter();
950
951 $filter->setActor(new ilCmiXapiUser($this->object->getId(), $DIC->user()->getId()));
952 $filter->setActivityId($this->object->getActivityId());
953
954 $filter->setStartDate($since);
955 $filter->setEndDate($until);
956
957 $start = $filter->getStartDate()->get(IL_CAL_DATETIME);
958 $end = $filter->getEndDate()->get(IL_CAL_DATETIME);
959 ilLoggerFactory::getLogger($this->object->getType())->debug("use filter from ($start) until ($end)");
960
961 return $filter;
962 }
const IL_CAL_DATETIME
static getLogger(string $a_component_id)
Get component logger.

◆ debug()

ilObjCmiXapiGUI::debug ( )
protected

Definition at line 581 of file class.ilObjCmiXapiGUI.php.

581 : void
582 {
583 global $DIC;
584 /* @var \ILIAS\DI\Container $DIC */
585
586 $DIC->tabs()->activateTab('debug');
587
588 $filter = new ilCmiXapiStatementsReportFilter();
589 $filter->setActivityId($this->object->getActivityId());
590
591 $linkBuilder = new ilCmiXapiHighscoreReportLinkBuilder(
592 $this->object->getId(),
593 $this->object->getLrsType()->getLrsEndpointStatementsAggregationLink(),
594 $filter
595 );
596
598 $this->object->getLrsType()->getBasicAuth(),
599 $linkBuilder
600 );
601
602 try {
603 $report = $request->queryReport($this->object->getId());
604
605 $DIC->ui()->mainTemplate()->setContent(
606 $report->getResponseDebug()
607 );
608 //ilUtil::sendSuccess('Object ID: '.$this->object->getId());
609 $this->tpl->setOnScreenMessage('info', $linkBuilder->getPipelineDebug());
610 $this->tpl->setOnScreenMessage('question', '<pre>' . print_r($report->getTableData(), true) . '</pre>');
611 } catch (Exception $e) {
612 $this->tpl->setOnScreenMessage('failure', $e->getMessage());
613 }
614 }

References $DIC, Vendor\Package\$e, ilObjectGUI\$request, and ILIAS\Repository\object().

+ Here is the call graph for this function:

◆ fetchXapiStatements()

ilObjCmiXapiGUI::fetchXapiStatements ( )
protected

Definition at line 890 of file class.ilObjCmiXapiGUI.php.

890 : void
891 {
892 global $DIC;
893 /* @var \ILIAS\DI\Container $DIC */
894 $logger = ilLoggerFactory::getLogger($this->object->getType());
895
896 if ($this->object->getLaunchMode() != ilObjCmiXapi::LAUNCH_MODE_NORMAL) {
897 throw new ilCmiXapiException('access denied!');
898 }
899
900 $cmixUser = new ilCmiXapiUser($this->object->getId(), $DIC->user()->getId(), $this->object->getPrivacyIdent());
901
902 $fetchedUntil = $cmixUser->getFetchUntil();
903 $now = new ilCmiXapiDateTime(time(), IL_CAL_UNIX);
904
905 $report = $this->getXapiStatementsReport($fetchedUntil, $now);
906
907 if ($report->hasStatements()) {
908 $evaluation = new ilXapiStatementEvaluation($logger, $this->object);
909 $evaluation->evaluateReport($report);
910
911 //$logger->debug('update lp for object (' . $this->object->getId() . ')');
912 //ilLPStatusWrapper::_updateStatus($this->object->getId(), $DIC->user()->getId());
913 }
914
915 $cmixUser->setFetchUntil($now);
916 $cmixUser->save();
917
918 $this->tpl->setOnScreenMessage('success', $DIC->language()->txt('xapi_statements_fetched_successfully'), true);
919 $DIC->ctrl()->redirect($this, self::CMD_INFO_SCREEN);
920 }
const IL_CAL_UNIX
getXapiStatementsReport(ilCmiXapiDateTime $since, ilCmiXapiDateTime $until)

References $DIC, ilLoggerFactory\getLogger(), getXapiStatementsReport(), IL_CAL_UNIX, ilObjCmiXapi\LAUNCH_MODE_NORMAL, and ILIAS\Repository\object().

+ Here is the call graph for this function:

◆ getPrivacyIdentString()

static ilObjCmiXapiGUI::getPrivacyIdentString ( int  $ident)
static

Definition at line 964 of file class.ilObjCmiXapiGUI.php.

964 : string
965 {
966 switch ($ident) {
967 case 0:
968 return "il_uuid_user_id";
969 case 1:
970 return "il_uuid_ext_account";
971 case 2:
972 return "il_uuid_login";
973 case 3:
974 return "real_email";
975 case 4:
976 return "il_uuid_random";
977 case 5:
978 return "il_uuid_sha256";
979 case 6:
980 return "il_uuid_sha256url";
981 }
982 return '';
983 }

Referenced by ilObjLTIConsumerGUI\configureInfoScreen().

+ Here is the caller graph for this function:

◆ getPrivacyNameString()

static ilObjCmiXapiGUI::getPrivacyNameString ( int  $ident)
static

Definition at line 985 of file class.ilObjCmiXapiGUI.php.

985 : string
986 {
987 switch ($ident) {
988 case 0:
989 return "none";
990 case 1:
991 return "firstname";
992 case 2:
993 return "lastname";
994 case 3:
995 return "fullname";
996 }
997 return '';
998 }

Referenced by ilObjLTIConsumerGUI\configureInfoScreen().

+ Here is the caller graph for this function:

◆ getType()

ilObjCmiXapiGUI::getType ( )

Functions that must be overwritten.

Reimplemented from ilObject2GUI.

Definition at line 79 of file class.ilObjCmiXapiGUI.php.

79 : string
80 {
81 return 'cmix';
82 }

◆ getXapiStatementsReport()

ilObjCmiXapiGUI::getXapiStatementsReport ( ilCmiXapiDateTime  $since,
ilCmiXapiDateTime  $until 
)
protected

Definition at line 922 of file class.ilObjCmiXapiGUI.php.

926 $filter = $this->buildReportFilter($since, $until);
927
928 $linkBuilder = new ilCmiXapiStatementsReportLinkBuilder(
929 $this->object->getId(),
930 $this->object->getLrsType()->getLrsEndpointStatementsAggregationLink(),
931 $filter
932 );
933
935 $this->object->getLrsType()->getBasicAuth(),
936 $linkBuilder
937 );
938
939 return $request->queryReport($this->object->getId());
940 }
buildReportFilter(ilCmiXapiDateTime $since, ilCmiXapiDateTime $until)

Referenced by fetchXapiStatements().

+ Here is the caller graph for this function:

◆ handleAvailablityMessage()

ilObjCmiXapiGUI::handleAvailablityMessage ( )
protected

Definition at line 846 of file class.ilObjCmiXapiGUI.php.

846 : void
847 {
848 global $DIC;
849
850 if ($this->object->getLrsType()->getAvailability() == ilCmiXapiLrsType::AVAILABILITY_NONE) {
851 $DIC->language()->loadLanguageModule('cmix');
852 $this->tpl->setOnScreenMessage('failure', $DIC->language()->txt('lrs_type_not_avail_msg'));
853 }
854 }

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

Referenced by infoScreenForward().

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

◆ infoScreen()

ilObjCmiXapiGUI::infoScreen ( )

Definition at line 644 of file class.ilObjCmiXapiGUI.php.

644 : void
645 {
646 global $DIC;
647
648 $DIC->tabs()->activateTab(self::TAB_ID_INFO);
649 $this->ctrl->redirectByClass(ilInfoScreenGUI::class, 'showSummary');
650 }

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

Referenced by showSummary().

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

◆ infoScreenForward()

ilObjCmiXapiGUI::infoScreenForward ( )

Definition at line 652 of file class.ilObjCmiXapiGUI.php.

652 : void
653 {
654 global $DIC;
655 /* @var \ILIAS\DI\Container $DIC */
656 $ilErr = $DIC['ilErr'];
657 /* @var ilErrorHandling $ilErr */
658
659 if (!$this->checkPermissionBool("visible") && !$this->checkPermissionBool("read")) {
660 $ilErr->raiseError($DIC->language()->txt("msg_no_perm_read"), $ilErr->MESSAGE);
661 }
662
664 $this->initInfoScreenToolbar();
665
666 $info = new ilInfoScreenGUI($this);
667
668 $info->enablePrivateNotes();
669
670 if ($this->checkPermissionBool("read")) {
671 $info->enableNews();
672 }
673
674 $info->enableNewsEditing(false);
675
676 if ($this->checkPermissionBool("write")) {
677 $news_set = new ilSetting("news");
678 $enable_internal_rss = $news_set->get("enable_rss_for_internal");
679
680 if ($enable_internal_rss) {
681 $info->setBlockProperty("news", "settings", (string) true);
682 $info->setBlockProperty("news", "public_notifications_option", (string) true);
683 }
684 }
685
686 if (DEVMODE) {
687 // Development Info
688 $info->addSection('DEVMODE Info');
689 $info->addProperty('Local Object ID', (string) $this->object->getId());
690 $info->addProperty('Current User ID', (string) $DIC->user()->getId());
691 }
692
693 // standard meta data
694 $info->addMetaDataSections($this->object->getId(), 0, $this->object->getType());
695
696 // Info about privacy
697 if ($this->object->isSourceTypeExternal()) {
698 $info->addSection($DIC->language()->txt("cmix_info_privacy_section"));
699 } else {
700 $info->addSection($DIC->language()->txt("cmix_info_privacy_section_launch"));
701 }
702
703 $info->addProperty($DIC->language()->txt('cmix_lrs_type'), $this->object->getLrsType()->getTitle());
704
705 if ($this->object->isSourceTypeExternal()) {
706 $cmixUser = new ilCmiXapiUser(
707 $this->object->getId(),
708 $DIC->user()->getId(),
709 $this->object->getPrivacyIdent()
710 );
711 if ($cmixUser->getUsrIdent()) {
712 $info->addProperty(
713 $DIC->language()->txt("conf_user_registered_mail"),
714 $cmixUser->getUsrIdent()
715 );
716 }
717 } else {
718 $info->addProperty(
719 $DIC->language()->txt("conf_privacy_name"),
720 $DIC->language()->txt('conf_privacy_name_' . self::getPrivacyNameString($this->object->getPrivacyName()))
721 );
722
723 $info->addProperty(
724 $DIC->language()->txt("conf_privacy_ident"),
725 $DIC->language()->txt('conf_privacy_ident_' . self::getPrivacyIdentString($this->object->getPrivacyIdent()))
726 );
727 }
728
729 if ($this->object->getLrsType()->getExternalLrs()) {
730 $info->addProperty(
731 $DIC->language()->txt("cmix_info_external_lrs_label"),
732 $DIC->language()->txt('cmix_info_external_lrs_info')
733 );
734 }
735
736 if (strlen($this->object->getLrsType()->getPrivacyCommentDefault())) {
737 $info->addProperty(
738 $DIC->language()->txt("cmix_indication_to_user"),
739 nl2br($this->object->getLrsType()->getPrivacyCommentDefault())
740 );
741 }
742
743 // FINISHED INFO SCREEN, NOW FORWARD
744
745 $this->ctrl->forwardCommand($info);
746 }
Class ilInfoScreenGUI.
checkPermissionBool(string $perm, string $cmd="", string $type="", ?int $node_id=null)
ILIAS Setting Class.
$info
Definition: entry_point.php:21
$ilErr
Definition: raiseError.php:33

References $DIC, $ilErr, $info, ilObject2GUI\checkPermissionBool(), ILIAS\Repository\ctrl(), handleAvailablityMessage(), initInfoScreenToolbar(), and ILIAS\Repository\object().

+ Here is the call graph for this function:

◆ initCreateForm()

ilObjCmiXapiGUI::initCreateForm ( string  $a_new_type)
protected
Exceptions
ilCtrlException

Reimplemented from ilObjectGUI.

Definition at line 87 of file class.ilObjCmiXapiGUI.php.

88 {
89 $form = new ilPropertyFormGUI();
90 $form->setTarget("_top");
91 $form->setFormAction($this->ctrl->getFormAction($this, "save"));
92 $form->setTitle($this->lng->txt($a_new_type . "_new"));
93
94 $form = $this->initDidacticTemplate($form);
95
96 $title = new ilHiddenInputGUI('title');
97 $title->setValue(self::NEW_OBJ_TITLE);
98 $form->addItem($title);
99
100 $type = new ilRadioGroupInputGUI('Type', 'content_type');
101 $type->setRequired(true);
102
103 $typeLearningModule = new ilRadioOption($this->lng->txt('cmix_add_cmi5_lm'), ilObjCmiXapi::CONT_TYPE_CMI5);
104 $typeLearningModule->setInfo($this->lng->txt('cmix_add_cmi5_lm_info'));
105 $type->addOption($typeLearningModule);
106
107 $typeGenericModule = new ilRadioOption(
108 $this->lng->txt('cmix_add_xapi_standard_object'),
110 );
111 $typeGenericModule->setInfo($this->lng->txt('cmix_add_xapi_standard_object_info'));
112 $type->addOption($typeGenericModule);
113
114 $form->addItem($type);
115
116 $item = new ilRadioGroupInputGUI($this->lng->txt('cmix_add_lrs_type'), 'lrs_type_id');
117 $item->setRequired(true);
119 foreach ($types as $type) {
120 $option = new ilRadioOption((string) $type['title'], (string) $type['type_id'], (string) $type['description']);
121 $item->addOption($option);
122 }
123 $form->addItem($item);
124
125 $source = new ilRadioGroupInputGUI($this->lng->txt('cmix_add_source'), 'source_type');
126 $source->setRequired(true);
127
128 $srcRemoteContent = new ilRadioOption($this->lng->txt('cmix_add_source_url'), 'resource');
129 $srcRemoteContent->setInfo($this->lng->txt('cmix_add_source_url_info'));
130 $source->addOption($srcRemoteContent);
131
132 $srcUploadContent = new ilRadioOption($this->lng->txt('cmix_add_source_local_dir'), 'upload');
133 $srcUploadContent->setInfo($this->lng->txt('cmix_add_source_local_dir_info'));
134 $source->addOption($srcUploadContent);
135
136 $srcUpload = new ilFileInputGUI($this->lng->txt("select_file"), "uploadfile");
137 $srcUpload->setAllowDeletion(false);
138 $srcUpload->setSuffixes(['zip', 'xml']);
139 $srcUpload->setRequired(true);
140 $srcUploadContent->addSubItem($srcUpload);
141
143 $srcServerContent = new ilRadioOption($this->lng->txt('cmix_add_source_upload_dir'), 'server');
144 $srcServerContent->setInfo($this->lng->txt('cmix_add_source_upload_dir_info'));
145 $source->addOption($srcServerContent);
146
147 $options = ['' => $this->lng->txt('cmix_add_source_upload_select')];
148
149 foreach (ilUploadFiles::_getUploadFiles() as $file) {
150 $options[$file] = $file;
151 }
152
153 $srcSelect = new ilSelectInputGUI($this->lng->txt("select_file"), "serverfile");
154 $srcSelect->setOptions($options);
155 $srcServerContent->addSubItem($srcSelect);
156 }
157
158 $srcExternalApp = new ilRadioOption($this->lng->txt('cmix_add_source_external_app'), 'external');
159 $srcExternalApp->setInfo($this->lng->txt('cmix_add_source_external_app_info'));
160 $source->addOption($srcExternalApp);
161
162 $form->addItem($source);
163
164 $form->addCommandButton("save", $this->lng->txt($a_new_type . "_add"));
165 $form->addCommandButton("cancel", $this->lng->txt("cancel"));
166
167 return $form;
168 }
static getTypesData(bool $a_extended=false, ?int $a_availability=null)
Get basic data array of all types (without field definitions)
This class represents a file property in a property form.
This class represents a hidden form property in a property form.
initDidacticTemplate(ilPropertyFormGUI $form)
This class represents a property form user interface.
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.

References ILIAS\UI\Implementation\Component\Input\Field\$options, ilObject2GUI\$type, ilUploadFiles\_getUploadDirectory(), ilUploadFiles\_getUploadFiles(), ilCmiXapiLrsType\AVAILABILITY_CREATE, ilObjCmiXapi\CONT_TYPE_CMI5, ilObjCmiXapi\CONT_TYPE_GENERIC, ILIAS\Repository\ctrl(), ilCmiXapiLrsTypeList\getTypesData(), ilObjectGUI\initDidacticTemplate(), and ILIAS\Repository\lng().

Referenced by afterSave(), and save().

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

◆ initHeaderAction()

ilObjCmiXapiGUI::initHeaderAction ( ?string  $sub_type = null,
?int  $sub_id = null 
)
protected

Add header action menu.

Reimplemented from ilObject2GUI.

Definition at line 286 of file class.ilObjCmiXapiGUI.php.

287 {
288 $return = parent::initHeaderAction($sub_type, $sub_id);
289
290 if ($this->creation_mode) {
291 return $return;
292 }
293
294 $validator = new ilCertificateDownloadValidator();
295 if ($validator->isCertificateDownloadable((int) $this->user->getId(), $this->object->getId())) {
296 $certLink = $this->ctrl->getLinkTargetByClass(
297 [ilObjCmiXapiGUI::class, ilCmiXapiSettingsGUI::class],
299 );
300
301 $this->lng->loadLanguageModule('certificate');
302
303 $return->addCustomCommand($certLink, 'download_certificate');
304
305 $return->addHeaderIcon(
306 'cert_icon',
307 ilUtil::getImagePath('standard/icon_cert.svg'),
308 $this->lng->txt('download_certificate'),
309 null,
310 null,
311 $certLink
312 );
313 }
314
315 return $return;
316 }
Validates if an active certificate is stored in the database and can be downloaded by the user.
static getImagePath(string $image_name, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)

References ilCmiXapiSettingsGUI\CMD_DELIVER_CERTIFICATE, ILIAS\Repository\ctrl(), ilUtil\getImagePath(), and ILIAS\Repository\lng().

+ Here is the call graph for this function:

◆ initInfoScreenToolbar()

ilObjCmiXapiGUI::initInfoScreenToolbar ( )
protected

beware: ilCmiXapiUser::exists($this->object->getId(),$DIC->user()->getId()); this is not a valid query because if you switched privacyIdent mode before you will get an existing user without launched data like proxySuccess

Definition at line 748 of file class.ilObjCmiXapiGUI.php.

748 : void
749 {
750 global $DIC;
751 /* @var \ILIAS\DI\Container $DIC */
752
753 if (!$this->object->getOfflineStatus() && $this->object->getLrsType()->isAvailable() && $this->checkPermissionBool("read")) {
754 // TODO : check if this is the correct query
755 // p.e. switched to another privacyIdent before: user exists but not with the new privacyIdent
756 // re_check for isSourceTypeExternal
757 //$cmixUserExists = ilCmiXapiUser::exists($this->object->getId(), $DIC->user()->getId());
758
759 if ($this->object->isSourceTypeExternal()) {
760 $extCmiUserExists = ilCmiXapiUser::exists($this->object->getId(), $DIC->user()->getId());
761 // $registerButton = ilLinkButton::getInstance();
762 //
763 // if ($extCmiUserExists) {
764 // $registerButton->setCaption('change_registration');
765 // } else {
766 // $registerButton->setPrimary(true);
767 // $registerButton->setCaption('create_registration');
768 // }
769 //
770 // $registerButton->setUrl($DIC->ctrl()->getLinkTargetByClass(
771 // ilCmiXapiRegistrationGUI::class
772 // ));
773 //
774 // $DIC->toolbar()->addButtonInstance($registerButton);
775
776 if ($extCmiUserExists) {
777 $label = $this->lng->txt('change_registration');
778 } else {
779 // $registerButton->setPrimary(true);
780 $label = $this->lng->txt('create_registration');
781 }
782 $button = $DIC->ui()->factory()->button()->primary(
783 $label,
784 $DIC->ctrl()->getLinkTargetByClass(ilCmiXapiRegistrationGUI::class)
785 );
786 $DIC->toolbar()->addComponent($button);
787 } else {
788 $launchButton = ilLinkButton::getInstance();
789 $launchButton->setPrimary(true);
790 $launchButton->setCaption('launch');
791
792 if ($this->object->getLaunchMethod() == ilObjCmiXapi::LAUNCH_METHOD_NEW_WIN) {
793 $launchButton->setTarget('_blank');
794 }
795
796 $launchButton->setUrl($DIC->ctrl()->getLinkTargetByClass(
797 ilCmiXapiLaunchGUI::class
798 ));
799
800 $DIC->toolbar()->addButtonInstance($launchButton);
801
802 //todo
803 // if ($this->object->getLaunchMethod() == ilObjCmiXapi::LAUNCH_METHOD_NEW_WIN) {
804 // setTarget('_blank');
805 // }
806 // $button = $DIC->ui()->factory()->button()->primary(
807 // $this->lng->txt('launch'),
808 // $DIC->ctrl()->getLinkTargetByClass(ilCmiXapiLaunchGUI::class)
809 // );
810 // $DIC->toolbar()->addComponent($button);
811 }
812
818 $cmiUserExists = ilCmiXapiUser::exists(
819 $this->object->getId(),
820 $DIC->user()->getId(),
821 $this->object->getPrivacyIdent()
822 );
823
824 if ($cmiUserExists) {
825 $cmixUser = new ilCmiXapiUser(
826 $this->object->getId(),
827 $DIC->user()->getId(),
828 $this->object->getPrivacyIdent()
829 );
830
831 if ($this->isFetchXapiStatementsRequired($cmixUser)) {
832 $button = $DIC->ui()->factory()->button()->primary(
833 $this->lng->txt('fetch_xapi_statements'),
834 $DIC->ctrl()->getLinkTarget(
835 $this,
836 self::CMD_FETCH_XAPI_STATEMENTS
837 )
838 );
839 $DIC->toolbar()->addComponent($button);
840 $this->sendLastFetchInfo($cmixUser);
841 }
842 }
843 }
844 }
static exists(int $objId, int $usrId, int $privacyIdent=999)
sendLastFetchInfo(ilCmiXapiUser $cmixUser)
isFetchXapiStatementsRequired(ilCmiXapiUser $cmixUser)

References $DIC, ilCmiXapiUser\exists(), ilLinkButton\getInstance(), isFetchXapiStatementsRequired(), ilObjCmiXapi\LAUNCH_METHOD_NEW_WIN, ILIAS\Repository\lng(), ILIAS\Repository\object(), and sendLastFetchInfo().

Referenced by infoScreenForward().

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

◆ initMetadata()

ilObjCmiXapiGUI::initMetadata ( ilObjCmiXapi  $object)

Definition at line 279 of file class.ilObjCmiXapiGUI.php.

279 : void
280 {
281 $this->lom_services->derive()
282 ->fromBasicProperties($object->getTitle())
283 ->forObject($object->getId(), $object->getId(), $object->getType());
284 }

References ilObjectGUI\$object, ilObject\getId(), ilObject\getTitle(), and ilObject\getType().

Referenced by afterSave().

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

◆ isFetchXapiStatementsRequired()

ilObjCmiXapiGUI::isFetchXapiStatementsRequired ( ilCmiXapiUser  $cmixUser)
protected

Definition at line 856 of file class.ilObjCmiXapiGUI.php.

856 : bool
857 {
858 global $DIC;
859 if ($this->object->getLaunchMode() != ilObjCmiXapi::LAUNCH_MODE_NORMAL) {
860 return false;
861 }
862
863 if ($this->object->isBypassProxyEnabled()) {
864 return true;
865 }
866
867 if (!$cmixUser->hasProxySuccess()) {
868 return true;
869 }
870
871 return false;
872 }

References $DIC, ilCmiXapiUser\hasProxySuccess(), ilObjCmiXapi\LAUNCH_MODE_NORMAL, and ILIAS\Repository\object().

Referenced by initInfoScreenToolbar().

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

◆ save()

ilObjCmiXapiGUI::save ( )

Reimplemented from ilObject2GUI.

Definition at line 170 of file class.ilObjCmiXapiGUI.php.

170 : void
171 {
172 // create permission is already checked in createObject. This check here is done to prevent hacking attempts
173 if (!$this->checkPermissionBool("create", "", $this->requested_new_type)) {
174 $this->error->raiseError($this->lng->txt("no_create_permission"), $this->error->MESSAGE);
175 }
176
177 $this->lng->loadLanguageModule($this->requested_new_type);
178 $this->ctrl->setParameter($this, "new_type", $this->requested_new_type);
179
180 $form = $this->initCreateForm($this->requested_new_type);
181
182 $this->ctrl->setParameter($this, 'new_type', '');
183
184 $class_name = 'ilObj' . $this->obj_definition->getClassName($this->requested_new_type);
185
186 $new_obj = new $class_name();
187 $new_obj->setType($this->requested_new_type);
188 $new_obj->processAutoRating();
189 $new_obj->create();
190
191 $this->putObjectInTree($new_obj);
192
193 $dtpl = $data['didactic_templates'] ?? null;
194 if ($dtpl !== null) {
195 $dtpl_id = $this->parseDidacticTemplateVar($dtpl, 'dtpl');
196 $new_obj->applyDidacticTemplate($dtpl_id);
197 }
198
199 $this->afterSave($new_obj);
200 }
error(string $a_errmsg)
afterSave(ilObject $newObject)
Post (successful) object creation hook.
putObjectInTree(ilObject $obj, ?int $parent_node_id=null)
Add object to tree at given position.
parseDidacticTemplateVar(string $var, string $type)

References ilObjectGUI\$data, afterSave(), ilObject2GUI\checkPermissionBool(), ILIAS\Repository\ctrl(), error(), initCreateForm(), ILIAS\Repository\lng(), ilObjectGUI\parseDidacticTemplateVar(), and ilObject2GUI\putObjectInTree().

+ Here is the call graph for this function:

◆ sendLastFetchInfo()

ilObjCmiXapiGUI::sendLastFetchInfo ( ilCmiXapiUser  $cmixUser)
protected

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

874 : void
875 {
876 global $DIC;
877 /* @var \ILIAS\DI\Container $DIC */
878
879 if (!$cmixUser->getFetchUntil()->get(IL_CAL_UNIX)) {
880 $info = $DIC->language()->txt('xapi_statements_not_fetched_yet');
881 } else {
882 $info = $DIC->language()->txt('xapi_statements_last_fetch_date') . ' ' . ilDatePresentation::formatDate(
883 $cmixUser->getFetchUntil()
884 );
885 }
886
887 $this->tpl->setOnScreenMessage('info', $info);
888 }
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false, ?ilObjUser $user=null,)

References $DIC, $info, ilDatePresentation\formatDate(), ilCmiXapiUser\getFetchUntil(), and IL_CAL_UNIX.

Referenced by initInfoScreenToolbar().

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

◆ setTabs()

ilObjCmiXapiGUI::setTabs ( )
protected

create tabs (repository/workspace switch)

this had to be moved here because of the context-specific permission tab

Reimplemented from ilObject2GUI.

Definition at line 500 of file class.ilObjCmiXapiGUI.php.

500 : void
501 {
502 global $DIC;
503 /* @var \ILIAS\DI\Container $DIC */
504
505 $DIC->tabs()->addTab(
506 self::TAB_ID_INFO,
507 $DIC->language()->txt(self::TAB_ID_INFO),
508 $DIC->ctrl()->getLinkTargetByClass(ilInfoScreenGUI::class)
509 );
510
511 if ($this->cmixAccess->hasWriteAccess()) {
512 $DIC->tabs()->addTab(
513 self::TAB_ID_SETTINGS,
514 $DIC->language()->txt(self::TAB_ID_SETTINGS),
515 $DIC->ctrl()->getLinkTargetByClass(ilCmiXapiSettingsGUI::class)
516 );
517 }
518
519 if ($this->cmixAccess->hasStatementsAccess()) {
520 $DIC->tabs()->addTab(
521 self::TAB_ID_STATEMENTS,
522 $DIC->language()->txt(self::TAB_ID_STATEMENTS),
523 $DIC->ctrl()->getLinkTargetByClass(ilCmiXapiStatementsGUI::class)
524 );
525 }
526
527 if ($this->cmixAccess->hasHighscoreAccess()) {
528 $DIC->tabs()->addTab(
529 self::TAB_ID_SCORING,
530 $DIC->language()->txt(self::TAB_ID_SCORING),
531 $DIC->ctrl()->getLinkTargetByClass(ilCmiXapiScoringGUI::class)
532 );
533 }
534
535 if ($this->cmixAccess->hasLearningProgressAccess()) {
536 $DIC->tabs()->addTab(
537 self::TAB_ID_LEARNING_PROGRESS,
538 $DIC->language()->txt(self::TAB_ID_LEARNING_PROGRESS),
539 $DIC->ctrl()->getLinkTargetByClass(ilLearningProgressGUI::class)
540 );
541 }
542
543 if ($this->cmixAccess->hasWriteAccess()) {
544 $gui = new ilObjectMetaDataGUI($this->object);
545 $link = $gui->getTab();
546
547 if (strlen($link)) {
548 $DIC->tabs()->addTab(
549 self::TAB_ID_METADATA,
550 $DIC->language()->txt('meta_data'),
551 $link
552 );
553 }
554 }
555
556 if ($this->cmixAccess->hasWriteAccess()) {
557 $DIC->tabs()->addTab(
558 self::TAB_ID_EXPORT,
559 $DIC->language()->txt(self::TAB_ID_EXPORT),
560 $DIC->ctrl()->getLinkTargetByClass(ilCmiXapiExportGUI::class)
561 );
562 }
563
564 if ($this->cmixAccess->hasEditPermissionsAccess()) {
565 $DIC->tabs()->addTab(
566 self::TAB_ID_PERMISSIONS,
567 $DIC->language()->txt(self::TAB_ID_PERMISSIONS),
568 $DIC->ctrl()->getLinkTargetByClass(ilPermissionGUI::class, 'perm')
569 );
570 }
571
572 if (defined('DEVMODE') && DEVMODE) {
573 $DIC->tabs()->addTab(
574 'debug',
575 'DEBUG',
576 $DIC->ctrl()->getLinkTarget($this, 'debug')
577 );
578 }
579 }
Class ilObjectMetaDataGUI.

References $DIC.

◆ settings()

ilObjCmiXapiGUI::settings ( )
protected

Definition at line 490 of file class.ilObjCmiXapiGUI.php.

490 : void
491 {
492 $this->ctrl->redirectByClass(ilCmiXapiSettingsGUI::class, "show");
493 }

References ILIAS\Repository\ctrl().

+ Here is the call graph for this function:

◆ showSummary()

ilObjCmiXapiGUI::showSummary ( )
protected

Definition at line 495 of file class.ilObjCmiXapiGUI.php.

495 : void
496 {
497 $this->infoScreen();
498 }

References infoScreen().

+ Here is the call graph for this function:

◆ trackObjectReadEvent()

ilObjCmiXapiGUI::trackObjectReadEvent ( )
protected

Definition at line 631 of file class.ilObjCmiXapiGUI.php.

631 : void
632 {
633 global $DIC;
634 /* @var \ILIAS\DI\Container $DIC */
635
637 $this->object->getType(),
638 $this->object->getRefId(),
639 $this->object->getId(),
640 $DIC->user()->getId()
641 );
642 }
static _recordReadEvent(string $a_type, int $a_ref_id, int $obj_id, int $usr_id, $a_ext_rc=null, $a_ext_time=null)

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

+ Here is the call graph for this function:

Field Documentation

◆ $cmixAccess

ilCmiXapiAccess ilObjCmiXapiGUI::$cmixAccess
private

Definition at line 62 of file class.ilObjCmiXapiGUI.php.

◆ $lom_services

LOMServices ilObjCmiXapiGUI::$lom_services
private

Definition at line 63 of file class.ilObjCmiXapiGUI.php.

◆ CMD_FETCH_XAPI_STATEMENTS

const ilObjCmiXapiGUI::CMD_FETCH_XAPI_STATEMENTS = 'fetchXapiStatements'

Definition at line 56 of file class.ilObjCmiXapiGUI.php.

◆ CMD_INFO_SCREEN

◆ DEFAULT_CMD

const ilObjCmiXapiGUI::DEFAULT_CMD = self::CMD_INFO_SCREEN

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

◆ NEW_OBJ_TITLE

const ilObjCmiXapiGUI::NEW_OBJ_TITLE = ""

Definition at line 60 of file class.ilObjCmiXapiGUI.php.

◆ TAB_ID_EXPORT

const ilObjCmiXapiGUI::TAB_ID_EXPORT = 'tab_export'

Definition at line 52 of file class.ilObjCmiXapiGUI.php.

◆ TAB_ID_INFO

const ilObjCmiXapiGUI::TAB_ID_INFO = 'tab_info'

Definition at line 46 of file class.ilObjCmiXapiGUI.php.

◆ TAB_ID_LEARNING_PROGRESS

const ilObjCmiXapiGUI::TAB_ID_LEARNING_PROGRESS = 'learning_progress'

Definition at line 50 of file class.ilObjCmiXapiGUI.php.

◆ TAB_ID_METADATA

const ilObjCmiXapiGUI::TAB_ID_METADATA = 'tab_metadata'

Definition at line 51 of file class.ilObjCmiXapiGUI.php.

◆ TAB_ID_PERMISSIONS

const ilObjCmiXapiGUI::TAB_ID_PERMISSIONS = 'perm_settings'

Definition at line 53 of file class.ilObjCmiXapiGUI.php.

◆ TAB_ID_SCORING

const ilObjCmiXapiGUI::TAB_ID_SCORING = 'tab_scoring'

Definition at line 49 of file class.ilObjCmiXapiGUI.php.

◆ TAB_ID_SETTINGS

const ilObjCmiXapiGUI::TAB_ID_SETTINGS = 'tab_settings'

Definition at line 47 of file class.ilObjCmiXapiGUI.php.

Referenced by ilObjCmiXapiAccess\_getCommands().

◆ TAB_ID_STATEMENTS

const ilObjCmiXapiGUI::TAB_ID_STATEMENTS = 'tab_statements'

Definition at line 48 of file class.ilObjCmiXapiGUI.php.


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