ILIAS  release_7 Revision v7.30-3-g800a261c036
All Data Structures Namespaces Files Functions Variables Modules Pages
ilObjCmiXapiGUI Class Reference
+ Inheritance diagram for ilObjCmiXapiGUI:
+ Collaboration diagram for ilObjCmiXapiGUI:

Public Member Functions

 __construct ($a_id=0, $a_id_type=self::REPOSITORY_NODE_ID, $a_parent_node_id=0)
 
 getType ()
 
 initMetadata (ilObjCmiXapi $object)
 
 executeCommand ()
 
 addLocatorItems ()
 
 infoScreen ()
 
 infoScreenForward ()
 
- Public Member Functions inherited from ilObject2GUI
 __construct ($a_id=0, $a_id_type=self::REPOSITORY_NODE_ID, $a_parent_node_id=0)
 Constructor. More...
 
 executeCommand ()
 execute command More...
 
 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 ($a_mode=true)
 
 getCreationMode ()
 
 prepareOutput ($a_show_subobjects=true)
 
 isVisible ($a_ref_id, $a_type)
 
 trash ()
 
 undelete ()
 
 cancelDelete ()
 
 removeFromSystem ()
 
 cloneAll ()
 
 view ()
 view object content (repository/workspace switch) More...
 
 getType ()
 Functions that must be overwritten. More...
 
 create ()
 Deleted in ilObject. More...
 
 save ()
 
 edit ()
 
 update ()
 
 cancel ()
 
 importFile ()
 Import. More...
 
 putObjectInTree (ilObject $a_obj, $a_parent_node_id=null)
 Add object to tree at given position. More...
 
- Public Member Functions inherited from ilObjectGUI
 executeCommand ()
 execute command More...
 
 withReferences ()
 determines wether objects are referenced or not (got ref ids or not) More...
 
 setCreationMode ($a_mode=true)
 if true, a creation screen is displayed the current $_GET[ref_id] don't belong to the current class! the mode is determined in ilrepositorygui More...
 
 getCreationMode ()
 get creation mode More...
 
 prepareOutput ($a_show_subobjects=true)
 prepare output More...
 
 getAdminTabs ()
 administration tabs show only permissions and trash folder More...
 
 getHTML ()
 
 confirmedDeleteObject ()
 confirmed deletion of object -> objects are moved to trash or deleted immediately, if trash is disabled More...
 
 cancelDeleteObject ()
 cancel deletion of object More...
 
 cancelObject ()
 cancel action and go back to previous page public More...
 
 createObject ()
 create new object form More...
 
 cancelCreation ()
 cancel create action and go back to repository parent More...
 
 saveObject ()
 save object More...
 
 getDidacticTemplateVar ($a_type)
 Get didactic template setting from creation screen. More...
 
 putObjectInTree (ilObject $a_obj, $a_parent_node_id=null)
 Add object to tree at given position. More...
 
 editObject ()
 edit object More...
 
 addExternalEditFormCustom (ilPropertyFormGUI $a_form)
 
 updateObject ()
 updates object entry in object_data More...
 
 getFormAction ($a_cmd, $a_formaction="")
 get form action for command (command is method name without "Object", e.g. More...
 
 isVisible ($a_ref_id, $a_type)
 
 viewObject ()
 viewObject container presentation for "administration -> repository, trash, permissions" More...
 
 deleteObject ($a_error=false)
 Display deletion confirmation screen. More...
 
 cloneAllObject ()
 Clone single (not container object) Method is overwritten in ilContainerGUI. More...
 
 redirectAfterCreation ()
 Redirect after creation, see https://docu.ilias.de/goto_docu_wiki_wpage_5035_1357.html. More...
 
 addToDeskObject ()
 
 removeFromDeskObject ()
 
- Public Member Functions inherited from ILIAS\Object\ImplementsCreationCallback
 callCreationCallback (\ilObject $object, \ilObjectDefinition $obj_definition, int $requested_crtcb)
 

Static Public Member Functions

static _goto ($a_target)
 
static getPrivacyIdentString (int $ident)
 
static getPrivacyNameString (int $ident)
 
- Static Public Member Functions inherited from ilObject2GUI
static handleAfterSaveCallback (ilObject $a_obj, $a_callback_ref_id)
 After creation callback. More...
 
- Static Public Member Functions inherited from ilObjectGUI
static _gotoRepositoryRoot ($a_raise_error=false)
 Goto repository root. More...
 
static _gotoRepositoryNode ($a_ref_id, $a_cmd="frameset")
 Goto repository root. More...
 

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 = ""
 
 $object
 
 $cmixAccess
 
- 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 COPY_WIZARD_NEEDS_PAGE = 1
 
 $objDefinition
 
 $tpl
 
 $tree
 
 $lng
 
 $data
 
 $object
 
 $ref_id
 
 $obj_id
 
 $maxcount
 
 $formaction
 
 $return_location
 
 $target_frame
 
 $tab_target_script
 
 $actions
 
 $sub_objects
 
 $omit_locator = false
 
const CFORM_NEW = 1
 
const CFORM_IMPORT = 2
 
const CFORM_CLONE = 3
 

Protected Member Functions

 initCreateForm ($a_new_type)
 
 afterSave (ilObject $newObject)
 
 initHeaderAction ($a_sub_type=null, $a_sub_id=null)
 
 setTabs ()
 
 debug ()
 
 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 ()
 Get access handler. More...
 
 setLocator ()
 set Locator More...
 
 deleteConfirmedObjects ()
 Delete objects (workspace specific) More...
 
 setTitleAndDescription ()
 
 showUpperIcon ()
 
 omitLocator ($a_omit=true)
 
 getTargetFrame ($a_cmd, $a_target_frame="")
 
 setTargetFrame ($a_cmd, $a_target_frame)
 
 getCenterColumnHTML ()
 
 getRightColumnHTML ()
 
 setColumnSettings (ilColumnGUI $column_gui)
 
 checkPermission ($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
 
 showPossibleSubObjects ()
 
 redirectToRefId ($a_ref_id, $a_cmd="")
 
 fillCloneTemplate ($a_tpl_varname, $a_type)
 
 fillCloneSearchTemplate ($a_tpl_varname, $a_type)
 
 searchCloneSource ()
 
 buildCloneSelect ($existing_objs)
 
 addAdminLocatorItems ($a_do_not_add_object=false)
 
 setTabs ()
 create tabs (repository/workspace switch) More...
 
 getReturnLocation ($a_cmd, $a_location="")
 Deprecated functions. More...
 
 setReturnLocation ($a_cmd, $a_location)
 
 showActions ()
 
 getTabs ()
 
 __showButton ($a_cmd, $a_text, $a_target='')
 
 hitsperpageObject ()
 
__initTableGUI ()
 
 __setTableGUIBasicData (&$tbl, &$result_set, $a_from="")
 
 addLocatorItems ()
 Functions to be overwritten. More...
 
 initCreationForms ($a_new_type)
 Init creation froms. More...
 
 checkPermissionBool ($a_perm, $a_cmd="", $a_type="", $a_node_id=null)
 Check permission. More...
 
 initHeaderAction ($a_sub_type=null, $a_sub_id=null)
 Add header action menu. More...
 
 redrawHeaderAction ()
 Updating icons after ajax call. More...
 
 getPermanentLinkWidget ($a_append=null, $a_center=false)
 
 handleAutoRating (ilObject $a_new_obj)
 
- Protected Member Functions inherited from ilObjectGUI
 getObjectService ()
 Get object service. More...
 
 assignObject ()
 
 setTitleAndDescription ()
 called by prepare output More...
 
 initHeaderAction ($a_sub_type=null, $a_sub_id=null)
 Add header action menu. More...
 
 insertHeaderAction ($a_list_gui)
 Insert header action into main template. More...
 
 addHeaderAction ()
 Add header action menu. More...
 
 redrawHeaderActionObject ()
 Ajax call: redraw action header only. More...
 
 setTabs ()
 set admin tabs public More...
 
 setAdminTabs ()
 set admin tabs public More...
 
 setLocator ()
 set Locator More...
 
 addLocatorItems ()
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 omitLocator ($a_omit=true)
 
 addAdminLocatorItems ($a_do_not_add_object=false)
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 initCreationForms ($a_new_type)
 Init creation froms. More...
 
 getCreationFormsHTML (array $a_forms)
 Get HTML for creation forms (accordion) More...
 
 initCreateForm ($a_new_type)
 Init object creation form. More...
 
 initDidacticTemplate (ilPropertyFormGUI $form)
 Show didactic template types. More...
 
 addDidacticTemplateOptions (array &$a_options)
 Add custom templates. More...
 
 afterSave (ilObject $a_new_object)
 Post (successful) object creation hook. More...
 
 initEditForm ()
 Init object edit form. More...
 
 initEditCustomForm (ilPropertyFormGUI $a_form)
 Add custom fields to update form. More...
 
 getEditFormValues ()
 Get values for edit form. More...
 
 getEditFormCustomValues (array &$a_values)
 Add values to custom edit fields. More...
 
 validateCustom (ilPropertyFormGUI $a_form)
 Validate custom values (if not possible with checkInput()) More...
 
 updateCustom (ilPropertyFormGUI $a_form)
 Insert custom update form values into object. More...
 
 afterUpdate ()
 Post (successful) object update hook. More...
 
 initImportForm ($a_new_type)
 Init object import form. More...
 
 importFileObject ($parent_id=null, $a_catch_errors=true)
 Import. More...
 
 afterImport (ilObject $a_new_object)
 Post (successful) object import hook. More...
 
 setFormAction ($a_cmd, $a_formaction)
 set specific form action for command More...
 
 getReturnLocation ($a_cmd, $a_location="")
 get return location for command (command is method name without "Object", e.g. More...
 
 setReturnLocation ($a_cmd, $a_location)
 set specific return location for command More...
 
 getTargetFrame ($a_cmd, $a_target_frame="")
 get target frame for command (command is method name without "Object", e.g. More...
 
 setTargetFrame ($a_cmd, $a_target_frame)
 set specific target frame for command More...
 
 showPossibleSubObjects ()
 show possible subobjects (pulldown menu) More...
 
 getTemplateFile ($a_cmd, $a_type="")
 get a template blockfile format: tpl. More...
 
 getTabs ()
 get tabs abstract method. More...
 
 __showButton ($a_cmd, $a_text, $a_target='')
 
 hitsperpageObject ()
 
__initTableGUI ()
 
 __setTableGUIBasicData (&$tbl, &$result_set, $a_from="")
 standard implementation for tables use 'from' variable use different initial setting of table More...
 
 redirectToRefId ($a_ref_id, $a_cmd="")
 redirects to (repository) view per ref id usually to a container and usually used at the end of a save/import method where the object gui type (of the new object) doesn't match with the type of the current $_GET["ref_id"] value More...
 
 fillCloneTemplate ($a_tpl_varname, $a_type)
 Fill object clone template This method can be called from any object GUI class that wants to offer object cloning. More...
 
 getCenterColumnHTML ()
 Get center column. More...
 
 getRightColumnHTML ()
 Display right column. More...
 
 setColumnSettings (ilColumnGUI $column_gui)
 May be overwritten in subclasses. More...
 
 checkPermission ($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
 Check permission and redirect on error. More...
 
 checkPermissionBool ($a_perm, $a_cmd="", $a_type="", $a_ref_id=null)
 Check permission. More...
 
 enableDragDropFileUpload ()
 Enables the file upload into this object by dropping files. More...
 
 handleAutoRating (ilObject $a_new_obj)
 Activate rating automatically if parent container setting. More...
 

Additional Inherited Members

- Protected Attributes inherited from ilObject2GUI
 $object_id
 
 $node_id
 
 $creation_forms = array()
 
 $id_type = array()
 
 $parent_id
 
 $access_handler
 
- Protected Attributes inherited from ilObjectGUI
const UPLOAD_TYPE_LOCAL = 1
 
const UPLOAD_TYPE_UPLOAD_DIRECTORY = 2
 
 $ilErr
 
 $locator
 
 $user
 
 $access
 
 $rbacsystem
 
 $settings
 
 $rbacreview
 
 $toolbar
 
 $tmp_import_dir
 
 $tabs_gui = null
 
 $ctrl
 
 $object_service
 
 $favourites
 
 $request
 

Detailed Description

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

Constructor & Destructor Documentation

◆ __construct()

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

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

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

57  {
58  global $DIC; /* @var \ILIAS\DI\Container $DIC */
59 
60  parent::__construct($a_id, $a_id_type, $a_parent_node_id);
61 
62  if ($this->object instanceof ilObjCmiXapi) {
63  $this->cmixAccess = ilCmiXapiAccess::getInstance($this->object);
64  }
65 
66  $DIC->language()->loadLanguageModule("cmix");
67  }
static getInstance(ilObjCmiXapi $object)
global $DIC
Definition: goto.php:24
__construct(Container $dic, ilPlugin $plugin)
+ Here is the call graph for this function:

Member Function Documentation

◆ _goto()

static ilObjCmiXapiGUI::_goto (   $a_target)
static

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

References ilObjectGUI\$access, ilObjectGUI\$ctrl, $DIC, ilObjectGUI\$lng, ilObjectGUI\$request, ilObjectGUI\_gotoRepositoryNode(), ilObjectGUI\_gotoRepositoryRoot(), ilObject\_lookupObjId(), ilObject\_lookupTitle(), ROOT_FOLDER_ID, and ilUtil\sendInfo().

293  {
294  global $DIC; /* @var \ILIAS\DI\Container $DIC */
295  $err = $DIC['ilErr']; /* @var ilErrorHandling $err */
296  $ctrl = $DIC->ctrl();
297  $request = $DIC->http()->request();
298  $access = $DIC->access();
299  $lng = $DIC->language();
300 
301  $targetParameters = explode('_', $a_target);
302  $id = (int) $targetParameters[0];
303 
304  if ($id <= 0) {
305  $err->raiseError($lng->txt('msg_no_perm_read'), $err->FATAL);
306  }
307 
308  if ($access->checkAccess('read', '', $id)) {
309  $ctrl->setTargetScript('ilias.php');
310  $ctrl->initBaseClass(ilRepositoryGUI::class);
311  $ctrl->setParameterByClass(ilObjCmiXapiGUI::class, 'ref_id', $id);
312  if (isset($request->getQueryParams()['gotolp'])) {
313  $ctrl->setParameterByClass(ilObjCmiXapiGUI::class, 'gotolp', 1);
314  }
315  $ctrl->redirectByClass([ilRepositoryGUI::class, ilObjCmiXapiGUI::class]);
316  } elseif ($access->checkAccess('visible', '', $id)) {
317  ilObjectGUI::_gotoRepositoryNode($id, 'infoScreen');
318  } elseif ($access->checkAccess('read', '', ROOT_FOLDER_ID)) {
320  sprintf(
321  $DIC->language()->txt('msg_no_perm_read_item'),
323  ),
324  true
325  );
326 
328  }
329 
330  $err->raiseError($DIC->language()->txt("msg_no_perm_read_lm"), $err->FATAL);
331  }
const ROOT_FOLDER_ID
Definition: constants.php:30
static _gotoRepositoryRoot($a_raise_error=false)
Goto repository root.
static _lookupTitle($a_id)
lookup object title
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
static _gotoRepositoryNode($a_ref_id, $a_cmd="frameset")
Goto repository root.
static _lookupObjId($a_id)
global $DIC
Definition: goto.php:24
+ Here is the call graph for this function:

◆ addLocatorItems()

ilObjCmiXapiGUI::addLocatorItems ( )

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

References $_GET, $DIC, and ilObjectGUI\$locator.

572  {
573  global $DIC; /* @var \ILIAS\DI\Container $DIC */
574 
575  $locator = $DIC['ilLocator']; /* @var ilLocatorGUI $locator */
576  $locator->addItem(
577  $this->object->getTitle(),
578  $this->ctrl->getLinkTarget($this, self::DEFAULT_CMD),
579  "",
580  $_GET["ref_id"]
581  );
582  }
$_GET["client_id"]
global $DIC
Definition: goto.php:24

◆ afterSave()

ilObjCmiXapiGUI::afterSave ( ilObject  $newObject)
protected

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

References $DIC, Vendor\Package\$e, ilUploadFiles\_checkUploadFile(), ilUploadFiles\_getUploadDirectory(), ilObject\getType(), initCreateForm(), initMetadata(), ilUtil\sendFailure(), ilObject\setTitle(), ilObjCmiXapi\SRC_TYPE_EXTERNAL, ilObjCmiXapi\SRC_TYPE_LOCAL, and ilObjCmiXapi\SRC_TYPE_REMOTE.

163  {
164  global $DIC; /* @var \ILIAS\DI\Container $DIC */
165 
166  /* @var ilObjCmiXapi $newObject */
167  $form = $this->initCreateForm($newObject->getType());
168 
169  if ($form->checkInput()) {
170  $newObject->setContentType($form->getInput('content_type'));
171 
172  $newObject->setLrsTypeId($form->getInput('lrs_type_id'));
173  $newObject->initLrsType();
174 
175  $newObject->setPrivacyIdent($newObject->getLrsType()->getPrivacyIdent());
176  $newObject->setPrivacyName($newObject->getLrsType()->getPrivacyName());
177 
178  switch ($form->getInput('source_type')) {
179  case 'resource': // remote resource
180 
181  $newObject->setTitle($form->getInput('title'));
182  $newObject->setSourceType(ilObjCmiXapi::SRC_TYPE_REMOTE);
183  break;
184 
185  case 'upload': // upload from local client
186 
187  try {
188  $uploadImporter = new ilCmiXapiContentUploadImporter($newObject);
189  $uploadImporter->importFormUpload($form->getItemByPostVar('uploadfile'));
190 
191  $newObject->setSourceType(ilObjCmiXapi::SRC_TYPE_LOCAL);
193  $form->getItemByPostVar('uploadfile')->setAlert($e->getMessage());
194  ilUtil::sendFailure('something went wrong!', true);
195  $DIC->ctrl()->redirectByClass(self::class, 'create');
196  }
197 
198  break;
199 
200  case 'server': // from upload directory
201 
203  throw new ilCmiXapiException('access denied!');
204  }
205 
206  $serverFile = $form->getInput('serverfile');
207 
208  if (!ilUploadFiles::_checkUploadFile($serverFile)) {
209  throw new ilCmiXapiException($DIC->language()->txt('upload_error_file_not_found'));
210  }
211 
212  $uploadImporter = new ilCmiXapiContentUploadImporter($newObject);
213 
214  $uploadImporter->importServerFile(implode(DIRECTORY_SEPARATOR, [
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  $DIC->ctrl()->redirectByClass(ilCmiXapiSettingsGUI::class);
234  }
235 
236  throw new ilCmiXapiException('invalid creation form submit!');
237  }
static _getUploadDirectory()
Get the directory with uploaded files.
setTitle($a_title)
set object title
initMetadata(ilObjCmiXapi $object)
initCreateForm($a_new_type)
global $DIC
Definition: goto.php:24
getType()
get object type public
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
static _checkUploadFile($a_file)
Check if a file exists in the upload directory and is readable.
+ Here is the call graph for this function:

◆ buildReportFilter()

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

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

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

Referenced by getXapiStatementsReport().

858  {
859  global $DIC; /* @var \ILIAS\DI\Container $DIC */
860 
861  $filter = new ilCmiXapiStatementsReportFilter();
862 
863  $filter->setActor(new ilCmiXapiUser($this->object->getId(), $DIC->user()->getId()));
864  $filter->setActivityId($this->object->getActivityId());
865 
866  $filter->setStartDate($since);
867  $filter->setEndDate($until);
868 
869  $start = $filter->getStartDate()->get(IL_CAL_DATETIME);
870  $end = $filter->getEndDate()->get(IL_CAL_DATETIME);
871  ilLoggerFactory::getLogger($this->object->getType())->debug("use filter from ($start) until ($end)");
872 
873  return $filter;
874  }
const IL_CAL_DATETIME
global $DIC
Definition: goto.php:24
static getLogger($a_component_id)
Get component logger.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ debug()

ilObjCmiXapiGUI::debug ( )
protected

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

References $DIC, Vendor\Package\$e, ilObjectGUI\$request, ilUtil\sendFailure(), ilUtil\sendInfo(), and ilUtil\sendQuestion().

Referenced by buildReportFilter().

538  {
539  global $DIC; /* @var \ILIAS\DI\Container $DIC */
540 
541  $DIC->tabs()->activateTab('debug');
542 
543  $filter = new ilCmiXapiStatementsReportFilter();
544  $filter->setActivityId($this->object->getActivityId());
545 
546  $linkBuilder = new ilCmiXapiHighscoreReportLinkBuilder(
547  $this->object,
548  $this->object->getLrsType()->getLrsEndpointStatementsAggregationLink(),
549  $filter
550  );
551 
553  $this->object->getLrsType()->getBasicAuth(),
554  $linkBuilder
555  );
556 
557  try {
558  $report = $request->queryReport($this->object);
559 
560  $DIC->ui()->mainTemplate()->setContent(
561  $report->getResponseDebug()
562  );
563  } catch (Exception $e) {
564  ilUtil::sendFailure($e->getMessage());
565  }
566  //ilUtil::sendSuccess('Object ID: '.$this->object->getId());
567  ilUtil::sendInfo($linkBuilder->getPipelineDebug());
568  ilUtil::sendQuestion('<pre>' . print_r($report->getTableData(), 1) . '</pre>');
569  }
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
global $DIC
Definition: goto.php:24
static sendQuestion($a_info="", $a_keep=false)
Send Question to Screen.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ executeCommand()

ilObjCmiXapiGUI::executeCommand ( )

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

References $DIC, ilLink\_getLink(), ilObjectGUI\addHeaderAction(), ilCommonActionDispatcherGUI\getInstanceFromAjaxCall(), getType(), ilLearningProgressBaseGUI\LP_CONTEXT_REPOSITORY, ilObject2GUI\prepareOutput(), and trackObjectReadEvent().

334  {
335  global $DIC; /* @var \ILIAS\DI\Container $DIC */
336 
337  // TODO: access checks (!)
338 
339  if (!$this->creation_mode) {
340  $link = ilLink::_getLink($this->object->getRefId(), $this->object->getType());
341  $navigationHistory = $DIC['ilNavigationHistory']; /* @var ilNavigationHistory $navigationHistory */
342  $navigationHistory->addItem($this->object->getRefId(), $link, $this->object->getType());
343  $this->trackObjectReadEvent();
344  }
345 
346  $this->prepareOutput();
347  $this->addHeaderAction();
348 
349 
350  switch ($DIC->ctrl()->getNextClass()) {
351  case strtolower(ilObjectCopyGUI::class):
352 
353  $gui = new ilObjectCopyGUI($this);
354  $gui->setType($this->getType());
355  $DIC->ctrl()->forwardCommand($gui);
356 
357  break;
358 
359  case strtolower(ilCommonActionDispatcherGUI::class):
360 
361  $gui = ilCommonActionDispatcherGUI::getInstanceFromAjaxCall();
362  $this->ctrl->forwardCommand($gui);
363 
364  break;
365 
366  case strtolower(ilLearningProgressGUI::class):
367 
368  $DIC->tabs()->activateTab(self::TAB_ID_LEARNING_PROGRESS);
369 
370  $gui = new ilLearningProgressGUI(
372  $this->object->getRefId()
373  );
374 
375  $DIC->ctrl()->forwardCommand($gui);
376 
377  break;
378 
379  case strtolower(ilObjectMetaDataGUI::class):
380 
381  $DIC->tabs()->activateTab(self::TAB_ID_METADATA);
382 
383  $gui = new ilObjectMetaDataGUI($this->object);
384  $DIC->ctrl()->forwardCommand($gui);
385  break;
386 
387  case strtolower(ilPermissionGUI::class):
388 
389  $DIC->tabs()->activateTab(self::TAB_ID_PERMISSIONS);
390 
391  $gui = new ilPermissionGUI($this);
392  $DIC->ctrl()->forwardCommand($gui);
393 
394  break;
395 
396  case strtolower(ilCmiXapiSettingsGUI::class):
397 
398  $DIC->tabs()->activateTab(self::TAB_ID_SETTINGS);
399 
400  $gui = new ilCmiXapiSettingsGUI($this->object);
401  $DIC->ctrl()->forwardCommand($gui);
402 
403  break;
404 
405  case strtolower(ilCmiXapiStatementsGUI::class):
406 
407  $DIC->tabs()->activateTab(self::TAB_ID_STATEMENTS);
408 
409  $gui = new ilCmiXapiStatementsGUI($this->object);
410  $DIC->ctrl()->forwardCommand($gui);
411 
412  break;
413 
414  case strtolower(ilCmiXapiScoringGUI::class):
415 
416  $DIC->tabs()->activateTab(self::TAB_ID_SCORING);
417 
418  $gui = new ilCmiXapiScoringGUI($this->object);
419  $DIC->ctrl()->forwardCommand($gui);
420 
421  break;
422 
423  case strtolower(ilCmiXapiExportGUI::class):
424 
425  $DIC->tabs()->activateTab(self::TAB_ID_EXPORT);
426 
427  $gui = new ilCmiXapiExportGUI($this);
428  $DIC->ctrl()->forwardCommand($gui);
429 
430  break;
431 
432  case strtolower(ilCmiXapiRegistrationGUI::class):
433 
434  $DIC->tabs()->activateTab(self::TAB_ID_INFO);
435 
436  $gui = new ilCmiXapiRegistrationGUI($this->object);
437  $DIC->ctrl()->forwardCommand($gui);
438 
439  break;
440 
441  case strtolower(ilCmiXapiLaunchGUI::class):
442 
443  $gui = new ilCmiXapiLaunchGUI($this->object);
444  $DIC->ctrl()->forwardCommand($gui);
445 
446  break;
447 
448  default:
449 
450  $command = $DIC->ctrl()->getCmd(self::DEFAULT_CMD);
451  $this->{$command}();
452  }
453  }
Class ilObjectMetaDataGUI.
GUI class for the workflow of copying objects.
global $DIC
Definition: goto.php:24
prepareOutput($a_show_subobjects=true)
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
addHeaderAction()
Add header action menu.
Class ilObjUserTrackingGUI.
Class ilCommonActionDispatcherGUI.
setType($type)
Sets $type.
+ Here is the call graph for this function:

◆ fetchXapiStatements()

ilObjCmiXapiGUI::fetchXapiStatements ( )
protected

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

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

809  {
810  global $DIC; /* @var \ILIAS\DI\Container $DIC */
811  $logger = ilLoggerFactory::getLogger($this->object->getType());
812 
813  if ($this->object->getLaunchMode() != ilObjCmiXapi::LAUNCH_MODE_NORMAL) {
814  throw new ilCmiXapiException('access denied!');
815  }
816 
817  $cmixUser = new ilCmiXapiUser($this->object->getId(), $DIC->user()->getId(), $this->object->getPrivacyIdent());
818 
819  $fetchedUntil = $cmixUser->getFetchUntil();
820  $now = new ilCmiXapiDateTime(time(), IL_CAL_UNIX);
821 
822  $report = $this->getXapiStatementsReport($fetchedUntil, $now);
823 
824  if ($report->hasStatements()) {
825  $evaluation = new ilXapiStatementEvaluation($logger, $this->object);
826  $evaluation->evaluateReport($report);
827 
828  //$logger->debug('update lp for object (' . $this->object->getId() . ')');
829  //ilLPStatusWrapper::_updateStatus($this->object->getId(), $DIC->user()->getId());
830  }
831 
832  $cmixUser->setFetchUntil($now);
833  $cmixUser->save();
834 
835  ilUtil::sendSuccess($DIC->language()->txt('xapi_statements_fetched_successfully'), true);
836  $DIC->ctrl()->redirect($this, self::CMD_INFO_SCREEN);
837  }
const IL_CAL_UNIX
getXapiStatementsReport(ilCmiXapiDateTime $since, ilCmiXapiDateTime $until)
global $DIC
Definition: goto.php:24
static getLogger($a_component_id)
Get component logger.
+ Here is the call graph for this function:

◆ getPrivacyIdentString()

static ilObjCmiXapiGUI::getPrivacyIdentString ( int  $ident)
static

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

Referenced by ilObjLTIConsumerGUI\infoScreenForward().

877  {
878  switch ($ident) {
879  case 0:
880  return "il_uuid_user_id";
881  case 1:
882  return "il_uuid_ext_account";
883  case 2:
884  return "il_uuid_login";
885  case 3:
886  return "real_email";
887  case 4:
888  return "il_uuid_random";
889  case 5:
890  return "il_uuid_sha256";
891  case 6:
892  return "il_uuid_sha256url";
893  }
894  return '';
895  }
+ Here is the caller graph for this function:

◆ getPrivacyNameString()

static ilObjCmiXapiGUI::getPrivacyNameString ( int  $ident)
static

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

Referenced by ilObjLTIConsumerGUI\infoScreenForward().

898  {
899  switch ($ident) {
900  case 0:
901  return "none";
902  case 1:
903  return "firstname";
904  case 2:
905  return "lastname";
906  case 3:
907  return "fullname";
908  }
909  return '';
910  }
+ Here is the caller graph for this function:

◆ getType()

ilObjCmiXapiGUI::getType ( )

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

Referenced by executeCommand().

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

◆ getXapiStatementsReport()

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

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

References ilObjectGUI\$request, and buildReportFilter().

Referenced by fetchXapiStatements().

840  {
841  $filter = $this->buildReportFilter($since, $until);
842 
843  $linkBuilder = new ilCmiXapiStatementsReportLinkBuilder(
844  $this->object,
845  $this->object->getLrsType()->getLrsEndpointStatementsAggregationLink(),
846  $filter
847  );
848 
850  $this->object->getLrsType()->getBasicAuth(),
851  $linkBuilder
852  );
853 
854  return $request->queryReport($this->object);
855  }
buildReportFilter(ilCmiXapiDateTime $since, ilCmiXapiDateTime $until)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ handleAvailablityMessage()

ilObjCmiXapiGUI::handleAvailablityMessage ( )
protected

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

References $DIC, ilCmiXapiLrsType\AVAILABILITY_NONE, and ilUtil\sendFailure().

Referenced by infoScreenForward().

767  {
768  global $DIC; /* @var \ILIAS\DI\Container $DIC */
769 
770  if ($this->object->getLrsType()->getAvailability() == ilCmiXapiLrsType::AVAILABILITY_NONE) {
771  ilUtil::sendFailure($DIC->language()->txt('cmix_lrstype_not_avail_msg'));
772  }
773  }
global $DIC
Definition: goto.php:24
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ infoScreen()

ilObjCmiXapiGUI::infoScreen ( )

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

References $DIC, and infoScreenForward().

597  {
598  global $DIC; /* @var \ILIAS\DI\Container $DIC */
599 
600  $DIC->tabs()->activateTab(self::TAB_ID_INFO);
601 
602  $DIC->ctrl()->setCmd("showSummary");
603  $DIC->ctrl()->setCmdClass("ilinfoscreengui");
604  $this->infoScreenForward();
605  }
global $DIC
Definition: goto.php:24
+ Here is the call graph for this function:

◆ infoScreenForward()

ilObjCmiXapiGUI::infoScreenForward ( )

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

References $DIC, ilObjectGUI\$ilErr, ilObject2GUI\checkPermissionBool(), handleAvailablityMessage(), and initInfoScreenToolbar().

Referenced by infoScreen().

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

◆ initCreateForm()

ilObjCmiXapiGUI::initCreateForm (   $a_new_type)
protected

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

References $DIC, $source, $type, ilUploadFiles\_getUploadDirectory(), ilUploadFiles\_getUploadFiles(), ilCmiXapiLrsType\AVAILABILITY_CREATE, ilObjCmiXapi\CONT_TYPE_CMI5, ilObjCmiXapi\CONT_TYPE_GENERIC, ilCmiXapiLrsTypeList\getTypesData(), ilObjectGUI\initDidacticTemplate(), ilRadioOption\setInfo(), ilFormPropertyGUI\setRequired(), and ilFileInputGUI\setSuffixes().

Referenced by afterSave().

75  {
76  global $DIC; /* @var \ILIAS\DI\Container $DIC */
77 
78  $ilHelp = $DIC->help();
79  $ilHelp->setScreenIdComponent("cmix");
80  $ilHelp->setScreenId("create_object");
81 
82  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
83  $form = new ilPropertyFormGUI();
84  $form->setTarget("_top");
85  $form->setFormAction($this->ctrl->getFormAction($this, "save"));
86  $form->setTitle($this->lng->txt($a_new_type . "_new"));
87 
88  $form = $this->initDidacticTemplate($form);
89 
90  $title = new ilHiddenInputGUI('title', 'title');
91  $title->setValue(self::NEW_OBJ_TITLE);
92  $form->addItem($title);
93 
94  $type = new ilRadioGroupInputGUI('Type', 'content_type');
95  $type->setRequired(true);
96 
97  $typeLearningModule = new ilRadioOption($this->lng->txt('cmix_add_cmi5_lm'), ilObjCmiXapi::CONT_TYPE_CMI5);
98  $typeLearningModule->setInfo($this->lng->txt('cmix_add_cmi5_lm_info'));
99  $type->addOption($typeLearningModule);
100 
101  $typeGenericModule = new ilRadioOption($this->lng->txt('cmix_add_xapi_standard_object'), ilObjCmiXapi::CONT_TYPE_GENERIC);
102  $typeGenericModule->setInfo($this->lng->txt('cmix_add_xapi_standard_object_info'));
103  $type->addOption($typeGenericModule);
104 
105  $form->addItem($type);
106 
107  $item = new ilRadioGroupInputGUI($this->lng->txt('cmix_add_lrs_type'), 'lrs_type_id');
108  $item->setRequired(true);
110  foreach ($types as $type) {
111  $option = new ilRadioOption($type['title'], $type['type_id'], $type['description']);
112  $item->addOption($option);
113  }
114  #$item->setValue($this->object->typedef->getTypeId());
115  $form->addItem($item);
116 
117  $source = new ilRadioGroupInputGUI($this->lng->txt('cmix_add_source'), 'source_type');
118  $source->setRequired(true);
119 
120  $srcRemoteContent = new ilRadioOption($this->lng->txt('cmix_add_source_url'), 'resource');
121  $srcRemoteContent->setInfo($this->lng->txt('cmix_add_source_url_info'));
122  $source->addOption($srcRemoteContent);
123 
124  $srcUploadContent = new ilRadioOption($this->lng->txt('cmix_add_source_local_dir'), 'upload');
125  $srcUploadContent->setInfo($this->lng->txt('cmix_add_source_local_dir_info'));
126  $source->addOption($srcUploadContent);
127 
128  $srcUpload = new ilFileInputGUI($this->lng->txt("select_file"), "uploadfile");
129  $srcUpload->setAllowDeletion(false);
130  $srcUpload->setSuffixes(['zip', 'xml']);
131  $srcUpload->setRequired(true);
132  $srcUploadContent->addSubItem($srcUpload);
133 
135  $srcServerContent = new ilRadioOption($this->lng->txt('cmix_add_source_upload_dir'), 'server');
136  $srcServerContent->setInfo($this->lng->txt('cmix_add_source_upload_dir_info'));
137  $source->addOption($srcServerContent);
138 
139  $options = ['' => $this->lng->txt('cmix_add_source_upload_select')];
140 
141  foreach (ilUploadFiles::_getUploadFiles() as $file) {
142  $options[$file] = $file;
143  }
144 
145  $srcSelect = new ilSelectInputGUI($this->lng->txt("select_file"), "serverfile");
146  $srcSelect->setOptions($options);
147  $srcServerContent->addSubItem($srcSelect);
148  }
149 
150  $srcExternalApp = new ilRadioOption($this->lng->txt('cmix_add_source_external_app'), 'external');
151  $srcExternalApp->setInfo($this->lng->txt('cmix_add_source_external_app_info'));
152  $source->addOption($srcExternalApp);
153 
154  $form->addItem($source);
155 
156  $form->addCommandButton("save", $this->lng->txt($a_new_type . "_add"));
157  $form->addCommandButton("cancel", $this->lng->txt("cancel"));
158 
159  return $form;
160  }
This class represents an option in a radio group.
This class represents a property form user interface.
$type
This class represents a file property in a property form.
static getTypesData($a_extended=false, $a_availability=null)
Get basic data array of all types (without field definitions)
static _getUploadDirectory()
Get the directory with uploaded files.
static _getUploadFiles()
Get a list of readable files in the upload directory.
setInfo($a_info)
Set Info.
This class represents a hidden form property in a property form.
This class represents a property in a property form.
initDidacticTemplate(ilPropertyFormGUI $form)
Show didactic template types.
global $DIC
Definition: goto.php:24
$source
Definition: metadata.php:76
setSuffixes($a_suffixes)
Set Accepted Suffixes.
setRequired($a_required)
Set Required.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initHeaderAction()

ilObjCmiXapiGUI::initHeaderAction (   $a_sub_type = null,
  $a_sub_id = null 
)
protected

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

References $DIC, ilCmiXapiSettingsGUI\CMD_DELIVER_CERTIFICATE, and ilUtil\getImagePath().

259  {
260  global $DIC; /* @var \ILIAS\DI\Container $DIC */
261 
262  $return = parent::initHeaderAction($a_sub_type, $a_sub_id);
263 
264  if ($this->creation_mode) {
265  return $return;
266  }
267 
268  $validator = new ilCertificateDownloadValidator();
269  if ($validator->isCertificateDownloadable((int) $DIC->user()->getId(), (int) $this->object->getId())) {
270  $certLink = $DIC->ctrl()->getLinkTargetByClass(
271  [ilObjCmiXapiGUI::class, ilCmiXapiSettingsGUI::class],
273  );
274 
275  $DIC->language()->loadLanguageModule('certificate');
276 
277  $return->addCustomCommand($certLink, 'download_certificate');
278 
279  $return->addHeaderIcon(
280  'cert_icon',
281  ilUtil::getImagePath('icon_cert.svg'),
282  $DIC->language()->txt('download_certificate'),
283  null,
284  null,
285  $certLink
286  );
287  }
288 
289  return $return;
290  }
static getImagePath($img, $module_path="", $mode="output", $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...
global $DIC
Definition: goto.php:24
+ 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 697 of file class.ilObjCmiXapiGUI.php.

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

Referenced by infoScreenForward().

698  {
699  global $DIC; /* @var \ILIAS\DI\Container $DIC */
700 
701  if (!$this->object->getOfflineStatus() && $this->object->getLrsType()->isAvailable()) {
702  // TODO : check if this is the correct query
703  // p.e. switched to another privacyIdent before: user exists but not with the new privacyIdent
704  // re_check for isSourceTypeExternal
705  //$cmixUserExists = ilCmiXapiUser::exists($this->object->getId(), $DIC->user()->getId());
706 
707  if ($this->object->isSourceTypeExternal()) {
708  $extCmiUserExists = ilCmiXapiUser::exists($this->object->getId(), $DIC->user()->getId());
709  $registerButton = ilLinkButton::getInstance();
710 
711  if ($extCmiUserExists) {
712  $registerButton->setCaption('change_registration');
713  } else {
714  $registerButton->setPrimary(true);
715  $registerButton->setCaption('create_registration');
716  }
717 
718  $registerButton->setUrl($DIC->ctrl()->getLinkTargetByClass(
719  ilCmiXapiRegistrationGUI::class
720  ));
721 
722  $DIC->toolbar()->addButtonInstance($registerButton);
723  } else {
724  $launchButton = ilLinkButton::getInstance();
725  $launchButton->setPrimary(true);
726  $launchButton->setCaption('launch');
727 
728  if ($this->object->getLaunchMethod() == ilObjCmiXapi::LAUNCH_METHOD_NEW_WIN) {
729  $launchButton->setTarget('_blank');
730  }
731 
732  $launchButton->setUrl($DIC->ctrl()->getLinkTargetByClass(
733  ilCmiXapiLaunchGUI::class
734  ));
735 
736  $DIC->toolbar()->addButtonInstance($launchButton);
737  }
738 
744  $cmiUserExists = ilCmiXapiUser::exists($this->object->getId(), $DIC->user()->getId(), $this->object->getPrivacyIdent());
745 
746  if ($cmiUserExists) {
747  $cmixUser = new ilCmiXapiUser($this->object->getId(), $DIC->user()->getId(), $this->object->getPrivacyIdent());
748 
749  if ($this->isFetchXapiStatementsRequired($cmixUser)) {
750  $fetchButton = ilLinkButton::getInstance();
751  $fetchButton->setCaption('fetch_xapi_statements');
752 
753  $fetchButton->setUrl($DIC->ctrl()->getLinkTarget(
754  $this,
755  self::CMD_FETCH_XAPI_STATEMENTS
756  ));
757 
758  $DIC->toolbar()->addButtonInstance($fetchButton);
759 
760  $this->sendLastFetchInfo($cmixUser);
761  }
762  }
763  }
764  }
global $DIC
Definition: goto.php:24
isFetchXapiStatementsRequired(ilCmiXapiUser $cmixUser)
static exists($objId, $usrId, $privacyIdent=999)
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 ilMD\addGeneral(), ilMD\getGeneral(), ilObject\getId(), ilObject2\getTitle(), ilObject2\getType(), and ilMDBase\save().

Referenced by afterSave().

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:52
getId()
get object id public
& getGeneral()
Definition: class.ilMD.php:40
+ 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 775 of file class.ilObjCmiXapiGUI.php.

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

Referenced by initInfoScreenToolbar().

776  {
777  global $DIC;
778  if ($this->object->getLaunchMode() != ilObjCmiXapi::LAUNCH_MODE_NORMAL) {
779  return false;
780  }
781 
782  if ($this->object->isBypassProxyEnabled()) {
783  return true;
784  }
785 
786  if (!$cmixUser->hasProxySuccess()) {
787  return true;
788  }
789 
790  return false;
791  }
global $DIC
Definition: goto.php:24
+ 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 793 of file class.ilObjCmiXapiGUI.php.

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

Referenced by initInfoScreenToolbar().

794  {
795  global $DIC; /* @var \ILIAS\DI\Container $DIC */
796 
797  if (!$cmixUser->getFetchUntil()->get(IL_CAL_UNIX)) {
798  $info = $DIC->language()->txt('xapi_statements_not_fetched_yet');
799  } else {
800  $info = $DIC->language()->txt('xapi_statements_last_fetch_date') . ' ' . ilDatePresentation::formatDate(
801  $cmixUser->getFetchUntil()
802  );
803  }
804 
805  ilUtil::sendInfo($info);
806  }
const IL_CAL_UNIX
static formatDate(ilDateTime $date, $a_skip_day=false, $a_include_wd=false, $include_seconds=false)
Format a date public.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
global $DIC
Definition: goto.php:24
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setTabs()

ilObjCmiXapiGUI::setTabs ( )
protected

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

References $DIC.

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

◆ trackObjectReadEvent()

ilObjCmiXapiGUI::trackObjectReadEvent ( )
protected

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

References $DIC, and ilChangeEvent\_recordReadEvent().

Referenced by executeCommand().

585  {
586  global $DIC; /* @var \ILIAS\DI\Container $DIC */
587 
589  $this->object->getType(),
590  $this->object->getRefId(),
591  $this->object->getId(),
592  $DIC->user()->getId()
593  );
594  }
static _recordReadEvent( $a_type, $a_ref_id, $obj_id, $usr_id, $isCatchupWriteEvents=true, $a_ext_rc=false, $a_ext_time=false)
Records a read event and catches up with write events.
global $DIC
Definition: goto.php:24
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $cmixAccess

ilObjCmiXapiGUI::$cmixAccess

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

◆ $object

ilObjCmiXapiGUI::$object

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

◆ CMD_FETCH_XAPI_STATEMENTS

const ilObjCmiXapiGUI::CMD_FETCH_XAPI_STATEMENTS = 'fetchXapiStatements'

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

◆ CMD_INFO_SCREEN

◆ DEFAULT_CMD

const ilObjCmiXapiGUI::DEFAULT_CMD = self::CMD_INFO_SCREEN

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

◆ NEW_OBJ_TITLE

const ilObjCmiXapiGUI::NEW_OBJ_TITLE = ""

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

◆ TAB_ID_EXPORT

const ilObjCmiXapiGUI::TAB_ID_EXPORT = 'tab_export'

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

◆ TAB_ID_INFO

const ilObjCmiXapiGUI::TAB_ID_INFO = 'tab_info'

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

◆ TAB_ID_LEARNING_PROGRESS

const ilObjCmiXapiGUI::TAB_ID_LEARNING_PROGRESS = 'learning_progress'

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

◆ TAB_ID_METADATA

const ilObjCmiXapiGUI::TAB_ID_METADATA = 'tab_metadata'

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

◆ TAB_ID_PERMISSIONS

const ilObjCmiXapiGUI::TAB_ID_PERMISSIONS = 'perm_settings'

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

◆ TAB_ID_SCORING

const ilObjCmiXapiGUI::TAB_ID_SCORING = 'tab_scoring'

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

◆ TAB_ID_SETTINGS

const ilObjCmiXapiGUI::TAB_ID_SETTINGS = 'tab_settings'

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

Referenced by ilObjCmiXapiAccess\_getCommands().

◆ TAB_ID_STATEMENTS

const ilObjCmiXapiGUI::TAB_ID_STATEMENTS = 'tab_statements'

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


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