ILIAS  release_6 Revision v6.24-5-g0c8bfefb3b8
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 ()
 

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
 $tree
 
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 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
 $ilErr
 
 $locator
 
 $user
 
 $access
 
 $rbacsystem
 
 $settings
 
 $rbacreview
 
 $toolbar
 
 $tmp_import_dir
 
 $tabs_gui = null
 
 $ctrl
 
 $object_service
 
 $favourites
 

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

Member Function Documentation

◆ _goto()

static ilObjCmiXapiGUI::_goto (   $a_target)
static

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

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

289  {
290  global $DIC; /* @var \ILIAS\DI\Container $DIC */
291  $err = $DIC['ilErr']; /* @var ilErrorHandling $err */
292  $ctrl = $DIC->ctrl();
293  $request = $DIC->http()->request();
294  $access = $DIC->access();
295  $lng = $DIC->language();
296 
297  $targetParameters = explode('_', $a_target);
298  $id = (int) $targetParameters[0];
299 
300  if ($id <= 0) {
301  $err->raiseError($lng->txt('msg_no_perm_read'), $err->FATAL);
302  }
303 
304  if ($access->checkAccess('read', '', $id)) {
305  $ctrl->setTargetScript('ilias.php');
306  $ctrl->initBaseClass(ilRepositoryGUI::class);
307  $ctrl->setParameterByClass(ilObjCmiXapiGUI::class, 'ref_id', $id);
308  if (isset($request->getQueryParams()['gotolp'])) {
309  $ctrl->setParameterByClass(ilObjCmiXapiGUI::class, 'gotolp', 1);
310  }
311  $ctrl->redirectByClass([ilRepositoryGUI::class, ilObjCmiXapiGUI::class]);
312  } elseif ($access->checkAccess('visible', '', $id)) {
313  ilObjectGUI::_gotoRepositoryNode($id, 'infoScreen');
314  } elseif ($access->checkAccess('read', '', ROOT_FOLDER_ID)) {
316  sprintf(
317  $DIC->language()->txt('msg_no_perm_read_item'),
319  ),
320  true
321  );
322 
324  }
325 
326  $err->raiseError($DIC->language()->txt("msg_no_perm_read_lm"), $err->FATAL);
327  }
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)
$DIC
Definition: xapitoken.php:46
+ Here is the call graph for this function:

◆ addLocatorItems()

ilObjCmiXapiGUI::addLocatorItems ( )

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

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

566  {
567  global $DIC; /* @var \ILIAS\DI\Container $DIC */
568 
569  $locator = $DIC['ilLocator']; /* @var ilLocatorGUI $locator */
570  $locator->addItem(
571  $this->object->getTitle(),
572  $this->ctrl->getLinkTarget($this, self::DEFAULT_CMD),
573  "",
574  $_GET["ref_id"]
575  );
576  }
$_GET["client_id"]
$DIC
Definition: xapitoken.php:46

◆ afterSave()

ilObjCmiXapiGUI::afterSave ( ilObject  $newObject)
protected

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

159  {
160  global $DIC; /* @var \ILIAS\DI\Container $DIC */
161 
162  /* @var ilObjCmiXapi $newObject */
163  $form = $this->initCreateForm($newObject->getType());
164 
165  if ($form->checkInput()) {
166  $newObject->setContentType($form->getInput('content_type'));
167 
168  $newObject->setLrsTypeId($form->getInput('lrs_type_id'));
169  $newObject->initLrsType();
170 
171  $newObject->setPrivacyIdent($newObject->getLrsType()->getPrivacyIdent());
172  $newObject->setPrivacyName($newObject->getLrsType()->getPrivacyName());
173 
174  switch ($form->getInput('source_type')) {
175  case 'resource': // remote resource
176 
177  $newObject->setTitle($form->getInput('title'));
178  $newObject->setSourceType(ilObjCmiXapi::SRC_TYPE_REMOTE);
179  break;
180 
181  case 'upload': // upload from local client
182 
183  try {
184  $uploadImporter = new ilCmiXapiContentUploadImporter($newObject);
185  $uploadImporter->importFormUpload($form->getItemByPostVar('uploadfile'));
186 
187  $newObject->setSourceType(ilObjCmiXapi::SRC_TYPE_LOCAL);
189  $form->getItemByPostVar('uploadfile')->setAlert($e->getMessage());
190  ilUtil::sendFailure('something went wrong!', true);
191  $DIC->ctrl()->redirectByClass(self::class, 'create');
192  }
193 
194  break;
195 
196  case 'server': // from upload directory
197 
199  throw new ilCmiXapiException('access denied!');
200  }
201 
202  $serverFile = $form->getInput('serverfile');
203 
204  if (!ilUploadFiles::_checkUploadFile($serverFile)) {
205  throw new ilCmiXapiException($DIC->language()->txt('upload_error_file_not_found'));
206  }
207 
208  $uploadImporter = new ilCmiXapiContentUploadImporter($newObject);
209 
210  $uploadImporter->importServerFile(implode(DIRECTORY_SEPARATOR, [
212  ]));
213 
214  $newObject->setSourceType(ilObjCmiXapi::SRC_TYPE_LOCAL);
215 
216  break;
217 
218  case 'external':
219 
220  $newObject->setSourceType(ilObjCmiXapi::SRC_TYPE_EXTERNAL);
221  $newObject->setBypassProxyEnabled(true);
222  break;
223  }
224 
225  $newObject->save();
226 
227  $this->initMetadata($newObject);
228 
229  $DIC->ctrl()->redirectByClass(ilCmiXapiSettingsGUI::class);
230  }
231 
232  throw new ilCmiXapiException('invalid creation form submit!');
233  }
static _getUploadDirectory()
Get the directory with uploaded files.
setTitle($a_title)
set object title
initMetadata(ilObjCmiXapi $object)
initCreateForm($a_new_type)
getType()
get object type public
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
$DIC
Definition: xapitoken.php:46
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 851 of file class.ilObjCmiXapiGUI.php.

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

Referenced by getXapiStatementsReport().

852  {
853  global $DIC; /* @var \ILIAS\DI\Container $DIC */
854 
855  $filter = new ilCmiXapiStatementsReportFilter();
856 
857  $filter->setActor(new ilCmiXapiUser($this->object->getId(), $DIC->user()->getId()));
858  $filter->setActivityId($this->object->getActivityId());
859 
860  $filter->setStartDate($since);
861  $filter->setEndDate($until);
862 
863  $start = $filter->getStartDate()->get(IL_CAL_DATETIME);
864  $end = $filter->getEndDate()->get(IL_CAL_DATETIME);
865  ilLoggerFactory::getLogger($this->object->getType())->debug("use filter from ($start) until ($end)");
866 
867  return $filter;
868  }
const IL_CAL_DATETIME
$DIC
Definition: xapitoken.php:46
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 531 of file class.ilObjCmiXapiGUI.php.

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

Referenced by buildReportFilter().

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

◆ executeCommand()

ilObjCmiXapiGUI::executeCommand ( )

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

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

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

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

803  {
804  global $DIC; /* @var \ILIAS\DI\Container $DIC */
805  $logger = ilLoggerFactory::getLogger($this->object->getType());
806 
807  if ($this->object->getLaunchMode() != ilObjCmiXapi::LAUNCH_MODE_NORMAL) {
808  throw new ilCmiXapiException('access denied!');
809  }
810 
811  $cmixUser = new ilCmiXapiUser($this->object->getId(), $DIC->user()->getId(), $this->object->getPrivacyIdent());
812 
813  $fetchedUntil = $cmixUser->getFetchUntil();
814  $now = new ilCmiXapiDateTime(time(), IL_CAL_UNIX);
815 
816  $report = $this->getXapiStatementsReport($fetchedUntil, $now);
817 
818  if ($report->hasStatements()) {
819  $evaluation = new ilXapiStatementEvaluation($logger, $this->object);
820  $evaluation->evaluateReport($report);
821 
822  //$logger->debug('update lp for object (' . $this->object->getId() . ')');
823  //ilLPStatusWrapper::_updateStatus($this->object->getId(), $DIC->user()->getId());
824  }
825 
826  $cmixUser->setFetchUntil($now);
827  $cmixUser->save();
828 
829  ilUtil::sendSuccess($DIC->language()->txt('xapi_statements_fetched_successfully'), true);
830  $DIC->ctrl()->redirect($this, self::CMD_INFO_SCREEN);
831  }
const IL_CAL_UNIX
getXapiStatementsReport(ilCmiXapiDateTime $since, ilCmiXapiDateTime $until)
$DIC
Definition: xapitoken.php:46
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 870 of file class.ilObjCmiXapiGUI.php.

Referenced by ilObjLTIConsumerGUI\infoScreenForward().

871  {
872  switch ($ident) {
873  case 0:
874  return "il_uuid_user_id";
875  case 1:
876  return "il_uuid_ext_account";
877  case 2:
878  return "il_uuid_login";
879  case 3:
880  return "real_email";
881  case 4:
882  return "il_uuid_random";
883  case 5:
884  return "il_uuid_SHA256";
885  }
886  return '';
887  }
+ Here is the caller graph for this function:

◆ getPrivacyNameString()

static ilObjCmiXapiGUI::getPrivacyNameString ( int  $ident)
static

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

Referenced by ilObjLTIConsumerGUI\infoScreenForward().

890  {
891  switch ($ident) {
892  case 0:
893  return "none";
894  case 1:
895  return "firstname";
896  case 2:
897  return "lastname";
898  case 3:
899  return "fullname";
900  }
901  return '';
902  }
+ 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 833 of file class.ilObjCmiXapiGUI.php.

References buildReportFilter().

Referenced by fetchXapiStatements().

834  {
835  $filter = $this->buildReportFilter($since, $until);
836 
837  $linkBuilder = new ilCmiXapiStatementsReportLinkBuilder(
838  $this->object,
839  $this->object->getLrsType()->getLrsEndpointStatementsAggregationLink(),
840  $filter
841  );
842 
843  $request = new ilCmiXapiStatementsReportRequest(
844  $this->object->getLrsType()->getBasicAuth(),
845  $linkBuilder
846  );
847 
848  return $request->queryReport($this->object);
849  }
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 760 of file class.ilObjCmiXapiGUI.php.

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

Referenced by infoScreenForward().

761  {
762  global $DIC; /* @var \ILIAS\DI\Container $DIC */
763 
764  if ($this->object->getLrsType()->getAvailability() == ilCmiXapiLrsType::AVAILABILITY_NONE) {
765  ilUtil::sendFailure($DIC->language()->txt('cmix_lrstype_not_avail_msg'));
766  }
767  }
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
$DIC
Definition: xapitoken.php:46
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ infoScreen()

ilObjCmiXapiGUI::infoScreen ( )

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

References $DIC, and infoScreenForward().

591  {
592  global $DIC; /* @var \ILIAS\DI\Container $DIC */
593 
594  $DIC->tabs()->activateTab(self::TAB_ID_INFO);
595 
596  $DIC->ctrl()->setCmd("showSummary");
597  $DIC->ctrl()->setCmdClass("ilinfoscreengui");
598  $this->infoScreenForward();
599  }
$DIC
Definition: xapitoken.php:46
+ Here is the call graph for this function:

◆ infoScreenForward()

ilObjCmiXapiGUI::infoScreenForward ( )

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

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

Referenced by infoScreen().

602  {
603  global $DIC; /* @var \ILIAS\DI\Container $DIC */
604  $ilErr = $DIC['ilErr']; /* @var ilErrorHandling $ilErr */
605 
606  if (!$this->checkPermissionBool("visible") && !$this->checkPermissionBool("read")) {
607  $ilErr->raiseError($DIC->language()->txt("msg_no_perm_read"));
608  }
609 
610  $this->handleAvailablityMessage();
611  $this->initInfoScreenToolbar();
612 
613  $info = new ilInfoScreenGUI($this);
614 
615  $info->enablePrivateNotes();
616 
617  if ($this->checkPermissionBool("read")) {
618  $info->enableNews();
619  }
620 
621  $info->enableNewsEditing(false);
622 
623  if ($this->checkPermissionBool("write")) {
624  $news_set = new ilSetting("news");
625  $enable_internal_rss = $news_set->get("enable_rss_for_internal");
626 
627  if ($enable_internal_rss) {
628  $info->setBlockProperty("news", "settings", true);
629  $info->setBlockProperty("news", "public_notifications_option", true);
630  }
631  }
632 
633  if (DEVMODE) {
634  // Development Info
635  $info->addSection('DEVMODE Info');
636  $info->addProperty('Local Object ID', $this->object->getId());
637  $info->addProperty('Current User ID', $DIC->user()->getId());
638  }
639 
640  // standard meta data
641  $info->addMetaDataSections($this->object->getId(), 0, $this->object->getType());
642 
643  // Info about privacy
644  if ($this->object->isSourceTypeExternal()) {
645  $info->addSection($DIC->language()->txt("cmix_info_privacy_section"));
646  } else {
647  $info->addSection($DIC->language()->txt("cmix_info_privacy_section_launch"));
648  }
649 
650  $info->addProperty($DIC->language()->txt('cmix_lrs_type'), $this->object->getLrsType()->getTitle());
651 
652  if ($this->object->isSourceTypeExternal()) {
653  $cmixUser = new ilCmiXapiUser($this->object->getId(), $DIC->user()->getId(), $this->object->getPrivacyIdent());
654  if ($cmixUser->getUsrIdent()) {
655  $info->addProperty(
656  $DIC->language()->txt("conf_user_registered_mail"),
657  $cmixUser->getUsrIdent()
658  );
659  }
660  } else {
661  $info->addProperty(
662  $DIC->language()->txt("conf_privacy_name"),
663  $DIC->language()->txt('conf_privacy_name_' . self::getPrivacyNameString($this->object->getPrivacyName()))
664  );
665 
666  $info->addProperty(
667  $DIC->language()->txt("conf_privacy_ident"),
668  $DIC->language()->txt('conf_privacy_ident_' . self::getPrivacyIdentString($this->object->getPrivacyIdent()))
669  );
670  }
671 
672  if ($this->object->getLrsType()->getExternalLrs()) {
673  $info->addProperty(
674  $DIC->language()->txt("cmix_info_external_lrs_label"),
675  $DIC->language()->txt('cmix_info_external_lrs_info')
676  );
677  }
678 
679  if (strlen($this->object->getLrsType()->getPrivacyCommentDefault())) {
680  $info->addProperty(
681  $DIC->language()->txt("cmix_indication_to_user"),
682  nl2br($this->object->getLrsType()->getPrivacyCommentDefault())
683  );
684  }
685 
686  // FINISHED INFO SCREEN, NOW FORWARD
687 
688  $this->ctrl->forwardCommand($info);
689  }
Class ilInfoScreenGUI.
checkPermissionBool($a_perm, $a_cmd="", $a_type="", $a_node_id=null)
Check permission.
$DIC
Definition: xapitoken.php:46
+ 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  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
79  $form = new ilPropertyFormGUI();
80  $form->setTarget("_top");
81  $form->setFormAction($this->ctrl->getFormAction($this, "save"));
82  $form->setTitle($this->lng->txt($a_new_type . "_new"));
83 
84  $form = $this->initDidacticTemplate($form);
85 
86  $title = new ilHiddenInputGUI('title', 'title');
87  $title->setValue(self::NEW_OBJ_TITLE);
88  $form->addItem($title);
89 
90  $type = new ilRadioGroupInputGUI('Type', 'content_type');
91  $type->setRequired(true);
92 
93  $typeLearningModule = new ilRadioOption($this->lng->txt('cmix_add_cmi5_lm'), ilObjCmiXapi::CONT_TYPE_CMI5);
94  $typeLearningModule->setInfo($this->lng->txt('cmix_add_cmi5_lm_info'));
95  $type->addOption($typeLearningModule);
96 
97  $typeGenericModule = new ilRadioOption($this->lng->txt('cmix_add_xapi_standard_object'), ilObjCmiXapi::CONT_TYPE_GENERIC);
98  $typeGenericModule->setInfo($this->lng->txt('cmix_add_xapi_standard_object_info'));
99  $type->addOption($typeGenericModule);
100 
101  $form->addItem($type);
102 
103  $item = new ilRadioGroupInputGUI($this->lng->txt('cmix_add_lrs_type'), 'lrs_type_id');
104  $item->setRequired(true);
106  foreach ($types as $type) {
107  $option = new ilRadioOption($type['title'], $type['type_id'], $type['description']);
108  $item->addOption($option);
109  }
110  #$item->setValue($this->object->typedef->getTypeId());
111  $form->addItem($item);
112 
113  $source = new ilRadioGroupInputGUI($this->lng->txt('cmix_add_source'), 'source_type');
114  $source->setRequired(true);
115 
116  $srcRemoteContent = new ilRadioOption($this->lng->txt('cmix_add_source_url'), 'resource');
117  $srcRemoteContent->setInfo($this->lng->txt('cmix_add_source_url_info'));
118  $source->addOption($srcRemoteContent);
119 
120  $srcUploadContent = new ilRadioOption($this->lng->txt('cmix_add_source_local_dir'), 'upload');
121  $srcUploadContent->setInfo($this->lng->txt('cmix_add_source_local_dir_info'));
122  $source->addOption($srcUploadContent);
123 
124  $srcUpload = new ilFileInputGUI($this->lng->txt("select_file"), "uploadfile");
125  $srcUpload->setAllowDeletion(false);
126  $srcUpload->setSuffixes(['zip', 'xml']);
127  $srcUpload->setRequired(true);
128  $srcUploadContent->addSubItem($srcUpload);
129 
131  $srcServerContent = new ilRadioOption($this->lng->txt('cmix_add_source_upload_dir'), 'server');
132  $srcServerContent->setInfo($this->lng->txt('cmix_add_source_upload_dir_info'));
133  $source->addOption($srcServerContent);
134 
135  $options = ['' => $this->lng->txt('cmix_add_source_upload_select')];
136 
137  foreach (ilUploadFiles::_getUploadFiles() as $file) {
138  $options[$file] = $file;
139  }
140 
141  $srcSelect = new ilSelectInputGUI($this->lng->txt("select_file"), "serverfile");
142  $srcSelect->setOptions($options);
143  $srcServerContent->addSubItem($srcSelect);
144  }
145 
146  $srcExternalApp = new ilRadioOption($this->lng->txt('cmix_add_source_external_app'), 'external');
147  $srcExternalApp->setInfo($this->lng->txt('cmix_add_source_external_app_info'));
148  $source->addOption($srcExternalApp);
149 
150  $form->addItem($source);
151 
152  $form->addCommandButton("save", $this->lng->txt($a_new_type . "_add"));
153  $form->addCommandButton("cancel", $this->lng->txt("cancel"));
154 
155  return $form;
156  }
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.
$DIC
Definition: xapitoken.php:46
$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 254 of file class.ilObjCmiXapiGUI.php.

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

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

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

Referenced by infoScreenForward().

692  {
693  global $DIC; /* @var \ILIAS\DI\Container $DIC */
694 
695  if (!$this->object->getOfflineStatus() && $this->object->getLrsType()->isAvailable()) {
696  // TODO : check if this is the correct query
697  // p.e. switched to another privacyIdent before: user exists but not with the new privacyIdent
698  // re_check for isSourceTypeExternal
699  //$cmixUserExists = ilCmiXapiUser::exists($this->object->getId(), $DIC->user()->getId());
700 
701  if ($this->object->isSourceTypeExternal()) {
702  $extCmiUserExists = ilCmiXapiUser::exists($this->object->getId(), $DIC->user()->getId());
703  $registerButton = ilLinkButton::getInstance();
704 
705  if ($extCmiUserExists) {
706  $registerButton->setCaption('change_registration');
707  } else {
708  $registerButton->setPrimary(true);
709  $registerButton->setCaption('create_registration');
710  }
711 
712  $registerButton->setUrl($DIC->ctrl()->getLinkTargetByClass(
713  ilCmiXapiRegistrationGUI::class
714  ));
715 
716  $DIC->toolbar()->addButtonInstance($registerButton);
717  } else {
718  $launchButton = ilLinkButton::getInstance();
719  $launchButton->setPrimary(true);
720  $launchButton->setCaption('launch');
721 
722  if ($this->object->getLaunchMethod() == ilObjCmiXapi::LAUNCH_METHOD_NEW_WIN) {
723  $launchButton->setTarget('_blank');
724  }
725 
726  $launchButton->setUrl($DIC->ctrl()->getLinkTargetByClass(
727  ilCmiXapiLaunchGUI::class
728  ));
729 
730  $DIC->toolbar()->addButtonInstance($launchButton);
731  }
732 
738  $cmiUserExists = ilCmiXapiUser::exists($this->object->getId(),$DIC->user()->getId(),$this->object->getPrivacyIdent());
739 
740  if ($cmiUserExists) {
741  $cmixUser = new ilCmiXapiUser($this->object->getId(), $DIC->user()->getId(), $this->object->getPrivacyIdent());
742 
743  if ($this->isFetchXapiStatementsRequired($cmixUser)) {
744  $fetchButton = ilLinkButton::getInstance();
745  $fetchButton->setCaption('fetch_xapi_statements');
746 
747  $fetchButton->setUrl($DIC->ctrl()->getLinkTarget(
748  $this,
749  self::CMD_FETCH_XAPI_STATEMENTS
750  ));
751 
752  $DIC->toolbar()->addButtonInstance($fetchButton);
753 
754  $this->sendLastFetchInfo($cmixUser);
755  }
756  }
757  }
758  }
isFetchXapiStatementsRequired(ilCmiXapiUser $cmixUser)
$DIC
Definition: xapitoken.php:46
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 235 of file class.ilObjCmiXapiGUI.php.

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

Referenced by afterSave().

236  {
237  $metadata = new ilMD($object->getId(), $object->getId(), $object->getType());
238 
239  $generalMetadata = $metadata->getGeneral();
240 
241  if (!$generalMetadata) {
242  $generalMetadata = $metadata->addGeneral();
243  }
244 
245  $generalMetadata->setTitle($object->getTitle());
246  $generalMetadata->save();
247 
248  $id = $generalMetadata->addIdentifier();
249  $id->setCatalog('ILIAS');
250  $id->setEntry('il__' . $object->getType() . '_' . $object->getId());
251  $id->save();
252  }
& 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 769 of file class.ilObjCmiXapiGUI.php.

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

Referenced by initInfoScreenToolbar().

770  {
771  global $DIC;
772  if ($this->object->getLaunchMode() != ilObjCmiXapi::LAUNCH_MODE_NORMAL) {
773  return false;
774  }
775 
776  if ($this->object->isBypassProxyEnabled()) {
777  return true;
778  }
779 
780  if (!$cmixUser->hasProxySuccess()) {
781  return true;
782  }
783 
784  return false;
785  }
$DIC
Definition: xapitoken.php:46
+ 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 787 of file class.ilObjCmiXapiGUI.php.

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

Referenced by initInfoScreenToolbar().

788  {
789  global $DIC; /* @var \ILIAS\DI\Container $DIC */
790 
791  if (!$cmixUser->getFetchUntil()->get(IL_CAL_UNIX)) {
792  $info = $DIC->language()->txt('xapi_statements_not_fetched_yet');
793  } else {
794  $info = $DIC->language()->txt('xapi_statements_last_fetch_date') . ' ' . ilDatePresentation::formatDate(
795  $cmixUser->getFetchUntil()
796  );
797  }
798 
799  ilUtil::sendInfo($info);
800  }
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.
$DIC
Definition: xapitoken.php:46
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setTabs()

ilObjCmiXapiGUI::setTabs ( )
protected

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

References $DIC.

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

◆ trackObjectReadEvent()

ilObjCmiXapiGUI::trackObjectReadEvent ( )
protected

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

References $DIC, and ilChangeEvent\_recordReadEvent().

Referenced by executeCommand().

579  {
580  global $DIC; /* @var \ILIAS\DI\Container $DIC */
581 
583  $this->object->getType(),
584  $this->object->getRefId(),
585  $this->object->getId(),
586  $DIC->user()->getId()
587  );
588  }
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.
$DIC
Definition: xapitoken.php:46
+ 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: