ILIAS  release_10 Revision v10.1-43-ga1241a92c2f
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 ()
 
 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)
 
 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)
 
 initHeaderAction (?string $sub_type=null, ?int $sub_id=null)
 
 settings ()
 
 showSummary ()
 
 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...
 
 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 ()
 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
 
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
 
Refinery $refinery
 
ilFavouritesManager $favourites
 
ilObjectCustomIconFactory $custom_icon_factory
 
UIFactory $ui_factory
 
UIRenderer $ui_renderer
 
Filesystem $temp_file_system
 
ilObject $object = null
 
bool $creation_mode = false
 
 $data
 
int $id
 
bool $call_by_reference = false
 
bool $prepare_output
 
int $ref_id
 
int $obj_id
 
int $maxcount
 
array $form_action = []
 
array $return_location = []
 
array $target_frame = []
 
string $tmp_import_dir
 
string $sub_objects = ""
 
bool $omit_locator = false
 
string $type = ""
 
string $admin_mode = self::ADMIN_MODE_NONE
 
int $requested_ref_id = 0
 
int $requested_crtptrefid = 0
 
int $requested_crtcb = 0
 
string $requested_new_type = ""
 
string $link_params
 
string $html = ""
 

Detailed Description

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 
)

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

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

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)
global $DIC
Definition: shib_login.php:25
__construct(Container $dic, ilPlugin $plugin)
+ Here is the call graph for this function:

Member Function Documentation

◆ _goto()

static ilObjCmiXapiGUI::_goto ( string  $a_target)
static

Definition at line 320 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(), infoScreenForward(), 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().

320  : void
321  {
322  global $DIC;
323  $main_tpl = $DIC->ui()->mainTemplate();
324  /* @var \ILIAS\DI\Container $DIC */
325  $err = $DIC['ilErr'];
326  /* @var ilErrorHandling $err */
327  $ctrl = $DIC->ctrl();
328  $request = $DIC->http()->request();
329  $access = $DIC->access();
330  $lng = $DIC->language();
331 
332  $targetParameters = explode('_', $a_target);
333  $id = (int) $targetParameters[0];
334 
335  if ($id <= 0) {
336  $err->raiseError($lng->txt('msg_no_perm_read'), $err->FATAL);
337  }
338 
339  if ($access->checkAccess('read', '', $id)) {
340  $ctrl->setTargetScript('ilias.php');
341  $ctrl->setParameterByClass(ilObjCmiXapiGUI::class, 'ref_id', $id);
342  $ctrl->redirectByClass([ilRepositoryGUI::class, ilObjCmiXapiGUI::class]);
343  } elseif ($access->checkAccess('visible', '', $id)) {
344  ilObjectGUI::_gotoRepositoryNode($id, 'infoScreen');
345  } elseif ($access->checkAccess('read', '', ROOT_FOLDER_ID)) {
346  $main_tpl->setOnScreenMessage('info', sprintf(
347  $lng->txt('msg_no_perm_read_item'),
349  ), true);
350 
352  }
353 
354  $err->raiseError($lng->txt("msg_no_perm_read_lm"), $err->FATAL);
355  }
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)
static _lookupTitle(int $obj_id)
ServerRequestInterface $request
global $DIC
Definition: shib_login.php:25
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 618 of file class.ilObjCmiXapiGUI.php.

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

618  : void
619  {
620  global $DIC;
621  /* @var \ILIAS\DI\Container $DIC */
622 
623  $locator = $DIC['ilLocator'];
624  /* @var ilLocatorGUI $locator */
625  $locator->addItem(
626  $this->object->getTitle(),
627  $this->ctrl->getLinkTarget($this, self::DEFAULT_CMD),
628  "",
629  $DIC->http()->wrapper()->query()->retrieve("ref_id", $DIC->refinery()->kindlyTo()->int())
630  );
631  }
global $DIC
Definition: shib_login.php:25
ilLocatorGUI $locator
+ Here is the call graph for this function:

◆ afterSave()

ilObjCmiXapiGUI::afterSave ( ilObject  $newObject)
protected

Definition at line 205 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.

Referenced by save().

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

◆ buildReportFilter()

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

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

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

Referenced by getXapiStatementsReport().

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

◆ debug()

ilObjCmiXapiGUI::debug ( )
protected

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

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

Referenced by buildReportFilter().

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

◆ fetchXapiStatements()

ilObjCmiXapiGUI::fetchXapiStatements ( )
protected

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

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

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

◆ getPrivacyIdentString()

static ilObjCmiXapiGUI::getPrivacyIdentString ( int  $ident)
static

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

Referenced by ilObjLTIConsumerGUI\configureInfoScreen().

966  : string
967  {
968  switch ($ident) {
969  case 0:
970  return "il_uuid_user_id";
971  case 1:
972  return "il_uuid_ext_account";
973  case 2:
974  return "il_uuid_login";
975  case 3:
976  return "real_email";
977  case 4:
978  return "il_uuid_random";
979  case 5:
980  return "il_uuid_sha256";
981  case 6:
982  return "il_uuid_sha256url";
983  }
984  return '';
985  }
+ Here is the caller graph for this function:

◆ getPrivacyNameString()

static ilObjCmiXapiGUI::getPrivacyNameString ( int  $ident)
static

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

Referenced by ilObjLTIConsumerGUI\configureInfoScreen().

987  : string
988  {
989  switch ($ident) {
990  case 0:
991  return "none";
992  case 1:
993  return "firstname";
994  case 2:
995  return "lastname";
996  case 3:
997  return "fullname";
998  }
999  return '';
1000  }
+ Here is the caller graph for this function:

◆ getType()

ilObjCmiXapiGUI::getType ( )

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

Referenced by _goto().

79  : string
80  {
81  return 'cmix';
82  }
+ Here is the caller graph for this function:

◆ getXapiStatementsReport()

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

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

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

Referenced by fetchXapiStatements().

928  $filter = $this->buildReportFilter($since, $until);
929 
930  $linkBuilder = new ilCmiXapiStatementsReportLinkBuilder(
931  $this->object->getId(),
932  $this->object->getLrsType()->getLrsEndpointStatementsAggregationLink(),
933  $filter
934  );
935 
937  $this->object->getLrsType()->getBasicAuth(),
938  $linkBuilder
939  );
940 
941  return $request->queryReport($this->object->getId());
942  }
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 848 of file class.ilObjCmiXapiGUI.php.

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

Referenced by infoScreenForward().

848  : void
849  {
850  global $DIC;
851 
852  if ($this->object->getLrsType()->getAvailability() == ilCmiXapiLrsType::AVAILABILITY_NONE) {
853  $DIC->language()->loadLanguageModule('cmix');
854  $this->tpl->setOnScreenMessage('failure', $DIC->language()->txt('lrs_type_not_avail_msg'));
855  }
856  }
global $DIC
Definition: shib_login.php:25
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ infoScreen()

ilObjCmiXapiGUI::infoScreen ( )

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

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

Referenced by showSummary().

646  : void
647  {
648  global $DIC;
649 
650  $DIC->tabs()->activateTab(self::TAB_ID_INFO);
651  $this->ctrl->redirectByClass(ilInfoScreenGUI::class, 'showSummary');
652  }
global $DIC
Definition: shib_login.php:25
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ infoScreenForward()

ilObjCmiXapiGUI::infoScreenForward ( )

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

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

Referenced by _goto().

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

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  #$item->setValue($this->object->typedef->getTypeId());
124  #$item->setInfo($this->lng->txt('cmix_add_lrs_type_info'));
125  $form->addItem($item);
126 
127  $source = new ilRadioGroupInputGUI($this->lng->txt('cmix_add_source'), 'source_type');
128  $source->setRequired(true);
129 
130  $srcRemoteContent = new ilRadioOption($this->lng->txt('cmix_add_source_url'), 'resource');
131  $srcRemoteContent->setInfo($this->lng->txt('cmix_add_source_url_info'));
132  $source->addOption($srcRemoteContent);
133 
134  $srcUploadContent = new ilRadioOption($this->lng->txt('cmix_add_source_local_dir'), 'upload');
135  $srcUploadContent->setInfo($this->lng->txt('cmix_add_source_local_dir_info'));
136  $source->addOption($srcUploadContent);
137 
138  $srcUpload = new ilFileInputGUI($this->lng->txt("select_file"), "uploadfile");
139  $srcUpload->setAllowDeletion(false);
140  $srcUpload->setSuffixes(['zip', 'xml']);
141  $srcUpload->setRequired(true);
142  $srcUploadContent->addSubItem($srcUpload);
143 
145  $srcServerContent = new ilRadioOption($this->lng->txt('cmix_add_source_upload_dir'), 'server');
146  $srcServerContent->setInfo($this->lng->txt('cmix_add_source_upload_dir_info'));
147  $source->addOption($srcServerContent);
148 
149  $options = ['' => $this->lng->txt('cmix_add_source_upload_select')];
150 
151  foreach (ilUploadFiles::_getUploadFiles() as $file) {
152  $options[$file] = $file;
153  }
154 
155  $srcSelect = new ilSelectInputGUI($this->lng->txt("select_file"), "serverfile");
156  $srcSelect->setOptions($options);
157  $srcServerContent->addSubItem($srcSelect);
158  }
159 
160  $srcExternalApp = new ilRadioOption($this->lng->txt('cmix_add_source_external_app'), 'external');
161  $srcExternalApp->setInfo($this->lng->txt('cmix_add_source_external_app_info'));
162  $source->addOption($srcExternalApp);
163 
164  $form->addItem($source);
165 
166  $form->addCommandButton("save", $this->lng->txt($a_new_type . "_add"));
167  $form->addCommandButton("cancel", $this->lng->txt("cancel"));
168 
169  return $form;
170  }
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 288 of file class.ilObjCmiXapiGUI.php.

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

288  : ?ilObjectListGUI
289  {
290  $return = parent::initHeaderAction($sub_type, $sub_id);
291 
292  if ($this->creation_mode) {
293  return $return;
294  }
295 
296  $validator = new ilCertificateDownloadValidator();
297  if ($validator->isCertificateDownloadable((int) $this->user->getId(), $this->object->getId())) {
298  $certLink = $this->ctrl->getLinkTargetByClass(
299  [ilObjCmiXapiGUI::class, ilCmiXapiSettingsGUI::class],
301  );
302 
303  $this->lng->loadLanguageModule('certificate');
304 
305  $return->addCustomCommand($certLink, 'download_certificate');
306 
307  $return->addHeaderIcon(
308  'cert_icon',
309  ilUtil::getImagePath('standard/icon_cert.svg'),
310  $this->lng->txt('download_certificate'),
311  null,
312  null,
313  $certLink
314  );
315  }
316 
317  return $return;
318  }
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)
+ 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 750 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().

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

References ilObject\getId(), ilObject\getTitle(), and ilObject\getType().

Referenced by afterSave().

281  : void
282  {
283  $this->lom_services->derive()
284  ->fromBasicProperties($object->getTitle())
285  ->forObject($object->getId(), $object->getId(), $object->getType());
286  }
+ 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 858 of file class.ilObjCmiXapiGUI.php.

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

Referenced by initInfoScreenToolbar().

858  : bool
859  {
860  global $DIC;
861  if ($this->object->getLaunchMode() != ilObjCmiXapi::LAUNCH_MODE_NORMAL) {
862  return false;
863  }
864 
865  if ($this->object->isBypassProxyEnabled()) {
866  return true;
867  }
868 
869  if (!$cmixUser->hasProxySuccess()) {
870  return true;
871  }
872 
873  return false;
874  }
global $DIC
Definition: shib_login.php:25
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ save()

ilObjCmiXapiGUI::save ( )

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

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

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

◆ sendLastFetchInfo()

ilObjCmiXapiGUI::sendLastFetchInfo ( ilCmiXapiUser  $cmixUser)
protected

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

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

Referenced by initInfoScreenToolbar().

876  : void
877  {
878  global $DIC;
879  /* @var \ILIAS\DI\Container $DIC */
880 
881  if (!$cmixUser->getFetchUntil()->get(IL_CAL_UNIX)) {
882  $info = $DIC->language()->txt('xapi_statements_not_fetched_yet');
883  } else {
884  $info = $DIC->language()->txt('xapi_statements_last_fetch_date') . ' ' . ilDatePresentation::formatDate(
885  $cmixUser->getFetchUntil()
886  );
887  }
888 
889  $this->tpl->setOnScreenMessage('info', $info);
890  }
static formatDate(ilDateTime $date, bool $a_skip_day=false, bool $a_include_wd=false, bool $include_seconds=false, ilObjUser $user=null,)
const IL_CAL_UNIX
global $DIC
Definition: shib_login.php:25
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setTabs()

ilObjCmiXapiGUI::setTabs ( )
protected

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

References $DIC.

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

◆ settings()

ilObjCmiXapiGUI::settings ( )
protected

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

References ILIAS\Repository\ctrl().

492  : void
493  {
494  $this->ctrl->redirectByClass(ilCmiXapiSettingsGUI::class, "show");
495  }
+ Here is the call graph for this function:

◆ showSummary()

ilObjCmiXapiGUI::showSummary ( )
protected

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

References infoScreen().

497  : void
498  {
499  $this->infoScreen();
500  }
+ Here is the call graph for this function:

◆ trackObjectReadEvent()

ilObjCmiXapiGUI::trackObjectReadEvent ( )
protected

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

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

Referenced by _goto().

633  : void
634  {
635  global $DIC;
636  /* @var \ILIAS\DI\Container $DIC */
637 
639  $this->object->getType(),
640  $this->object->getRefId(),
641  $this->object->getId(),
642  $DIC->user()->getId()
643  );
644  }
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)
global $DIC
Definition: shib_login.php:25
+ 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 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: