46 $DIC->tabs()->addSubTab(
47 self::SUBTAB_ID_SETTINGS,
48 $DIC->language()->txt(self::SUBTAB_ID_SETTINGS),
49 $DIC->ctrl()->getLinkTarget($this, self::CMD_SHOW)
54 if ($validator->validate()) {
55 $DIC->tabs()->addSubTab(
56 self::SUBTAB_ID_CERTIFICATE,
57 $DIC->language()->txt(self::SUBTAB_ID_CERTIFICATE),
58 $DIC->ctrl()->getLinkTargetByClass(ilCertificateGUI::class,
'certificateEditor')
69 switch ($DIC->ctrl()->getNextClass()) {
70 case strtolower(ilCertificateGUI::class):
74 if (!$validator->validate()) {
78 $DIC->tabs()->activateSubTab(self::SUBTAB_ID_CERTIFICATE);
81 $gui = $guiFactory->create($this->
object);
83 $DIC->ctrl()->forwardCommand($gui);
88 $command = $DIC->ctrl()->getCmd(self::DEFAULT_CMD) .
'Cmd';
99 if ($form->checkInput()) {
102 ilUtil::sendSuccess($DIC->language()->txt(
'msg_obj_modified'),
true);
103 $DIC->ctrl()->redirect($this, self::CMD_SHOW);
113 $DIC->tabs()->activateSubTab(self::SUBTAB_ID_SETTINGS);
117 $DIC->ui()->mainTemplate()->setContent($form->getHTML());
125 include_once(
"./Services/Form/classes/class.ilPropertyFormGUI.php");
127 $form->setFormAction($DIC->ctrl()->getFormAction($this));
130 $ne->
setValue($DIC->language()->txt(
'type_'.$this->object->getContentType()));
134 $ne->
setValue($this->object->getLrsType()->getTitle());
137 $item =
new ilTextInputGUI($DIC->language()->txt(
'title'),
'title');
139 $item->setMaxLength(128);
140 $item->setRequired(
true);
141 $item->setInfo($DIC->language()->txt(
'title_info'));
142 $item->setValue($this->object->getTitle());
143 $form->addItem($item);
146 $item->
setInfo($DIC->language()->txt(
'description_info'));
149 $item->setValue($this->object->getDescription());
150 $form->addItem($item);
152 $item =
new ilTextInputGUI($DIC->language()->txt(
'activity_id'),
'activity_id');
153 $item->setRequired(
true);
155 $item->setMaxLength(128);
157 $item->setInfo($DIC->language()->txt(
'activity_id_info'));
158 $item->setValue($this->object->getActivityId());
159 $form->addItem($item);
162 $item->
setInfo($DIC->language()->txt(
"online_info"));
163 $item->setValue(
"1");
164 if (!$this->object->getOfflineStatus()) {
165 $item->setChecked(
true);
167 $form->addItem($item);
169 if (!$this->object->isSourceTypeExternal()) {
171 $item->setTitle($DIC->language()->txt(
"launch_options"));
172 $form->addItem($item);
174 if ($this->object->isSourceTypeRemote()) {
175 $item =
new ilTextInputGUI($DIC->language()->txt(
'launch_url'),
'launch_url');
177 $item->setMaxLength(128);
178 $item->setRequired(
true);
179 $item->setInfo($DIC->language()->txt(
'launch_url_info'));
180 $item->setValue($this->object->getLaunchUrl());
181 $form->addItem($item);
186 $item->
setInfo($DIC->language()->txt(
"use_fetch_info"));
187 $item->setValue(
"1");
189 if ($this->object->isAuthFetchUrlEnabled()) {
190 $item->setChecked(
true);
192 $form->addItem($item);
197 $display->setValue($this->object->getLaunchMethod());
199 $optOwnWindow->
setInfo($DIC->language()->txt(
'conf_own_window_info'));
200 $display->addOption($optOwnWindow);
202 $optAnyWindow->
setInfo($DIC->language()->txt(
'conf_new_window_info'));
203 $display->addOption($optAnyWindow);
204 $form->addItem($display);
206 $launchMode =
new ilRadioGroupInputGUI($DIC->language()->txt(
'conf_launch_mode'),
'launch_mode');
208 $launchMode->setValue($this->object->getLaunchMode());
210 $optNormal->
setInfo($DIC->language()->txt(
'conf_launch_mode_normal_info'));
211 $launchMode->addOption($optNormal);
213 $optBrowse->
setInfo($DIC->language()->txt(
'conf_launch_mode_browse_info'));
214 $launchMode->addOption($optBrowse);
216 $optReview->
setInfo($DIC->language()->txt(
'conf_launch_mode_review_info'));
217 $launchMode->addOption($optReview);
218 $form->addItem($launchMode);
221 $lpDeterioration =
new ilCheckboxInputGUI($DIC->language()->txt(
'conf_keep_lp'),
'avoid_lp_deterioration');
222 $lpDeterioration->
setInfo($DIC->language()->txt(
'conf_keep_lp_info'));
223 if ($this->object->isKeepLpStatusEnabled()) {
224 $lpDeterioration->setChecked(
true);
226 if (!$this->object->isSourceTypeExternal()) {
227 $optNormal->addSubItem($lpDeterioration);
229 $form->addItem($lpDeterioration);
233 $switchMode =
new ilCheckboxInputGUI($DIC->language()->txt(
'conf_switch_to_review'),
'switch_to_review');
234 $switchMode->
setInfo($DIC->language()->txt(
"conf_switch_to_review_info"));
235 if ($this->object->isSwitchToReviewEnabled()) {
236 $switchMode->setChecked(
true);
238 $optNormal->addSubItem($switchMode);
240 $masteryScore =
new ilNumberInputGUI($DIC->language()->txt(
'conf_mastery_score'),
'mastery_score');
241 $masteryScore->
setInfo($DIC->language()->txt(
'conf_mastery_score_info'));
242 $masteryScore->setSuffix(
'%');
243 $masteryScore->allowDecimals(
true);
244 $masteryScore->setDecimals(2);
245 $masteryScore->setMinvalueShouldBeGreater(
false);
246 $masteryScore->setMinValue(0);
247 $masteryScore->setMaxvalueShouldBeLess(
false);
248 $masteryScore->setMaxValue(100);
249 $masteryScore->setSize(4);
250 if (empty($this->object->getMasteryScore())) {
253 $masteryScore->setValue($this->object->getMasteryScorePercent());
254 $optNormal->addSubItem($masteryScore);
257 if (!$this->object->isSourceTypeExternal()) {
260 $sectionHeader->setTitle($DIC->language()->txt(
'sect_learning_progress_options'));
261 $form->addItem($sectionHeader);
262 $bypassProxy =
new ilRadioGroupInputGUI($DIC->language()->txt(
'conf_bypass_proxy'),
'bypass_proxy');
263 $bypassProxy->
setInfo($DIC->language()->txt(
'conf_bypass_proxy_info'));
264 $bypassProxy->setValue($this->object->isBypassProxyEnabled());
265 $opt1 =
new ilRadioOption($DIC->language()->txt(
'conf_bypass_proxy_disabled'), 0);
266 $bypassProxy->addOption($opt1);
267 $opt2 =
new ilRadioOption($DIC->language()->txt(
'conf_bypass_proxy_enabled'), 1);
268 $bypassProxy->addOption($opt2);
269 $form->addItem($bypassProxy);
270 if ($this->object->getLrsType()->isBypassProxyEnabled()) {
276 $item->setTitle($DIC->language()->txt(
"privacy_options"));
277 $form->addItem($item);
279 $userIdent =
new ilRadioGroupInputGUI($DIC->language()->txt(
'conf_privacy_ident'),
'privacy_ident');
281 $DIC->language()->txt(
'conf_privacy_ident_il_uuid_user_id'),
284 $op->
setInfo($DIC->language()->txt(
'conf_privacy_ident_il_uuid_user_id_info'));
285 $userIdent->addOption($op);
287 $DIC->language()->txt(
'conf_privacy_ident_il_uuid_login'),
290 $op->
setInfo($DIC->language()->txt(
'conf_privacy_ident_il_uuid_login_info'));
291 $userIdent->addOption($op);
293 $DIC->language()->txt(
'conf_privacy_ident_il_uuid_ext_account'),
296 $op->
setInfo($DIC->language()->txt(
'conf_privacy_ident_il_uuid_ext_account_info'));
297 $userIdent->addOption($op);
299 $DIC->language()->txt(
'conf_privacy_ident_il_uuid_SHA256'),
302 $op->
setInfo($DIC->language()->txt(
'conf_privacy_ident_il_uuid_SHA256_info'));
303 $userIdent->addOption($op);
305 $DIC->language()->txt(
'conf_privacy_ident_il_uuid_random'),
308 $op->
setInfo($DIC->language()->txt(
'conf_privacy_ident_il_uuid_random_info'));
309 $userIdent->addOption($op);
311 $DIC->language()->txt(
'conf_privacy_ident_real_email'),
314 $op->
setInfo($DIC->language()->txt(
'conf_privacy_ident_real_email_info'));
315 $userIdent->addOption($op);
316 $userIdent->setValue($this->object->getPrivacyIdent());
320 $userIdent->setRequired(
false);
321 $form->addItem($userIdent);
323 $userName =
new ilRadioGroupInputGUI($DIC->language()->txt(
'conf_privacy_name'),
'privacy_name');
325 $op->
setInfo($DIC->language()->txt(
'conf_privacy_name_none_info'));
326 $userName->addOption($op);
328 $op->
setInfo($DIC->language()->txt(
'conf_privacy_name_firstname_info'));
329 $userName->addOption($op);
331 $op->
setInfo($DIC->language()->txt(
'conf_privacy_name_lastname_info'));
332 $userName->addOption($op);
334 $op->
setInfo($DIC->language()->txt(
'conf_privacy_name_fullname_info'));
335 $userName->addOption($op);
336 $userName->setValue($this->object->getPrivacyName());
337 $userName->setInfo($DIC->language()->txt(
'conf_privacy_name_info'));
338 $userName->setRequired(
false);
339 $form->addItem($userName);
341 if ($this->object->getLrsType()->getForcePrivacySettings()) {
342 $userIdent->setDisabled(
true);
343 $userName->setDisabled(
true);
346 $item =
new ilCheckboxInputGUI($DIC->language()->txt(
'only_moveon_label'),
'only_moveon');
347 $item->
setInfo($DIC->language()->txt(
'only_moveon_info'));
348 $item->setChecked($this->object->getOnlyMoveon());
350 $subitem =
new ilCheckboxInputGUI($DIC->language()->txt(
'achieved_label'),
'achieved');
351 $subitem->
setInfo($DIC->language()->txt(
'achieved_info'));
352 $subitem->setChecked($this->object->getAchieved());
353 if ($this->object->getLrsType()->getForcePrivacySettings()) $subitem->setDisabled(
true);
354 $item->addSubItem($subitem);
356 $subitem =
new ilCheckboxInputGUI($DIC->language()->txt(
'answered_label'),
'answered');
357 $subitem->
setInfo($DIC->language()->txt(
'answered_info'));
358 $subitem->setChecked($this->object->getAnswered());
359 if ($this->object->getLrsType()->getForcePrivacySettings()) $subitem->setDisabled(
true);
360 $item->addSubItem($subitem);
362 $subitem =
new ilCheckboxInputGUI($DIC->language()->txt(
'completed_label'),
'completed');
363 $subitem->
setInfo($DIC->language()->txt(
'completed_info'));
364 $subitem->setChecked($this->object->getCompleted());
365 if ($this->object->getLrsType()->getForcePrivacySettings()) $subitem->setDisabled(
true);
366 $item->addSubItem($subitem);
369 $subitem->
setInfo($DIC->language()->txt(
'failed_info'));
370 $subitem->setChecked($this->object->getFailed());
371 if ($this->object->getLrsType()->getForcePrivacySettings()) $subitem->setDisabled(
true);
372 $item->addSubItem($subitem);
374 $subitem =
new ilCheckboxInputGUI($DIC->language()->txt(
'initialized_label'),
'initialized');
375 $subitem->
setInfo($DIC->language()->txt(
'initialized_info'));
376 $subitem->setChecked($this->object->getInitialized());
377 if ($this->object->getLrsType()->getForcePrivacySettings()) $subitem->setDisabled(
true);
378 $item->addSubItem($subitem);
381 $subitem->
setInfo($DIC->language()->txt(
'passed_info'));
382 $subitem->setChecked($this->object->getPassed());
383 if ($this->object->getLrsType()->getForcePrivacySettings()) $subitem->setDisabled(
true);
384 $item->addSubItem($subitem);
386 $subitem =
new ilCheckboxInputGUI($DIC->language()->txt(
'progressed_label'),
'progressed');
387 $subitem->
setInfo($DIC->language()->txt(
'progressed_info'));
388 $subitem->setChecked($this->object->getProgressed());
389 if ($this->object->getLrsType()->getForcePrivacySettings()) $subitem->setDisabled(
true);
390 $item->addSubItem($subitem);
392 $subitem =
new ilCheckboxInputGUI($DIC->language()->txt(
'satisfied_label'),
'satisfied');
393 $subitem->
setInfo($DIC->language()->txt(
'satisfied_info'));
394 $subitem->setChecked($this->object->getSatisfied());
395 if ($this->object->getLrsType()->getForcePrivacySettings()) $subitem->setDisabled(
true);
396 $item->addSubItem($subitem);
398 $subitem =
new ilCheckboxInputGUI($DIC->language()->txt(
'terminated_label'),
'terminated');
399 $subitem->
setInfo($DIC->language()->txt(
'terminated_info'));
400 $subitem->setChecked($this->object->getTerminated());
401 if ($this->object->getLrsType()->getForcePrivacySettings()) $subitem->setDisabled(
true);
402 $item->addSubItem($subitem);
404 if ($this->object->getLrsType()->getForcePrivacySettings()) $item->setDisabled(
true);
405 $form->addItem($item);
407 $item =
new ilCheckboxInputGUI($DIC->language()->txt(
'hide_data_label'),
'hide_data');
408 $item->
setInfo($DIC->language()->txt(
'hide_data_info'));
409 $item->setChecked($this->object->getHideData());
411 $subitem =
new ilCheckboxInputGUI($DIC->language()->txt(
'timestamp_label'),
'timestamp');
412 $subitem->
setInfo($DIC->language()->txt(
'timestamp_info'));
413 $subitem->setChecked($this->object->getTimestamp());
414 if ($this->object->getLrsType()->getForcePrivacySettings()) $subitem->setDisabled(
true);
415 $item->addSubItem($subitem);
417 $subitem =
new ilCheckboxInputGUI($DIC->language()->txt(
'duration_label'),
'duration');
418 $subitem->
setInfo($DIC->language()->txt(
'duration_info'));
419 $subitem->setChecked($this->object->getDuration());
420 if ($this->object->getLrsType()->getForcePrivacySettings()) $subitem->setDisabled(
true);
421 $item->addSubItem($subitem);
423 if ($this->object->getLrsType()->getForcePrivacySettings()) $item->setDisabled(
true);
424 $form->addItem($item);
426 $item =
new ilCheckboxInputGUI($DIC->language()->txt(
'no_substatements_label'),
'no_substatements');
427 $item->
setInfo($DIC->language()->txt(
'no_substatements_info'));
428 $item->setChecked($this->object->getNoSubstatements());
429 if ($this->object->getLrsType()->getForcePrivacySettings()) $item->setDisabled(
true);
430 $form->addItem($item);
435 $item->setTitle($DIC->language()->txt(
"log_options"));
436 $form->addItem($item);
439 $item->
setInfo($DIC->language()->txt(
"show_debug_info"));
440 $item->setValue(
"1");
441 if ($this->object->isStatementsReportEnabled()) {
442 $item->setChecked(
true);
444 $form->addItem($item);
446 $highscore =
new ilCheckboxInputGUI($DIC->language()->txt(
"highscore_enabled"),
"highscore_enabled");
448 $highscore->setChecked($this->object->getHighscoreEnabled());
449 $highscore->setInfo($DIC->language()->txt(
"highscore_description"));
450 $form->addItem($highscore);
451 $highscore_tables =
new ilRadioGroupInputGUI($DIC->language()->txt(
'highscore_mode'),
'highscore_mode');
453 $highscore_tables->setValue($this->object->getHighscoreMode());
455 $highscore_table_own->
setInfo($DIC->language()->txt(
'highscore_own_table_description'));
456 $highscore_tables->addOption($highscore_table_own);
458 $highscore_table_other->
setInfo($DIC->language()->txt(
'highscore_top_table_description'));
459 $highscore_tables->addOption($highscore_table_other);
461 $highscore_table_other->
setInfo($DIC->language()->txt(
'highscore_all_tables_description'));
462 $highscore_tables->addOption($highscore_table_other);
463 $highscore->addSubItem($highscore_tables);
464 $highscore_top_num =
new ilNumberInputGUI($DIC->language()->txt(
"highscore_top_num"),
"highscore_top_num");
465 $highscore_top_num->
setSize(4);
466 $highscore_top_num->setRequired(
true);
467 $highscore_top_num->setMinValue(1);
468 $highscore_top_num->setSuffix($DIC->language()->txt(
"highscore_top_num_unit"));
469 $highscore_top_num->setValue($this->object->getHighscoreTopNum(null));
470 $highscore_top_num->setInfo($DIC->language()->txt(
"highscore_top_num_description"));
471 $highscore->addSubItem($highscore_top_num);
472 $highscore_achieved_ts =
new ilCheckboxInputGUI($DIC->language()->txt(
"highscore_achieved_ts"),
"highscore_achieved_ts");
473 $highscore_achieved_ts->
setValue(1);
474 $highscore_achieved_ts->setChecked($this->object->getHighscoreAchievedTS());
475 $highscore_achieved_ts->setInfo($DIC->language()->txt(
"highscore_achieved_ts_description"));
476 $highscore->addSubItem($highscore_achieved_ts);
477 $highscore_percentage =
new ilCheckboxInputGUI($DIC->language()->txt(
"highscore_percentage"),
"highscore_percentage");
479 $highscore_percentage->setChecked($this->object->getHighscorePercentage());
480 $highscore_percentage->setInfo($DIC->language()->txt(
"highscore_percentage_description"));
481 $highscore->addSubItem($highscore_percentage);
482 $highscore_wtime =
new ilCheckboxInputGUI($DIC->language()->txt(
"highscore_wtime"),
"highscore_wtime");
484 $highscore_wtime->setChecked($this->object->getHighscoreWTime());
485 $highscore_wtime->setInfo($DIC->language()->txt(
"highscore_wtime_description"));
486 $highscore->addSubItem($highscore_wtime);
489 $form->setTitle($DIC->language()->txt(
'settings'));
490 $form->addCommandButton(self::CMD_SAVE, $DIC->language()->txt(
"save"));
491 $form->addCommandButton(self::CMD_SHOW, $DIC->language()->txt(
"cancel"));
498 $this->
object->setTitle($form->
getInput(
'title'));
499 $this->
object->setDescription($form->
getInput(
'description'));
501 $this->
object->setActivityId($form->
getInput(
'activity_id'));
502 $this->
object->setOfflineStatus(!(
bool) $form->
getInput(
'online'));
504 if (!$this->object->isSourceTypeExternal()) {
505 $this->
object->setLaunchMethod($form->
getInput(
'display'));
507 $this->
object->setLaunchMode($form->
getInput(
'launch_mode'));
511 $this->
object->setMasteryScorePercent($form->
getInput(
'mastery_score'));
513 $this->
object->setKeepLpStatusEnabled((
bool) $form->
getInput(
'avoid_lp_deterioration'));
514 $this->
object->setSwitchToReviewEnabled((
bool) $form->
getInput(
'switch_to_review'));
517 $this->
object->setKeepLpStatusEnabled(
true);
518 $this->
object->setSwitchToReviewEnabled(
false);
521 if ($this->object->isSourceTypeRemote()) {
522 $this->
object->setLaunchUrl($form->
getInput(
'launch_url'));
526 $this->
object->setAuthFetchUrlEnabled(
true);
528 $this->
object->setAuthFetchUrlEnabled((
bool) $form->
getInput(
'use_fetch'));
531 if (!$this->object->getLrsType()->isBypassProxyEnabled()) {
533 $this->
object->setBypassProxyEnabled(
false);
536 $this->
object->setBypassProxyEnabled((
bool) $form->
getInput(
'bypass_proxy'));
540 if (!$this->object->getLrsType()->getForcePrivacySettings()) {
541 $this->
object->setPrivacyIdent($form->
getInput(
'privacy_ident'));
542 $this->
object->setPrivacyName($form->
getInput(
'privacy_name'));
543 $this->
object->setOnlyMoveon((
bool)$form->
getInput(
"only_moveon"));
544 $this->
object->setAchieved((
bool)$form->
getInput(
"achieved"));
545 $this->
object->setAnswered((
bool)$form->
getInput(
"answered"));
546 $this->
object->setCompleted((
bool)$form->
getInput(
"completed"));
547 $this->
object->setFailed((
bool)$form->
getInput(
"failed"));
548 $this->
object->setInitialized((
bool)$form->
getInput(
"initialized"));
549 $this->
object->setPassed((
bool)$form->
getInput(
"passed"));
550 $this->
object->setProgressed((
bool)$form->
getInput(
"progressed"));
552 $this->
object->setSatisfied(
true);
553 $this->
object->setTerminated(
true);
555 $this->
object->setSatisfied((
bool)$form->
getInput(
"satisfied"));
556 $this->
object->setTerminated((
bool)$form->
getInput(
"terminated"));
558 $this->
object->setHideData((
bool)$form->
getInput(
"hide_data"));
559 $this->
object->setTimestamp((
bool)$form->
getInput(
"timestamp"));
560 $this->
object->setDuration((
bool)$form->
getInput(
"duration"));
561 $this->
object->setNoSubstatements((
bool)$form->
getInput(
"no_substatements"));
564 $this->
object->setBypassProxyEnabled(
true);
565 $this->
object->setKeepLpStatusEnabled((
bool) $form->
getInput(
'avoid_lp_deterioration'));
568 $this->
object->setStatementsReportEnabled((
bool) $form->
getInput(
'show_debug'));
570 $this->
object->setHighscoreEnabled((
bool) $form->
getInput(
'highscore_enabled'));
571 if ($this->object->getHighscoreEnabled()) {
573 $this->
object->setHighscoreEnabled((
bool) $form->
getInput(
'highscore_enabled'));
574 $this->
object->setHighscoreAchievedTS((
bool) $form->
getInput(
'highscore_achieved_ts'));
575 $this->
object->setHighscorePercentage((
bool) $form->
getInput(
'highscore_percentage'));
576 $this->
object->setHighscoreWTime((
bool) $form->
getInput(
'highscore_wtime'));
577 $this->
object->setHighscoreMode((
int) $form->
getInput(
'highscore_mode'));
578 $this->
object->setHighscoreTopNum((
int) $form->
getInput(
'highscore_top_num'));
581 $this->
object->update();
590 if (!$validator->isCertificateDownloadable((
int) $DIC->user()->getId(), (int) $this->object->getId())) {
597 $certLogger = $DIC->logger()->cert();
604 $DIC->language()->txt(
'error_creating_certificate_pdf')
607 $pdfAction->
downloadPdf((
int) $DIC->user()->getId(), (int) $this->object->getId());
This class represents an option in a radio group.
Class ilPdfGeneratorConstantsTest.
const PRIVACY_IDENT_REAL_EMAIL
setValue($a_value)
Set Value.
const HIGHSCORE_SHOW_OWN_TABLE
__construct(ilObjCmiXapi $object)
const LAUNCH_METHOD_NEW_WIN
const PRIVACY_NAME_FULLNAME
const PRIVACY_NAME_LASTNAME
setInfo($a_info)
Set Info.
const CMD_DELIVER_CERTIFICATE
const PRIVACY_IDENT_IL_UUID_USER_ID
const LAUNCH_METHOD_OWN_WIN
Validates if an active certificate is stored in the database and can be downloaded by the user...
const SUBTAB_ID_CERTIFICATE
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
saveSettings(ilPropertyFormGUI $form)
const HIGHSCORE_SHOW_ALL_TABLES
Just a wrapper class to create Unit Test for other classes.
This class represents a non editable value in a property form.
This class represents a text area property in a property form.
const PRIVACY_IDENT_IL_UUID_EXT_ACCOUNT
const PRIVACY_IDENT_IL_UUID_SHA256
showCmd(ilPropertyFormGUI $form=null)
const PRIVACY_IDENT_IL_UUID_RANDOM
const PRIVACY_NAME_FIRSTNAME
const HIGHSCORE_SHOW_TOP_TABLE
const PRIVACY_IDENT_IL_UUID_LOGIN
downloadPdf(int $userId, int $objectId)