ILIAS  release_9 Revision v9.13-25-g2c18ec4c24f
ilCmiXapiSettingsGUI Class Reference
+ Collaboration diagram for ilCmiXapiSettingsGUI:

Public Member Functions

 __construct (ilObjCmiXapi $object)
 
 initSubtabs ()
 
 executeCommand ()
 

Data Fields

const CMD_SHOW = 'show'
 
const CMD_DELIVER_CERTIFICATE = 'deliverCertificate'
 
const CMD_SAVE = 'save'
 
const DEFAULT_CMD = self::CMD_SHOW
 
const SUBTAB_ID_SETTINGS = 'settings'
 
const SUBTAB_ID_CERTIFICATE = 'certificate'
 

Protected Member Functions

 saveCmd ()
 
 showCmd (ilPropertyFormGUI $form=null)
 
 buildForm ()
 
 saveSettings (ilPropertyFormGUI $form)
 
 deliverCertificateCmd ()
 

Protected Attributes

ilObjCmiXapi $object
 

Private Attributes

ilGlobalTemplateInterface $main_tpl
 
ILIAS DI Container $dic
 
ilLanguage $language
 

Detailed Description

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

Constructor & Destructor Documentation

◆ __construct()

ilCmiXapiSettingsGUI::__construct ( ilObjCmiXapi  $object)

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

References $DIC, $object, and ILIAS\UI\examples\Symbol\Glyph\Language\language().

53  {
54  global $DIC;
55  $this->dic = $DIC;
56  $this->language = $DIC->language();
57  $this->main_tpl = $DIC->ui()->mainTemplate();
58  $this->object = $object;
59  }
global $DIC
Definition: feed.php:28
+ Here is the call graph for this function:

Member Function Documentation

◆ buildForm()

ilCmiXapiSettingsGUI::buildForm ( )
protected

Definition at line 133 of file class.ilCmiXapiSettingsGUI.php.

References ilObjCmiXapi\CONT_TYPE_CMI5, ilCmiXapiUser\getIliasUuid(), ilObjCmiXapi\HIGHSCORE_SHOW_ALL_TABLES, ilObjCmiXapi\HIGHSCORE_SHOW_OWN_TABLE, ilObjCmiXapi\HIGHSCORE_SHOW_TOP_TABLE, ILIAS\UI\examples\Symbol\Glyph\Language\language(), ilObjCmiXapi\LAUNCH_METHOD_NEW_WIN, ilObjCmiXapi\LAUNCH_METHOD_OWN_WIN, ilObjCmiXapi\LAUNCH_MODE_BROWSE, ilObjCmiXapi\LAUNCH_MODE_NORMAL, ilObjCmiXapi\LAUNCH_MODE_REVIEW, ilObjCmiXapi\LMS_MASTERY_SCORE, ILIAS\Repository\object(), ilCmiXapiLrsType\PRIVACY_IDENT_IL_UUID_EXT_ACCOUNT, ilCmiXapiLrsType\PRIVACY_IDENT_IL_UUID_LOGIN, ilCmiXapiLrsType\PRIVACY_IDENT_IL_UUID_RANDOM, ilCmiXapiLrsType\PRIVACY_IDENT_IL_UUID_SHA256, ilCmiXapiLrsType\PRIVACY_IDENT_IL_UUID_SHA256URL, ilCmiXapiLrsType\PRIVACY_IDENT_IL_UUID_USER_ID, ilCmiXapiLrsType\PRIVACY_IDENT_REAL_EMAIL, ilCmiXapiLrsType\PRIVACY_NAME_FIRSTNAME, ilCmiXapiLrsType\PRIVACY_NAME_FULLNAME, ilCmiXapiLrsType\PRIVACY_NAME_LASTNAME, ilCmiXapiLrsType\PRIVACY_NAME_NONE, ilRadioOption\setInfo(), ilFormPropertyGUI\setInfo(), ilFormPropertyGUI\setRequired(), and ilRadioOption\setValue().

Referenced by saveCmd(), and showCmd().

134  {
135  $form = new ilPropertyFormGUI();
136  $form->setFormAction($this->dic->ctrl()->getFormAction($this));
137 
138  $ne = new ilNonEditableValueGUI($this->language->txt('type'), "");
139  $ne->setValue($this->language->txt('type_' . $this->object->getContentType()));
140  $form->addItem($ne);
141 
142  $ne = new ilNonEditableValueGUI($this->language->txt('cmix_lrs_type'), "");
143  $ne->setValue($this->object->getLrsType()->getTitle());
144  $form->addItem($ne);
145 
146  $item = new ilTextInputGUI($this->language->txt('title'), 'title');
147  $item->setSize(40);
148  $item->setMaxLength(128);
149  $item->setRequired(true);
150  $item->setInfo($this->language->txt('title_info'));
151  $item->setValue($this->object->getTitle());
152  $form->addItem($item);
153 
154  $item = new ilTextAreaInputGUI($this->language->txt('description'), 'description');
155  $item->setInfo($this->language->txt('description_info'));
156  $item->setRows(2);
157  $item->setCols(80);
158  $item->setValue($this->object->getDescription());
159  $form->addItem($item);
160 
161  $item = new ilTextInputGUI($this->language->txt('activity_id'), 'activity_id');
162  $item->setRequired(true);
163  $item->setSize(40);
164  $item->setMaxLength(128);
165  // $item->setRequired(true);
166  $item->setInfo($this->language->txt('activity_id_info'));
167  $item->setValue($this->object->getActivityId());
168  $form->addItem($item);
169 
170  $item = new ilCheckboxInputGUI($this->language->txt('online'), 'online');
171  $item->setInfo($this->language->txt("online_info"));
172  $item->setValue("1");
173  if (!$this->object->getOfflineStatus()) {
174  $item->setChecked(true);
175  }
176  $form->addItem($item);
177 
178  $lpDeterioration = new ilCheckboxInputGUI($this->language->txt('conf_keep_lp'), 'avoid_lp_deterioration');
179  $lpDeterioration->setInfo($this->language->txt('conf_keep_lp_info'));
180  if ($this->object->isKeepLpStatusEnabled()) {
181  $lpDeterioration->setChecked(true);
182  }
183 
184  //
185  // presentation
186  //
187  $item = new ilFormSectionHeaderGUI();
188  $item->setTitle($this->language->txt("obj_presentation"));
189  $form->addItem($item);
190 
191  // tile image
192  $this->dic->object()->commonSettings()->legacyForm($form, $this->object)->addTileImage();
193 
194  if (!$this->object->isSourceTypeExternal()) {
195  $item = new ilFormSectionHeaderGUI();
196  $item->setTitle($this->language->txt("launch_options"));
197  $form->addItem($item);
198 
199  if ($this->object->isSourceTypeRemote()) {
200  $item = new ilTextInputGUI($this->language->txt('launch_url'), 'launch_url');
201  $item->setSize(40);
202  $item->setMaxLength(128);
203  $item->setRequired(true);
204  $item->setInfo($this->language->txt('launch_url_info'));
205  $item->setValue($this->object->getLaunchUrl());
206  $form->addItem($item);
207  }
208 
209  if ($this->object->getContentType() != ilObjCmiXapi::CONT_TYPE_CMI5) {
210  $item = new ilCheckboxInputGUI($this->language->txt('use_fetch'), 'use_fetch');
211  $item->setInfo($this->language->txt("use_fetch_info"));
212  $item->setValue("1");
213 
214  if ($this->object->isAuthFetchUrlEnabled()) {
215  $item->setChecked(true);
216  }
217  $form->addItem($item);
218  }
219 
220  $display = new ilRadioGroupInputGUI($this->language->txt('launch_options'), 'display');
221  $display->setRequired(true);
222  $display->setValue($this->object->getLaunchMethod());
223  $optOwnWindow = new ilRadioOption($this->language->txt('conf_own_window'), ilObjCmiXapi::LAUNCH_METHOD_OWN_WIN);
224  $optOwnWindow->setInfo($this->language->txt('conf_own_window_info'));
225  $display->addOption($optOwnWindow);
226  $optAnyWindow = new ilRadioOption($this->language->txt('conf_new_window'), ilObjCmiXapi::LAUNCH_METHOD_NEW_WIN);
227  $optAnyWindow->setInfo($this->language->txt('conf_new_window_info'));
228  $display->addOption($optAnyWindow);
229  $form->addItem($display);
230 
231  $launchMode = new ilRadioGroupInputGUI($this->language->txt('conf_launch_mode'), 'launch_mode');
232  $launchMode->setRequired(true);
233  $launchMode->setValue($this->object->getLaunchMode());
234  $optNormal = new ilRadioOption($this->language->txt('conf_launch_mode_normal'), ilObjCmiXapi::LAUNCH_MODE_NORMAL);
235  $optNormal->setInfo($this->language->txt('conf_launch_mode_normal_info'));
236 
237  $optNormal->addSubItem($lpDeterioration);
238 
239  $launchMode->addOption($optNormal);
240  $optBrowse = new ilRadioOption($this->language->txt('conf_launch_mode_browse'), ilObjCmiXapi::LAUNCH_MODE_BROWSE);
241  $optBrowse->setInfo($this->language->txt('conf_launch_mode_browse_info'));
242  $launchMode->addOption($optBrowse);
243  $optReview = new ilRadioOption($this->language->txt('conf_launch_mode_review'), ilObjCmiXapi::LAUNCH_MODE_REVIEW);
244  $optReview->setInfo($this->language->txt('conf_launch_mode_review_info'));
245  $launchMode->addOption($optReview);
246  $form->addItem($launchMode);
247  } else {
248  $form->addItem($lpDeterioration);
249  }
250 
251  if ($this->object->getContentType() == ilObjCmiXapi::CONT_TYPE_CMI5) {
252  $switchMode = new ilCheckboxInputGUI($this->language->txt('conf_switch_to_review'), 'switch_to_review');
253  $switchMode->setInfo($this->language->txt("conf_switch_to_review_info"));
254  if ($this->object->isSwitchToReviewEnabled()) {
255  $switchMode->setChecked(true);
256  }
257  // optNormal not undefined because CONT_TYPE_CMI5 is subtype
258  $optNormal->addSubItem($switchMode);
259 
260  $masteryScore = new ilNumberInputGUI($this->language->txt('conf_mastery_score'), 'mastery_score');
261  $masteryScore->setInfo($this->language->txt('conf_mastery_score_info'));
262  $masteryScore->setSuffix('%');
263  $masteryScore->allowDecimals(true);
264  $masteryScore->setDecimals(2);
265  $masteryScore->setMinvalueShouldBeGreater(false);
266  $masteryScore->setMinValue(0);
267  $masteryScore->setMaxvalueShouldBeLess(false);
268  $masteryScore->setMaxValue(100);
269  $masteryScore->setSize(4);
270  if (empty($this->object->getMasteryScore())) {
271  $this->object->setMasteryScorePercent(ilObjCmiXapi::LMS_MASTERY_SCORE);
272  }
273  $masteryScore->setValue((string) $this->object->getMasteryScorePercent());
274  $optNormal->addSubItem($masteryScore);
275  }
276 
277  if (!$this->object->isSourceTypeExternal()) {
278  // if ($this->object->getContentType() != ilObjCmiXapi::CONT_TYPE_CMI5) {
279  $sectionHeader = new ilFormSectionHeaderGUI();
280  $sectionHeader->setTitle($this->language->txt('privacy_options'));
281  $form->addItem($sectionHeader);
282 
283  $useProxy = new ilCheckboxInputGUI($this->language->txt('conf_use_proxy'), 'use_proxy');
284  $useProxy->setInfo($this->language->txt('conf_use_proxy_info_xapi'));
285  if($this->object->isBypassProxyEnabled() == false) {
286  $useProxy->setChecked(true);
287  }
288  // if ($this->object->getLrsType()->getForcePrivacySettings()) {
289  // $useProxy->setDisabled(true);
290  // }
291  if ($this->object->getContentType() == ilObjCmiXapi::CONT_TYPE_CMI5) {
292  $useProxy->setChecked(true);
293  $useProxy->setDisabled(true);
294  $useProxy->setInfo($this->language->txt('conf_use_proxy_info_cmi5'));
295  }
296 
297  // $bypassProxy = new ilRadioGroupInputGUI($this->language->txt('conf_bypass_proxy'), 'bypass_proxy');
298  // $bypassProxy->setInfo($this->language->txt('conf_bypass_proxy_info'));
299  // $opt1 = new ilRadioOption($this->language->txt('conf_bypass_proxy_disabled'), "0");
300  // $bypassProxy->addOption($opt1);
301  // $opt2 = new ilRadioOption($this->language->txt('conf_bypass_proxy_enabled'), "1");
302  // $bypassProxy->addOption($opt2);
303  // $bypassProxy->setValue((string) ((int) $this->object->isBypassProxyEnabled()));
304  // //$bypassProxy->setValue((string) ((int) $this->object->getLrsType()->isBypassProxyEnabled()));
305  // $form->addItem($bypassProxy);
306  // if ($this->object->getLrsType()->isBypassProxyEnabled()) {
307  // $bypassProxy->setDisabled(true);
308  // }
309  $item = new ilCheckboxInputGUI($this->language->txt('only_moveon_label'), 'only_moveon');
310  $item->setInfo($this->language->txt('only_moveon_info'));
311  $item->setChecked($this->object->getOnlyMoveon());
312 
313  $subitem = new ilCheckboxInputGUI($this->language->txt('achieved_label'), 'achieved');
314  $subitem->setInfo($this->language->txt('achieved_info'));
315  $subitem->setChecked($this->object->getAchieved());
316  if ($this->object->getLrsType()->getForcePrivacySettings()) {
317  $subitem->setDisabled(true);
318  }
319  $item->addSubItem($subitem);
320 
321  $subitem = new ilCheckboxInputGUI($this->language->txt('answered_label'), 'answered');
322  $subitem->setInfo($this->language->txt('answered_info'));
323  $subitem->setChecked($this->object->getAnswered());
324  if ($this->object->getLrsType()->getForcePrivacySettings()) {
325  $subitem->setDisabled(true);
326  }
327  $item->addSubItem($subitem);
328 
329  $subitem = new ilCheckboxInputGUI($this->language->txt('completed_label'), 'completed');
330  $subitem->setInfo($this->language->txt('completed_info'));
331  $subitem->setChecked($this->object->getCompleted());
332  if ($this->object->getLrsType()->getForcePrivacySettings()) {
333  $subitem->setDisabled(true);
334  }
335  $item->addSubItem($subitem);
336 
337  $subitem = new ilCheckboxInputGUI($this->language->txt('failed_label'), 'failed');
338  $subitem->setInfo($this->language->txt('failed_info'));
339  $subitem->setChecked($this->object->getFailed());
340  if ($this->object->getLrsType()->getForcePrivacySettings()) {
341  $subitem->setDisabled(true);
342  }
343  $item->addSubItem($subitem);
344 
345  $subitem = new ilCheckboxInputGUI($this->language->txt('initialized_label'), 'initialized');
346  $subitem->setInfo($this->language->txt('initialized_info'));
347  $subitem->setChecked($this->object->getInitialized());
348  if ($this->object->getLrsType()->getForcePrivacySettings()) {
349  $subitem->setDisabled(true);
350  }
351  $item->addSubItem($subitem);
352 
353  $subitem = new ilCheckboxInputGUI($this->language->txt('passed_label'), 'passed');
354  $subitem->setInfo($this->language->txt('passed_info'));
355  $subitem->setChecked($this->object->getPassed());
356  if ($this->object->getLrsType()->getForcePrivacySettings()) {
357  $subitem->setDisabled(true);
358  }
359  $item->addSubItem($subitem);
360 
361  $subitem = new ilCheckboxInputGUI($this->language->txt('progressed_label'), 'progressed');
362  $subitem->setInfo($this->language->txt('progressed_info'));
363  $subitem->setChecked($this->object->getProgressed());
364  if ($this->object->getLrsType()->getForcePrivacySettings()) {
365  $subitem->setDisabled(true);
366  }
367  $item->addSubItem($subitem);
368  if ($this->object->getContentType() != ilObjCmiXapi::CONT_TYPE_CMI5) {
369  $subitem = new ilCheckboxInputGUI($this->language->txt('satisfied_label'), 'satisfied');
370  $subitem->setInfo($this->language->txt('satisfied_info'));
371  $subitem->setChecked($this->object->getSatisfied());
372  if ($this->object->getLrsType()->getForcePrivacySettings()) {
373  $subitem->setDisabled(true);
374  }
375  $item->addSubItem($subitem);
376 
377  $subitem = new ilCheckboxInputGUI($this->language->txt('terminated_label'), 'terminated');
378  $subitem->setInfo($this->language->txt('terminated_info'));
379  $subitem->setChecked($this->object->getTerminated());
380  if ($this->object->getLrsType()->getForcePrivacySettings()) {
381  $subitem->setDisabled(true);
382  }
383  $item->addSubItem($subitem);
384  }
385  if ($this->object->getLrsType()->getForcePrivacySettings()) {
386  $item->setDisabled(true);
387  }
388  $useProxy->addSubItem($item);
389 
390  $item = new ilCheckboxInputGUI($this->language->txt('hide_data_label'), 'hide_data');
391  $item->setInfo($this->language->txt('hide_data_info'));
392  $item->setChecked($this->object->getHideData());
393 
394  $subitem = new ilCheckboxInputGUI($this->language->txt('timestamp_label'), 'timestamp');
395  $subitem->setInfo($this->language->txt('timestamp_info'));
396  $subitem->setChecked($this->object->getTimestamp());
397  if ($this->object->getLrsType()->getForcePrivacySettings()) {
398  $subitem->setDisabled(true);
399  }
400  $item->addSubItem($subitem);
401 
402  $subitem = new ilCheckboxInputGUI($this->language->txt('duration_label'), 'duration');
403  $subitem->setInfo($this->language->txt('duration_info'));
404  $subitem->setChecked($this->object->getDuration());
405  if ($this->object->getLrsType()->getForcePrivacySettings()) {
406  $subitem->setDisabled(true);
407  }
408  $item->addSubItem($subitem);
409 
410  if ($this->object->getLrsType()->getForcePrivacySettings()) {
411  $item->setDisabled(true);
412  }
413  //$form->addItem($item);
414  $useProxy->addSubItem($item);
415 
416  $item = new ilCheckboxInputGUI($this->language->txt('no_substatements_label'), 'no_substatements');
417  $item->setInfo($this->language->txt('no_substatements_info'));
418  $item->setChecked($this->object->getNoSubstatements());
419  if ($this->object->getLrsType()->getForcePrivacySettings()) {
420  $item->setDisabled(true);
421  }
422  $useProxy->addSubItem($item);
423 
424  $form->addItem($useProxy);
425  // }
426 
427  $userIdent = new ilRadioGroupInputGUI($this->language->txt('conf_privacy_ident'), 'privacy_ident');
428  $op = new ilRadioOption(
429  $this->language->txt('conf_privacy_ident_il_uuid_user_id'),
431  );
432  $op->setInfo($this->language->txt('conf_privacy_ident_il_uuid_user_id_info'));
433  $userIdent->addOption($op);
434  $op = new ilRadioOption(
435  $this->language->txt('conf_privacy_ident_il_uuid_login'),
437  );
438  $op->setInfo($this->language->txt('conf_privacy_ident_il_uuid_login_info'));
439  $userIdent->addOption($op);
440  $op = new ilRadioOption(
441  $this->language->txt('conf_privacy_ident_il_uuid_ext_account'),
443  );
444  $op->setInfo($this->language->txt('conf_privacy_ident_il_uuid_ext_account_info'));
445  $userIdent->addOption($op);
446  $op = new ilRadioOption(
447  $this->language->txt('conf_privacy_ident_il_uuid_sha256'),
449  );
450  $op->setInfo($this->language->txt('conf_privacy_ident_il_uuid_sha256_info'));
451  $userIdent->addOption($op);
452  $op = new ilRadioOption(
453  $this->language->txt('conf_privacy_ident_il_uuid_sha256url'),
455  );
456  $op->setInfo($this->language->txt('conf_privacy_ident_il_uuid_sha256url_info'));
457  $userIdent->addOption($op);
458  $op = new ilRadioOption(
459  $this->language->txt('conf_privacy_ident_il_uuid_random'),
461  );
462  $op->setInfo($this->language->txt('conf_privacy_ident_il_uuid_random_info'));
463  $userIdent->addOption($op);
464  $op = new ilRadioOption(
465  $this->language->txt('conf_privacy_ident_real_email'),
467  );
468  $op->setInfo($this->language->txt('conf_privacy_ident_real_email_info'));
469  $userIdent->addOption($op);
470  $userIdent->setValue((string) $this->object->getPrivacyIdent());
471  $userIdent->setInfo(
472  $this->language->txt('conf_privacy_ident_info') . ' ' . ilCmiXapiUser::getIliasUuid()
473  );
474  $userIdent->setRequired(false);
475  $form->addItem($userIdent);
476 
477  $userName = new ilRadioGroupInputGUI($this->language->txt('conf_privacy_name'), 'privacy_name');
478  $op = new ilRadioOption(
479  $this->language->txt('conf_privacy_name_none'),
481  );
482  $op->setInfo($this->language->txt('conf_privacy_name_none_info'));
483  $userName->addOption($op);
484  $op = new ilRadioOption(
485  $this->language->txt('conf_privacy_name_firstname'),
487  );
488  $userName->addOption($op);
489  $op = new ilRadioOption(
490  $this->language->txt('conf_privacy_name_lastname'),
492  );
493  $userName->addOption($op);
494  $op = new ilRadioOption(
495  $this->language->txt('conf_privacy_name_fullname'),
497  );
498  $userName->addOption($op);
499  $userName->setValue((string) $this->object->getPrivacyName());
500  $userName->setInfo($this->language->txt('conf_privacy_name_info'));
501  $userName->setRequired(false);
502  $form->addItem($userName);
503 
504  if ($this->object->getLrsType()->getForcePrivacySettings()) {
505  $userIdent->setDisabled(true);
506  $userName->setDisabled(true);
507  }
508 
509  }
510 
511  $item = new ilRadioGroupInputGUI($this->language->txt('conf_delete_data'), 'delete_data');
512  $options = ["0","1","2","11","12"];
513  for ((int) $i = 0; $i < count($options); $i++) {
514  $op = new ilRadioOption($this->language->txt('conf_delete_data_opt' . $options[$i]), $options[$i]);
515  $item->addOption($op);
516  }
517  $item->setValue((string) $this->object->getDeleteData());
518  $item->setInfo($this->language->txt('conf_delete_data_info'));
519  $form->addItem($item);
520 
521 
522 
523  $item = new ilFormSectionHeaderGUI();
524  $item->setTitle($this->language->txt("log_options"));
525  $form->addItem($item);
526 
527  $item = new ilCheckboxInputGUI($this->language->txt('show_debug'), 'show_debug');
528  $item->setInfo($this->language->txt("show_debug_info"));
529  $item->setValue("1");
530  if ($this->object->isStatementsReportEnabled()) {
531  $item->setChecked(true);
532  }
533  $form->addItem($item);
534 
535  $highscore = new ilCheckboxInputGUI($this->language->txt("highscore_enabled"), "highscore_enabled");
536  $highscore->setValue("1");
537  $highscore->setChecked($this->object->getHighscoreEnabled());
538  $highscore->setInfo($this->language->txt("highscore_description"));
539  $form->addItem($highscore);
540  $highscore_tables = new ilRadioGroupInputGUI($this->language->txt('highscore_mode'), 'highscore_mode');
541  $highscore_tables->setRequired(true);
542  $highscore_tables->setValue((string) $this->object->getHighscoreMode());
543  $highscore_table_own = new ilRadioOption(
544  $this->language->txt('highscore_own_table'),
546  );
547  $highscore_table_own->setInfo($this->language->txt('highscore_own_table_description'));
548  $highscore_tables->addOption($highscore_table_own);
549  $highscore_table_other = new ilRadioOption(
550  $this->language->txt('highscore_top_table'),
552  );
553  $highscore_table_other->setInfo($this->language->txt('highscore_top_table_description'));
554  $highscore_tables->addOption($highscore_table_other);
555  $highscore_table_other = new ilRadioOption(
556  $this->language->txt('highscore_all_tables'),
558  );
559  $highscore_table_other->setInfo($this->language->txt('highscore_all_tables_description'));
560  $highscore_tables->addOption($highscore_table_other);
561  $highscore->addSubItem($highscore_tables);
562  $highscore_top_num = new ilNumberInputGUI($this->language->txt("highscore_top_num"), "highscore_top_num");
563  $highscore_top_num->setSize(4);
564  $highscore_top_num->setRequired(true);
565  $highscore_top_num->setMinValue(1);
566  $highscore_top_num->setSuffix($this->language->txt("highscore_top_num_unit"));
567  $highscore_top_num->setValue((string) $this->object->getHighscoreTopNum(null));
568  $highscore_top_num->setInfo($this->language->txt("highscore_top_num_description"));
569  $highscore->addSubItem($highscore_top_num);
570  $highscore_achieved_ts = new ilCheckboxInputGUI($this->language->txt("highscore_achieved_ts"), "highscore_achieved_ts");
571  $highscore_achieved_ts->setValue("1");
572  $highscore_achieved_ts->setChecked($this->object->getHighscoreAchievedTS());
573  $highscore_achieved_ts->setInfo($this->language->txt("highscore_achieved_ts_description"));
574  $highscore->addSubItem($highscore_achieved_ts);
575  $highscore_percentage = new ilCheckboxInputGUI($this->language->txt("highscore_percentage"), "highscore_percentage");
576  $highscore_percentage->setValue("1");
577  $highscore_percentage->setChecked($this->object->getHighscorePercentage());
578  $highscore_percentage->setInfo($this->language->txt("highscore_percentage_description"));
579  $highscore->addSubItem($highscore_percentage);
580  $highscore_wtime = new ilCheckboxInputGUI($this->language->txt("highscore_wtime"), "highscore_wtime");
581  $highscore_wtime->setValue("1");
582  $highscore_wtime->setChecked($this->object->getHighscoreWTime());
583  $highscore_wtime->setInfo($this->language->txt("highscore_wtime_description"));
584  $highscore->addSubItem($highscore_wtime);
585 
586 
587  $form->setTitle($this->language->txt('settings'));
588  $form->addCommandButton(self::CMD_SAVE, $this->language->txt("save"));
589  $form->addCommandButton(self::CMD_SHOW, $this->language->txt("cancel"));
590 
591  return $form;
592  }
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This class represents a property form user interface.
setInfo(string $a_info)
This class represents a property in a property form.
setValue(string $a_value)
setRequired(bool $a_required)
This class represents a text area property in a property form.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ deliverCertificateCmd()

ilCmiXapiSettingsGUI::deliverCertificateCmd ( )
protected

Definition at line 689 of file class.ilCmiXapiSettingsGUI.php.

References ilObjCmiXapiGUI\CMD_INFO_SCREEN, ilCertificatePdfAction\downloadPdf(), and ILIAS\UI\examples\Symbol\Glyph\Language\language().

689  : void
690  {
691  $validator = new ilCertificateDownloadValidator();
692 
693  if (!$validator->isCertificateDownloadable((int) $this->dic->user()->getId(), $this->object->getId())) {
694  $this->main_tpl->setOnScreenMessage('failure', $this->language->txt("permission_denied"), true);
695  $this->dic->ctrl()->redirectByClass(ilObjCmiXapiGUI::class, ilObjCmiXapiGUI::CMD_INFO_SCREEN);
696  }
697 
698  $repository = new ilUserCertificateRepository();
699 
700  $certLogger = $this->dic->logger()->root();//->cert();
701  $pdfGenerator = new ilPdfGenerator($repository);
702 
703  $pdfAction = new ilCertificatePdfAction(
704  $pdfGenerator,
706  $this->language->txt('error_creating_certificate_pdf')
707  );
708 
709  $pdfAction->downloadPdf((int) $this->dic->user()->getId(), $this->object->getId());
710  }
Validates if an active certificate is stored in the database and can be downloaded by the user...
Just a wrapper class to create Unit Test for other classes.
downloadPdf(int $userId, int $objectId)
+ Here is the call graph for this function:

◆ executeCommand()

ilCmiXapiSettingsGUI::executeCommand ( )

Definition at line 80 of file class.ilCmiXapiSettingsGUI.php.

References initSubtabs().

80  : void
81  {
82  $this->initSubtabs();
83 
84  switch ($this->dic->ctrl()->getNextClass()) {
85  case strtolower(ilCertificateGUI::class):
86 
87  $validator = new ilCertificateActiveValidator();
88 
89  if (!$validator->validate()) {
90  throw new ilCmiXapiException('access denied!');
91  }
92 
93  $this->dic->tabs()->activateSubTab(self::SUBTAB_ID_CERTIFICATE);
94 
95  $guiFactory = new ilCertificateGUIFactory();
96  $gui = $guiFactory->create($this->object);
97 
98  $this->dic->ctrl()->forwardCommand($gui);
99 
100  break;
101 
102  default:
103  $command = $this->dic->ctrl()->getCmd(self::DEFAULT_CMD) . 'Cmd';
104  $this->{$command}();
105  }
106  }
+ Here is the call graph for this function:

◆ initSubtabs()

ilCmiXapiSettingsGUI::initSubtabs ( )

Definition at line 61 of file class.ilCmiXapiSettingsGUI.php.

References ILIAS\UI\examples\Symbol\Glyph\Language\language().

Referenced by executeCommand().

61  : void
62  {
63  $this->dic->tabs()->addSubTab(
64  self::SUBTAB_ID_SETTINGS,
65  $this->language->txt(self::SUBTAB_ID_SETTINGS),
66  $this->dic->ctrl()->getLinkTarget($this, self::CMD_SHOW)
67  );
68 
69  $validator = new ilCertificateActiveValidator();
70 
71  if ($validator->validate()) {
72  $this->dic->tabs()->addSubTab(
73  self::SUBTAB_ID_CERTIFICATE,
74  $this->language->txt(self::SUBTAB_ID_CERTIFICATE),
75  $this->dic->ctrl()->getLinkTargetByClass([ilCmiXapiSettingsGUI::class,ilCertificateGUI::class], 'certificateEditor')
76  );
77  }
78  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ saveCmd()

ilCmiXapiSettingsGUI::saveCmd ( )
protected

Definition at line 108 of file class.ilCmiXapiSettingsGUI.php.

References buildForm(), ILIAS\UI\examples\Symbol\Glyph\Language\language(), saveSettings(), and showCmd().

108  : void
109  {
110  $form = $this->buildForm();
111 
112  if ($form->checkInput()) {
113  $this->saveSettings($form);
114 
115  $this->main_tpl->setOnScreenMessage('success', $this->language->txt('msg_obj_modified'), true);
116  $this->dic->ctrl()->redirect($this, self::CMD_SHOW);
117  }
118 
119  $this->showCmd($form);
120  }
saveSettings(ilPropertyFormGUI $form)
showCmd(ilPropertyFormGUI $form=null)
+ Here is the call graph for this function:

◆ saveSettings()

ilCmiXapiSettingsGUI::saveSettings ( ilPropertyFormGUI  $form)
protected

Definition at line 594 of file class.ilCmiXapiSettingsGUI.php.

References ilObjCmiXapi\CONT_TYPE_CMI5, ilPropertyFormGUI\getInput(), ilObjCmiXapi\LAUNCH_MODE_NORMAL, and ILIAS\Repository\object().

Referenced by saveCmd().

594  : void
595  {
596  $this->object->setTitle($form->getInput('title'));
597  $this->object->setDescription($form->getInput('description'));
598 
599  $this->object->setActivityId($form->getInput('activity_id'));
600  $this->object->setOfflineStatus(!(bool) $form->getInput('online'));
601 
602  if (!$this->object->isSourceTypeExternal()) {
603  $this->object->setLaunchMethod($form->getInput('display'));
604 
605  $this->object->setLaunchMode($form->getInput('launch_mode'));
606 
607  if ($this->object->getLaunchMode() == ilObjCmiXapi::LAUNCH_MODE_NORMAL) {
608  if ($this->object->getContentType() == ilObjCmiXapi::CONT_TYPE_CMI5) {
609  $this->object->setMasteryScorePercent($form->getInput('mastery_score'));
610  }
611  $this->object->setKeepLpStatusEnabled((bool) $form->getInput('avoid_lp_deterioration'));
612  $this->object->setSwitchToReviewEnabled((bool) $form->getInput('switch_to_review'));
613  } else {
614  $this->object->setKeepLpStatusEnabled(true);
615  $this->object->setSwitchToReviewEnabled(false);
616  }
617 
618  if ($this->object->isSourceTypeRemote()) {
619  $this->object->setLaunchUrl($form->getInput('launch_url'));
620  }
621 
622  if ($this->object->getContentType() == ilObjCmiXapi::CONT_TYPE_CMI5) {
623  $this->object->setAuthFetchUrlEnabled(true);
624  } else {
625  $this->object->setAuthFetchUrlEnabled((bool) $form->getInput('use_fetch'));
626  }
627 
628  // if (!$this->object->getLrsType()->isBypassProxyEnabled()) {
629  if ($this->object->getContentType() == ilObjCmiXapi::CONT_TYPE_CMI5) {
630  $this->object->setBypassProxyEnabled(false);
631  } else {
632  // $this->object->setBypassProxyEnabled((bool) $form->getInput('bypass_proxy'));
633  if ((bool) $form->getInput("use_proxy") == false) {
634  $this->object->setBypassProxyEnabled(true);
635  } else {
636  $this->object->setBypassProxyEnabled(false);
637  }
638  }
639  // }
640 
641  if (!$this->object->getLrsType()->getForcePrivacySettings()) {
642  $this->object->setPrivacyIdent((int) $form->getInput('privacy_ident'));
643  $this->object->setPrivacyName((int) $form->getInput('privacy_name'));
644  $this->object->setOnlyMoveon((bool) $form->getInput("only_moveon"));
645  $this->object->setAchieved((bool) $form->getInput("achieved"));
646  $this->object->setAnswered((bool) $form->getInput("answered"));
647  $this->object->setCompleted((bool) $form->getInput("completed"));
648  $this->object->setFailed((bool) $form->getInput("failed"));
649  $this->object->setInitialized((bool) $form->getInput("initialized"));
650  $this->object->setPassed((bool) $form->getInput("passed"));
651  $this->object->setProgressed((bool) $form->getInput("progressed"));
652  if ($this->object->getContentType() == ilObjCmiXapi::CONT_TYPE_CMI5) {
653  $this->object->setSatisfied(true);
654  $this->object->setTerminated(true);
655  } else {
656  $this->object->setSatisfied((bool) $form->getInput("satisfied"));
657  $this->object->setTerminated((bool) $form->getInput("terminated"));
658  }
659  $this->object->setHideData((bool) $form->getInput("hide_data"));
660  $this->object->setTimestamp((bool) $form->getInput("timestamp"));
661  $this->object->setDuration((bool) $form->getInput("duration"));
662  $this->object->setNoSubstatements((bool) $form->getInput("no_substatements"));
663  $this->object->setDeleteData((int) $form->getInput("delete_data"));
664  }
665  } else { //SourceTypeExternal
666  $this->object->setBypassProxyEnabled(true);
667  $this->object->setKeepLpStatusEnabled((bool) $form->getInput('avoid_lp_deterioration'));
668  }
669 
670  $this->object->setStatementsReportEnabled((bool) $form->getInput('show_debug'));
671 
672  $this->object->setHighscoreEnabled((bool) $form->getInput('highscore_enabled'));
673  if ($this->object->getHighscoreEnabled()) {
674  // highscore settings
675  $this->object->setHighscoreEnabled((bool) $form->getInput('highscore_enabled'));
676  $this->object->setHighscoreAchievedTS((bool) $form->getInput('highscore_achieved_ts'));
677  $this->object->setHighscorePercentage((bool) $form->getInput('highscore_percentage'));
678  $this->object->setHighscoreWTime((bool) $form->getInput('highscore_wtime'));
679  $this->object->setHighscoreMode((int) $form->getInput('highscore_mode'));
680  $this->object->setHighscoreTopNum((int) $form->getInput('highscore_top_num'));
681  }
682 
683  // tile image
684  $this->dic->object()->commonSettings()->legacyForm($form, $this->object)->saveTileImage();
685 
686  $this->object->update();
687  }
getInput(string $a_post_var, bool $ensureValidation=true)
Returns the input of an item, if item provides getInput method and as fallback the value of the HTTP-...
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ showCmd()

ilCmiXapiSettingsGUI::showCmd ( ilPropertyFormGUI  $form = null)
protected

Definition at line 122 of file class.ilCmiXapiSettingsGUI.php.

References buildForm(), and ILIAS\Repository\object().

Referenced by saveCmd().

122  : void
123  {
124  if ($this->dic->access()->checkAccess("write", "", $this->object->getRefId())) {
125  $this->dic->tabs()->activateSubTab(self::SUBTAB_ID_SETTINGS);
126  $form = $this->buildForm();
127  $this->dic->ui()->mainTemplate()->setContent($form->getHTML());
128  } else {
129  $this->main_tpl->setOnScreenMessage('failure', $this->dic->language()->txt('permission_denied'), false);
130  }
131  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $dic

ILIAS DI Container ilCmiXapiSettingsGUI::$dic
private

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

◆ $language

ilLanguage ilCmiXapiSettingsGUI::$language
private

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

◆ $main_tpl

ilGlobalTemplateInterface ilCmiXapiSettingsGUI::$main_tpl
private

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

◆ $object

ilObjCmiXapi ilCmiXapiSettingsGUI::$object
protected

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

Referenced by __construct().

◆ CMD_DELIVER_CERTIFICATE

const ilCmiXapiSettingsGUI::CMD_DELIVER_CERTIFICATE = 'deliverCertificate'

◆ CMD_SAVE

const ilCmiXapiSettingsGUI::CMD_SAVE = 'save'

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

◆ CMD_SHOW

const ilCmiXapiSettingsGUI::CMD_SHOW = 'show'

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

◆ DEFAULT_CMD

const ilCmiXapiSettingsGUI::DEFAULT_CMD = self::CMD_SHOW

Definition at line 39 of file class.ilCmiXapiSettingsGUI.php.

◆ SUBTAB_ID_CERTIFICATE

const ilCmiXapiSettingsGUI::SUBTAB_ID_CERTIFICATE = 'certificate'

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

◆ SUBTAB_ID_SETTINGS

const ilCmiXapiSettingsGUI::SUBTAB_ID_SETTINGS = 'settings'

Definition at line 41 of file class.ilCmiXapiSettingsGUI.php.


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