ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
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 ()
 
 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)
 
 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 ()
 
 importFile ()
 
 putObjectInTree (ilObject $obj, int $parent_node_id=null)
 Add object to tree at given position. More...
 
- 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] 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)
 
 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)
 
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 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 Member Functions

 initCreateForm (string $a_new_type)
 
 afterSave (ilObject $newObject)
 
 initHeaderAction (?string $sub_type=null, ?int $sub_id=null)
 
 setTabs ()
 
 debug ()
 
 addLocatorItems ()
 
 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="")
 
 setTargetFrame (string $cmd, string $target_frame)
 
 getCenterColumnHTML ()
 
 getRightColumnHTML ()
 
 checkPermission (string $perm, string $cmd="", string $type="", int $ref_id=null)
 
 showPossibleSubObjects ()
 
 redirectToRefId (int $ref_id, string $cmd="")
 
 addAdminLocatorItems (bool $do_not_add_object=false)
 
 setTabs ()
 create tabs (repository/workspace switch) More...
 
 getReturnLocation (string $cmd, string $location="")
 Deprecated functions. More...
 
 setReturnLocation (string $cmd, string $location)
 
 showActions ()
 
 getTabs ()
 
 addLocatorItems ()
 Functions to be overwritten. More...
 
 initCreationForms (string $new_type)
 Init creation forms. 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...
 
 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...
 
 addAdoptContentLinkToToolbar ()
 
 addAvailabilityPeriodButtonToToolbar (ilToolbarGUI $toolbar)
 
 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 ()
 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...
 

Private Attributes

ilCmiXapiAccess $cmixAccess
 

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
 
ArrayBasedRequestWrapper $post_wrapper
 
RequestWrapper $request_wrapper
 
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
 
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
 
UIFactory $ui_factory
 
UIRenderer $ui_renderer
 
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 40 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 
)

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

References ILIAS\MetaData\Repository\Validation\Data\__construct(), ilCmiXapiAccess\getInstance(), and ILIAS\Repository\lng().

61  {
62  parent::__construct($a_id, $a_id_type, $a_parent_node_id);
63 
64  if ($this->object instanceof ilObjCmiXapi) {
65  $this->cmixAccess = ilCmiXapiAccess::getInstance($this->object);
66  }
67 
68  $this->lng->loadLanguageModule("cmix");
69  }
static getInstance(ilObjCmiXapi $object)
__construct(VocabulariesInterface $vocabularies)
+ Here is the call graph for this function:

Member Function Documentation

◆ _goto()

static ilObjCmiXapiGUI::_goto ( string  $a_target)
static

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

References ilObject2GUI\$access, ilObject2GUI\$ctrl, $DIC, ilObjectGUI\$id, ilObject2GUI\$lng, ilObjectGUI\$object, ilObjectGUI\$request, ilObjectGUI\_gotoRepositoryNode(), ilObjectGUI\_gotoRepositoryRoot(), ilObject\_lookupObjId(), ilObject\_lookupTitle(), ilObjectGUI\addHeaderAction(), ilRBACAccessHandler\checkAccess(), ILIAS\Repository\ctrl(), ilObject2GUI\executeCommand(), ilCommonActionDispatcherGUI\getInstanceFromAjaxCall(), getType(), ILIAS\Repository\int(), ilLearningProgressBaseGUI\LP_CONTEXT_REPOSITORY, ILIAS\Repository\object(), ilObject2GUI\prepareOutput(), ilCtrl\redirectByClass(), ROOT_FOLDER_ID, ilCtrl\setParameterByClass(), ilCtrl\setTargetScript(), trackObjectReadEvent(), and ilLanguage\txt().

290  : void
291  {
292  global $DIC;
293  $main_tpl = $DIC->ui()->mainTemplate();
294  /* @var \ILIAS\DI\Container $DIC */
295  $err = $DIC['ilErr'];
296  /* @var ilErrorHandling $err */
297  $ctrl = $DIC->ctrl();
298  $request = $DIC->http()->request();
299  $access = $DIC->access();
300  $lng = $DIC->language();
301 
302  $targetParameters = explode('_', $a_target);
303  $id = (int) $targetParameters[0];
304 
305  if ($id <= 0) {
306  $err->raiseError($lng->txt('msg_no_perm_read'), $err->FATAL);
307  }
308 
309  if ($access->checkAccess('read', '', $id)) {
310  $ctrl->setTargetScript('ilias.php');
311  $ctrl->setParameterByClass(ilObjCmiXapiGUI::class, 'ref_id', $id);
312  $ctrl->redirectByClass([ilRepositoryGUI::class, ilObjCmiXapiGUI::class]);
313  } elseif ($access->checkAccess('visible', '', $id)) {
314  ilObjectGUI::_gotoRepositoryNode($id, 'infoScreen');
315  } elseif ($access->checkAccess('read', '', ROOT_FOLDER_ID)) {
316  $main_tpl->setOnScreenMessage('info', sprintf(
317  $lng->txt('msg_no_perm_read_item'),
319  ), true);
320 
322  }
323 
324  $err->raiseError($lng->txt("msg_no_perm_read_lm"), $err->FATAL);
325  }
redirectByClass( $a_class, string $a_cmd=null, string $a_anchor=null, bool $is_async=false)
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
const ROOT_FOLDER_ID
Definition: constants.php:32
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) ...
static _gotoRepositoryNode(int $ref_id, string $cmd="")
setParameterByClass(string $a_class, string $a_parameter, $a_value)
static _lookupObjId(int $ref_id)
global $DIC
Definition: feed.php:28
static _lookupTitle(int $obj_id)
ServerRequestInterface $request
setTargetScript(string $a_target_script)
static _gotoRepositoryRoot(bool $raise_error=false)
Goto repository root.
ilAccessHandler $access
+ Here is the call graph for this function:

◆ addLocatorItems()

ilObjCmiXapiGUI::addLocatorItems ( )
protected

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

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

576  : void
577  {
578  global $DIC;
579  /* @var \ILIAS\DI\Container $DIC */
580 
581  $locator = $DIC['ilLocator'];
582  /* @var ilLocatorGUI $locator */
583  $locator->addItem(
584  $this->object->getTitle(),
585  $this->ctrl->getLinkTarget($this, self::DEFAULT_CMD),
586  "",
587  $DIC->http()->wrapper()->query()->retrieve("ref_id", $DIC->refinery()->kindlyTo()->int())
588  );
589  }
global $DIC
Definition: feed.php:28
addItem(string $a_title, string $a_link, string $a_frame="", int $a_ref_id=0, ?string $type=null)
ilLocatorGUI $locator
+ Here is the call graph for this function:

◆ afterSave()

ilObjCmiXapiGUI::afterSave ( ilObject  $newObject)
protected

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

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.

163  : void
164  {
165  /* @var ilObjCmiXapi $newObject */
166  $form = $this->initCreateForm($newObject->getType());
167 
168  if ($form->checkInput()) {
169  $newObject->setContentType($form->getInput('content_type'));
170 
171  $newObject->setLrsTypeId((int) $form->getInput('lrs_type_id'));
172  $newObject->initLrsType();
173 
174  $newObject->setPrivacyIdent($newObject->getLrsType()->getPrivacyIdent());
175  $newObject->setPrivacyName($newObject->getLrsType()->getPrivacyName());
176 
177  switch ($form->getInput('source_type')) {
178  case 'resource': // remote resource
179 
180  $newObject->setTitle($form->getInput('title'));
181  $newObject->setSourceType(ilObjCmiXapi::SRC_TYPE_REMOTE);
182  break;
183 
184  case 'upload': // upload from local client
185 
186  try {
187  $uploadImporter = new ilCmiXapiContentUploadImporter($newObject);
188  $uploadImporter->importFormUpload((array) $form->getInput('uploadfile'));
189 
190  $newObject->setSourceType(ilObjCmiXapi::SRC_TYPE_LOCAL);
192  $form->getItemByPostVar('uploadfile')->setAlert($e->getMessage());
193  $this->tpl->setOnScreenMessage('failure', 'something went wrong!', true);
194  $this->ctrl->redirectByClass(self::class, 'create');
195  }
196 
197  break;
198 
199  case 'server': // from upload directory
200 
202  throw new ilCmiXapiException('access denied!');
203  }
204 
205  $serverFile = $form->getInput('serverfile');
206 
207  if (!ilUploadFiles::_checkUploadFile($serverFile)) {
208  throw new ilCmiXapiException($this->lng->txt('upload_error_file_not_found'));
209  }
210 
211  $uploadImporter = new ilCmiXapiContentUploadImporter($newObject);
212 
213  $uploadImporter->importServerFile(implode(DIRECTORY_SEPARATOR, [
215  $serverFile
216  ]));
217 
218  $newObject->setSourceType(ilObjCmiXapi::SRC_TYPE_LOCAL);
219 
220  break;
221 
222  case 'external':
223 
224  $newObject->setSourceType(ilObjCmiXapi::SRC_TYPE_EXTERNAL);
225  $newObject->setBypassProxyEnabled(true);
226  break;
227  }
228 
229  $newObject->save();
230 
231  $this->initMetadata($newObject);
232 
233  $this->ctrl->redirectByClass(ilCmiXapiSettingsGUI::class);
234  }
235 
236  throw new ilCmiXapiException('invalid creation form submit!');
237  }
static _getUploadDirectory()
setTitle(string $title)
initMetadata(ilObjCmiXapi $object)
initCreateForm(string $a_new_type)
static _checkUploadFile(string $a_file)
+ Here is the call graph for this function:

◆ buildReportFilter()

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

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

References $DIC, debug(), ilLoggerFactory\getLogger(), IL_CAL_DATETIME, and ILIAS\Repository\object().

Referenced by getXapiStatementsReport().

910  global $DIC;
911  /* @var \ILIAS\DI\Container $DIC */
912 
913  $filter = new ilCmiXapiStatementsReportFilter();
914 
915  $filter->setActor(new ilCmiXapiUser($this->object->getId(), $DIC->user()->getId()));
916  $filter->setActivityId($this->object->getActivityId());
917 
918  $filter->setStartDate($since);
919  $filter->setEndDate($until);
920 
921  $start = $filter->getStartDate()->get(IL_CAL_DATETIME);
922  $end = $filter->getEndDate()->get(IL_CAL_DATETIME);
923  ilLoggerFactory::getLogger($this->object->getType())->debug("use filter from ($start) until ($end)");
924 
925  return $filter;
926  }
const IL_CAL_DATETIME
static getLogger(string $a_component_id)
Get component logger.
global $DIC
Definition: feed.php:28
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ debug()

ilObjCmiXapiGUI::debug ( )
protected

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

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

Referenced by buildReportFilter().

541  : void
542  {
543  global $DIC;
544  /* @var \ILIAS\DI\Container $DIC */
545 
546  $DIC->tabs()->activateTab('debug');
547 
548  $filter = new ilCmiXapiStatementsReportFilter();
549  $filter->setActivityId($this->object->getActivityId());
550 
551  $linkBuilder = new ilCmiXapiHighscoreReportLinkBuilder(
552  $this->object->getId(),
553  $this->object->getLrsType()->getLrsEndpointStatementsAggregationLink(),
554  $filter
555  );
556 
558  $this->object->getLrsType()->getBasicAuth(),
559  $linkBuilder
560  );
561 
562  try {
563  $report = $request->queryReport($this->object->getId());
564 
565  $DIC->ui()->mainTemplate()->setContent(
566  $report->getResponseDebug()
567  );
568  //ilUtil::sendSuccess('Object ID: '.$this->object->getId());
569  $this->tpl->setOnScreenMessage('info', $linkBuilder->getPipelineDebug());
570  $this->tpl->setOnScreenMessage('question', '<pre>' . print_r($report->getTableData(), true) . '</pre>');
571  } catch (Exception $e) {
572  $this->tpl->setOnScreenMessage('failure', $e->getMessage());
573  }
574  }
global $DIC
Definition: feed.php:28
ServerRequestInterface $request
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fetchXapiStatements()

ilObjCmiXapiGUI::fetchXapiStatements ( )
protected

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

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

854  : void
855  {
856  global $DIC;
857  /* @var \ILIAS\DI\Container $DIC */
858  $logger = ilLoggerFactory::getLogger($this->object->getType());
859 
860  if ($this->object->getLaunchMode() != ilObjCmiXapi::LAUNCH_MODE_NORMAL) {
861  throw new ilCmiXapiException('access denied!');
862  }
863 
864  $cmixUser = new ilCmiXapiUser($this->object->getId(), $DIC->user()->getId(), $this->object->getPrivacyIdent());
865 
866  $fetchedUntil = $cmixUser->getFetchUntil();
867  $now = new ilCmiXapiDateTime(time(), IL_CAL_UNIX);
868 
869  $report = $this->getXapiStatementsReport($fetchedUntil, $now);
870 
871  if ($report->hasStatements()) {
872  $evaluation = new ilXapiStatementEvaluation($logger, $this->object);
873  $evaluation->evaluateReport($report);
874 
875  //$logger->debug('update lp for object (' . $this->object->getId() . ')');
876  //ilLPStatusWrapper::_updateStatus($this->object->getId(), $DIC->user()->getId());
877  }
878 
879  $cmixUser->setFetchUntil($now);
880  $cmixUser->save();
881 
882  $this->tpl->setOnScreenMessage('success', $DIC->language()->txt('xapi_statements_fetched_successfully'), true);
883  $DIC->ctrl()->redirect($this, self::CMD_INFO_SCREEN);
884  }
static getLogger(string $a_component_id)
Get component logger.
const IL_CAL_UNIX
global $DIC
Definition: feed.php:28
getXapiStatementsReport(ilCmiXapiDateTime $since, ilCmiXapiDateTime $until)
+ Here is the call graph for this function:

◆ getPrivacyIdentString()

static ilObjCmiXapiGUI::getPrivacyIdentString ( int  $ident)
static

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

Referenced by ilObjLTIConsumerGUI\infoScreenForward().

928  : string
929  {
930  switch ($ident) {
931  case 0:
932  return "il_uuid_user_id";
933  case 1:
934  return "il_uuid_ext_account";
935  case 2:
936  return "il_uuid_login";
937  case 3:
938  return "real_email";
939  case 4:
940  return "il_uuid_random";
941  case 5:
942  return "il_uuid_sha256";
943  case 6:
944  return "il_uuid_sha256url";
945  }
946  return '';
947  }
+ Here is the caller graph for this function:

◆ getPrivacyNameString()

static ilObjCmiXapiGUI::getPrivacyNameString ( int  $ident)
static

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

Referenced by ilObjLTIConsumerGUI\infoScreenForward().

949  : string
950  {
951  switch ($ident) {
952  case 0:
953  return "none";
954  case 1:
955  return "firstname";
956  case 2:
957  return "lastname";
958  case 3:
959  return "fullname";
960  }
961  return '';
962  }
+ Here is the caller graph for this function:

◆ getType()

ilObjCmiXapiGUI::getType ( )

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

Referenced by _goto().

71  : string
72  {
73  return 'cmix';
74  }
+ Here is the caller graph for this function:

◆ getXapiStatementsReport()

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

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

References ilObjectGUI\$request, buildReportFilter(), and ILIAS\Repository\object().

Referenced by fetchXapiStatements().

890  $filter = $this->buildReportFilter($since, $until);
891 
892  $linkBuilder = new ilCmiXapiStatementsReportLinkBuilder(
893  $this->object->getId(),
894  $this->object->getLrsType()->getLrsEndpointStatementsAggregationLink(),
895  $filter
896  );
897 
899  $this->object->getLrsType()->getBasicAuth(),
900  $linkBuilder
901  );
902 
903  return $request->queryReport($this->object->getId());
904  }
buildReportFilter(ilCmiXapiDateTime $since, ilCmiXapiDateTime $until)
ServerRequestInterface $request
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ handleAvailablityMessage()

ilObjCmiXapiGUI::handleAvailablityMessage ( )
protected

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

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

Referenced by infoScreenForward().

810  : void
811  {
812  global $DIC;
813  /* @var \ILIAS\DI\Container $DIC */
814 
815  if ($this->object->getLrsType()->getAvailability() == ilCmiXapiLrsType::AVAILABILITY_NONE) {
816  $this->tpl->setOnScreenMessage('failure', $DIC->language()->txt('cmix_lrstype_not_avail_msg'));
817  }
818  }
global $DIC
Definition: feed.php:28
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ infoScreen()

ilObjCmiXapiGUI::infoScreen ( )

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

References $DIC, and infoScreenForward().

604  : void
605  {
606  global $DIC;
607  /* @var \ILIAS\DI\Container $DIC */
608 
609  $DIC->tabs()->activateTab(self::TAB_ID_INFO);
610 
611  $DIC->ctrl()->setCmd("showSummary");
612  $DIC->ctrl()->setCmdClass("ilinfoscreengui");
613  $this->infoScreenForward();
614  }
global $DIC
Definition: feed.php:28
+ Here is the call graph for this function:

◆ infoScreenForward()

ilObjCmiXapiGUI::infoScreenForward ( )

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

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

Referenced by infoScreen().

616  : void
617  {
618  global $DIC;
619  /* @var \ILIAS\DI\Container $DIC */
620  $ilErr = $DIC['ilErr'];
621  /* @var ilErrorHandling $ilErr */
622 
623  if (!$this->checkPermissionBool("visible") && !$this->checkPermissionBool("read")) {
624  $ilErr->raiseError($DIC->language()->txt("msg_no_perm_read"), $ilErr->MESSAGE);
625  }
626 
627  $this->handleAvailablityMessage();
628  $this->initInfoScreenToolbar();
629 
630  $info = new ilInfoScreenGUI($this);
631 
632  $info->enablePrivateNotes();
633 
634  if ($this->checkPermissionBool("read")) {
635  $info->enableNews();
636  }
637 
638  $info->enableNewsEditing(false);
639 
640  if ($this->checkPermissionBool("write")) {
641  $news_set = new ilSetting("news");
642  $enable_internal_rss = $news_set->get("enable_rss_for_internal");
643 
644  if ($enable_internal_rss) {
645  $info->setBlockProperty("news", "settings", (string) true);
646  $info->setBlockProperty("news", "public_notifications_option", (string) true);
647  }
648  }
649 
650  if (DEVMODE) {
651  // Development Info
652  $info->addSection('DEVMODE Info');
653  $info->addProperty('Local Object ID', (string) $this->object->getId());
654  $info->addProperty('Current User ID', (string) $DIC->user()->getId());
655  }
656 
657  // standard meta data
658  $info->addMetaDataSections($this->object->getId(), 0, $this->object->getType());
659 
660  // Info about privacy
661  if ($this->object->isSourceTypeExternal()) {
662  $info->addSection($DIC->language()->txt("cmix_info_privacy_section"));
663  } else {
664  $info->addSection($DIC->language()->txt("cmix_info_privacy_section_launch"));
665  }
666 
667  $info->addProperty($DIC->language()->txt('cmix_lrs_type'), $this->object->getLrsType()->getTitle());
668 
669  if ($this->object->isSourceTypeExternal()) {
670  $cmixUser = new ilCmiXapiUser(
671  $this->object->getId(),
672  $DIC->user()->getId(),
673  $this->object->getPrivacyIdent()
674  );
675  if ($cmixUser->getUsrIdent()) {
676  $info->addProperty(
677  $DIC->language()->txt("conf_user_registered_mail"),
678  $cmixUser->getUsrIdent()
679  );
680  }
681  } else {
682  $info->addProperty(
683  $DIC->language()->txt("conf_privacy_name"),
684  $DIC->language()->txt('conf_privacy_name_' . self::getPrivacyNameString($this->object->getPrivacyName()))
685  );
686 
687  $info->addProperty(
688  $DIC->language()->txt("conf_privacy_ident"),
689  $DIC->language()->txt('conf_privacy_ident_' . self::getPrivacyIdentString($this->object->getPrivacyIdent()))
690  );
691  }
692 
693  if ($this->object->getLrsType()->getExternalLrs()) {
694  $info->addProperty(
695  $DIC->language()->txt("cmix_info_external_lrs_label"),
696  $DIC->language()->txt('cmix_info_external_lrs_info')
697  );
698  }
699 
700  if (strlen($this->object->getLrsType()->getPrivacyCommentDefault())) {
701  $info->addProperty(
702  $DIC->language()->txt("cmix_indication_to_user"),
703  nl2br($this->object->getLrsType()->getPrivacyCommentDefault())
704  );
705  }
706 
707  // FINISHED INFO SCREEN, NOW FORWARD
708 
709  $this->ctrl->forwardCommand($info);
710  }
Class ilInfoScreenGUI.
$ilErr
Definition: raiseError.php:17
global $DIC
Definition: feed.php:28
checkPermissionBool(string $perm, string $cmd="", string $type="", ?int $node_id=null)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initCreateForm()

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

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

References ilObject2GUI\$type, ilUploadFiles\_getUploadDirectory(), ilUploadFiles\_getUploadFiles(), ilCmiXapiLrsType\AVAILABILITY_CREATE, ilObjCmiXapi\CONT_TYPE_CMI5, ilObjCmiXapi\CONT_TYPE_GENERIC, ILIAS\Repository\ctrl(), ilCmiXapiLrsTypeList\getTypesData(), ilObjectGUI\initDidacticTemplate(), ILIAS\Repository\lng(), ilFileInputGUI\setAllowDeletion(), ilRadioOption\setInfo(), ilSelectInputGUI\setOptions(), and ilFormPropertyGUI\setRequired().

Referenced by afterSave().

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

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

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

258  : ?ilObjectListGUI
259  {
260  $return = parent::initHeaderAction($sub_type, $sub_id);
261 
262  if ($this->creation_mode) {
263  return $return;
264  }
265 
266  $validator = new ilCertificateDownloadValidator();
267  if ($validator->isCertificateDownloadable((int) $this->user->getId(), $this->object->getId())) {
268  $certLink = $this->ctrl->getLinkTargetByClass(
269  [ilObjCmiXapiGUI::class, ilCmiXapiSettingsGUI::class],
271  );
272 
273  $this->lng->loadLanguageModule('certificate');
274 
275  $return->addCustomCommand($certLink, 'download_certificate');
276 
277  $return->addHeaderIcon(
278  'cert_icon',
279  ilUtil::getImagePath('standard/icon_cert.svg'),
280  $this->lng->txt('download_certificate'),
281  null,
282  null,
283  $certLink
284  );
285  }
286 
287  return $return;
288  }
static getImagePath(string $img, string $module_path="", string $mode="output", bool $offline=false)
get image path (for images located in a template directory)
Validates if an active certificate is stored in the database and can be downloaded by the user...
+ 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 712 of file class.ilObjCmiXapiGUI.php.

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

Referenced by infoScreenForward().

712  : void
713  {
714  global $DIC;
715  /* @var \ILIAS\DI\Container $DIC */
716 
717  if (!$this->object->getOfflineStatus() && $this->object->getLrsType()->isAvailable() && $this->checkPermissionBool("read")) {
718  // TODO : check if this is the correct query
719  // p.e. switched to another privacyIdent before: user exists but not with the new privacyIdent
720  // re_check for isSourceTypeExternal
721  //$cmixUserExists = ilCmiXapiUser::exists($this->object->getId(), $DIC->user()->getId());
722 
723  if ($this->object->isSourceTypeExternal()) {
724  $extCmiUserExists = ilCmiXapiUser::exists($this->object->getId(), $DIC->user()->getId());
725  // $registerButton = ilLinkButton::getInstance();
726  //
727  // if ($extCmiUserExists) {
728  // $registerButton->setCaption('change_registration');
729  // } else {
730  // $registerButton->setPrimary(true);
731  // $registerButton->setCaption('create_registration');
732  // }
733  //
734  // $registerButton->setUrl($DIC->ctrl()->getLinkTargetByClass(
735  // ilCmiXapiRegistrationGUI::class
736  // ));
737  //
738  // $DIC->toolbar()->addButtonInstance($registerButton);
739 
740  if ($extCmiUserExists) {
741  $label = $this->lng->txt('change_registration');
742  } else {
743  // $registerButton->setPrimary(true);
744  $label = $this->lng->txt('create_registration');
745  }
746  $button = $DIC->ui()->factory()->button()->primary(
747  $label,
748  $DIC->ctrl()->getLinkTargetByClass(ilCmiXapiRegistrationGUI::class)
749  );
750  $DIC->toolbar()->addComponent($button);
751  } else {
752  $launchButton = ilLinkButton::getInstance();
753  $launchButton->setPrimary(true);
754  $launchButton->setCaption('launch');
755 
756  if ($this->object->getLaunchMethod() == ilObjCmiXapi::LAUNCH_METHOD_NEW_WIN) {
757  $launchButton->setTarget('_blank');
758  }
759 
760  $launchButton->setUrl($DIC->ctrl()->getLinkTargetByClass(
761  ilCmiXapiLaunchGUI::class
762  ));
763 
764  $DIC->toolbar()->addButtonInstance($launchButton);
765 
766  //todo
767  // if ($this->object->getLaunchMethod() == ilObjCmiXapi::LAUNCH_METHOD_NEW_WIN) {
768  // setTarget('_blank');
769  // }
770  // $button = $DIC->ui()->factory()->button()->primary(
771  // $this->lng->txt('launch'),
772  // $DIC->ctrl()->getLinkTargetByClass(ilCmiXapiLaunchGUI::class)
773  // );
774  // $DIC->toolbar()->addComponent($button);
775  }
776 
782  $cmiUserExists = ilCmiXapiUser::exists(
783  $this->object->getId(),
784  $DIC->user()->getId(),
785  $this->object->getPrivacyIdent()
786  );
787 
788  if ($cmiUserExists) {
789  $cmixUser = new ilCmiXapiUser(
790  $this->object->getId(),
791  $DIC->user()->getId(),
792  $this->object->getPrivacyIdent()
793  );
794 
795  if ($this->isFetchXapiStatementsRequired($cmixUser)) {
796  $button = $DIC->ui()->factory()->button()->primary(
797  $this->lng->txt('fetch_xapi_statements'),
798  $DIC->ctrl()->getLinkTarget(
799  $this,
800  self::CMD_FETCH_XAPI_STATEMENTS
801  )
802  );
803  $DIC->toolbar()->addComponent($button);
804  $this->sendLastFetchInfo($cmixUser);
805  }
806  }
807  }
808  }
static exists(int $objId, int $usrId, int $privacyIdent=999)
global $DIC
Definition: feed.php:28
checkPermissionBool(string $perm, string $cmd="", string $type="", ?int $node_id=null)
isFetchXapiStatementsRequired(ilCmiXapiUser $cmixUser)
sendLastFetchInfo(ilCmiXapiUser $cmixUser)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initMetadata()

ilObjCmiXapiGUI::initMetadata ( ilObjCmiXapi  $object)

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

References ilObjectGUI\$id, ilMD\addGeneral(), ilMD\getGeneral(), ilObject\getId(), ilObject\getTitle(), ilObject\getType(), and ilMDBase\save().

Referenced by afterSave().

239  : void
240  {
241  $metadata = new ilMD($object->getId(), $object->getId(), $object->getType());
242 
243  $generalMetadata = $metadata->getGeneral();
244 
245  if (!$generalMetadata) {
246  $generalMetadata = $metadata->addGeneral();
247  }
248 
249  $generalMetadata->setTitle($object->getTitle());
250  $generalMetadata->save();
251 
252  $id = $generalMetadata->addIdentifier();
253  $id->setCatalog('ILIAS');
254  $id->setEntry('il__' . $object->getType() . '_' . $object->getId());
255  $id->save();
256  }
addGeneral()
Definition: class.ilMD.php:44
getGeneral()
Definition: class.ilMD.php:34
+ 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 820 of file class.ilObjCmiXapiGUI.php.

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

Referenced by initInfoScreenToolbar().

820  : bool
821  {
822  global $DIC;
823  if ($this->object->getLaunchMode() != ilObjCmiXapi::LAUNCH_MODE_NORMAL) {
824  return false;
825  }
826 
827  if ($this->object->isBypassProxyEnabled()) {
828  return true;
829  }
830 
831  if (!$cmixUser->hasProxySuccess()) {
832  return true;
833  }
834 
835  return false;
836  }
global $DIC
Definition: feed.php:28
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ sendLastFetchInfo()

ilObjCmiXapiGUI::sendLastFetchInfo ( ilCmiXapiUser  $cmixUser)
protected

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

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

Referenced by initInfoScreenToolbar().

838  : void
839  {
840  global $DIC;
841  /* @var \ILIAS\DI\Container $DIC */
842 
843  if (!$cmixUser->getFetchUntil()->get(IL_CAL_UNIX)) {
844  $info = $DIC->language()->txt('xapi_statements_not_fetched_yet');
845  } else {
846  $info = $DIC->language()->txt('xapi_statements_last_fetch_date') . ' ' . ilDatePresentation::formatDate(
847  $cmixUser->getFetchUntil()
848  );
849  }
850 
851  $this->tpl->setOnScreenMessage('info', $info);
852  }
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false)
const IL_CAL_UNIX
global $DIC
Definition: feed.php:28
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setTabs()

ilObjCmiXapiGUI::setTabs ( )
protected

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

References $DIC.

460  : void
461  {
462  global $DIC;
463  /* @var \ILIAS\DI\Container $DIC */
464 
465  $DIC->tabs()->addTab(
466  self::TAB_ID_INFO,
467  $DIC->language()->txt(self::TAB_ID_INFO),
468  $DIC->ctrl()->getLinkTargetByClass(self::class)
469  );
470 
471  if ($this->cmixAccess->hasWriteAccess()) {
472  $DIC->tabs()->addTab(
473  self::TAB_ID_SETTINGS,
474  $DIC->language()->txt(self::TAB_ID_SETTINGS),
475  $DIC->ctrl()->getLinkTargetByClass(ilCmiXapiSettingsGUI::class)
476  );
477  }
478 
479  if ($this->cmixAccess->hasStatementsAccess()) {
480  $DIC->tabs()->addTab(
481  self::TAB_ID_STATEMENTS,
482  $DIC->language()->txt(self::TAB_ID_STATEMENTS),
483  $DIC->ctrl()->getLinkTargetByClass(ilCmiXapiStatementsGUI::class)
484  );
485  }
486 
487  if ($this->cmixAccess->hasHighscoreAccess()) {
488  $DIC->tabs()->addTab(
489  self::TAB_ID_SCORING,
490  $DIC->language()->txt(self::TAB_ID_SCORING),
491  $DIC->ctrl()->getLinkTargetByClass(ilCmiXapiScoringGUI::class)
492  );
493  }
494 
495  if ($this->cmixAccess->hasLearningProgressAccess()) {
496  $DIC->tabs()->addTab(
497  self::TAB_ID_LEARNING_PROGRESS,
498  $DIC->language()->txt(self::TAB_ID_LEARNING_PROGRESS),
499  $DIC->ctrl()->getLinkTargetByClass(ilLearningProgressGUI::class)
500  );
501  }
502 
503  if ($this->cmixAccess->hasWriteAccess()) {
504  $gui = new ilObjectMetaDataGUI($this->object);
505  $link = $gui->getTab();
506 
507  if (strlen($link)) {
508  $DIC->tabs()->addTab(
509  self::TAB_ID_METADATA,
510  $DIC->language()->txt('meta_data'),
511  $link
512  );
513  }
514  }
515 
516  if ($this->cmixAccess->hasWriteAccess()) {
517  $DIC->tabs()->addTab(
518  self::TAB_ID_EXPORT,
519  $DIC->language()->txt(self::TAB_ID_EXPORT),
520  $DIC->ctrl()->getLinkTargetByClass(ilCmiXapiExportGUI::class)
521  );
522  }
523 
524  if ($this->cmixAccess->hasEditPermissionsAccess()) {
525  $DIC->tabs()->addTab(
526  self::TAB_ID_PERMISSIONS,
527  $DIC->language()->txt(self::TAB_ID_PERMISSIONS),
528  $DIC->ctrl()->getLinkTargetByClass(ilPermissionGUI::class, 'perm')
529  );
530  }
531 
532  if (defined('DEVMODE') && DEVMODE) {
533  $DIC->tabs()->addTab(
534  'debug',
535  'DEBUG',
536  $DIC->ctrl()->getLinkTarget($this, 'debug')
537  );
538  }
539  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
global $DIC
Definition: feed.php:28

◆ trackObjectReadEvent()

ilObjCmiXapiGUI::trackObjectReadEvent ( )
protected

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

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

Referenced by _goto().

591  : void
592  {
593  global $DIC;
594  /* @var \ILIAS\DI\Container $DIC */
595 
597  $this->object->getType(),
598  $this->object->getRefId(),
599  $this->object->getId(),
600  $DIC->user()->getId()
601  );
602  }
global $DIC
Definition: feed.php:28
static _recordReadEvent(string $a_type, int $a_ref_id, int $obj_id, int $usr_id, bool $isCatchupWriteEvents=true, $a_ext_rc=null, $a_ext_time=null)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $cmixAccess

ilCmiXapiAccess ilObjCmiXapiGUI::$cmixAccess
private

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

◆ CMD_FETCH_XAPI_STATEMENTS

const ilObjCmiXapiGUI::CMD_FETCH_XAPI_STATEMENTS = 'fetchXapiStatements'

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

◆ CMD_INFO_SCREEN

◆ DEFAULT_CMD

const ilObjCmiXapiGUI::DEFAULT_CMD = self::CMD_INFO_SCREEN

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

◆ NEW_OBJ_TITLE

const ilObjCmiXapiGUI::NEW_OBJ_TITLE = ""

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

◆ TAB_ID_EXPORT

const ilObjCmiXapiGUI::TAB_ID_EXPORT = 'tab_export'

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

◆ TAB_ID_INFO

const ilObjCmiXapiGUI::TAB_ID_INFO = 'tab_info'

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

◆ TAB_ID_LEARNING_PROGRESS

const ilObjCmiXapiGUI::TAB_ID_LEARNING_PROGRESS = 'learning_progress'

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

◆ TAB_ID_METADATA

const ilObjCmiXapiGUI::TAB_ID_METADATA = 'tab_metadata'

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

◆ TAB_ID_PERMISSIONS

const ilObjCmiXapiGUI::TAB_ID_PERMISSIONS = 'perm_settings'

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

◆ TAB_ID_SCORING

const ilObjCmiXapiGUI::TAB_ID_SCORING = 'tab_scoring'

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

◆ TAB_ID_SETTINGS

const ilObjCmiXapiGUI::TAB_ID_SETTINGS = 'tab_settings'

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

Referenced by ilObjCmiXapiAccess\_getCommands().

◆ TAB_ID_STATEMENTS

const ilObjCmiXapiGUI::TAB_ID_STATEMENTS = 'tab_statements'

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


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