ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
class.ilCmiXapiLP.php
Go to the documentation of this file.
1<?php
2
19declare(strict_types=1);
20
31{
32 public const MOVEON_COMPLETED = 'Completed';
33 public const MOVEON_PASSED = 'Passed';
34 public const MOVEON_COMPLETED_OR_PASSED = 'CompletedOrPassed';
35 public const MOVEON_COMPLETED_AND_PASSED = 'CompletedAndPassed';
36 public const MOVEON_NOT_APPLICABLE = 'NotApplicable';
37
38 public function initModeOptions(ilRadioGroupInputGUI $modeRadio): void
39 {
40 global $DIC; /* @var \ILIAS\DI\Container $DIC */
41 $modeCompleted = new ilRadioOption(
42 $DIC->language()->txt('cmix_lp_mode_deactivated'),
44 );
45 $modeCompleted->setInfo($DIC->language()->txt('cmix_lp_mode_deactivated_info'));
46 $modeRadio->addOption($modeCompleted);
47
48 $modeCompleted = new ilRadioOption(
49 $DIC->language()->txt('cmix_lp_mode_when_completed'),
51 );
52 $modeCompleted->setInfo($DIC->language()->txt('cmix_lp_mode_when_completed_info'));
53 $modeRadio->addOption($modeCompleted);
54 $modeCompletedFailed = new ilCheckboxInputGUI(
55 $DIC->language()->txt('cmix_lp_mode_with_failed'),
56 'modus_' . ilLPObjSettings::LP_MODE_CMIX_COMPLETED . '_failed'
57 );
58 $modeCompletedFailed->setInfo($DIC->language()->txt('cmix_lp_mode_with_failed_info'));
59 $modeCompleted->addSubItem($modeCompletedFailed);
60
61 $modePassed = new ilRadioOption(
62 $DIC->language()->txt('cmix_lp_mode_when_passed'),
64 );
65 $modePassed->setInfo($DIC->language()->txt('cmix_lp_mode_when_passed_info'));
66 $modeRadio->addOption($modePassed);
67 $modePassedFailed = new ilCheckboxInputGUI(
68 $DIC->language()->txt('cmix_lp_mode_with_failed'),
69 'modus_' . ilLPObjSettings::LP_MODE_CMIX_PASSED . '_failed'
70 );
71 $modePassedFailed->setInfo($DIC->language()->txt('cmix_lp_mode_with_failed_info'));
72 $modePassed->addSubItem($modePassedFailed);
73
74 $modePassedOrCompleted = new ilRadioOption(
75 $DIC->language()->txt('cmix_lp_mode_when_passed_or_completed'),
77 );
78 $modePassedOrCompleted->setInfo($DIC->language()->txt('cmix_lp_mode_when_passed_or_completed_info'));
79 $modeRadio->addOption($modePassedOrCompleted);
80 $modePassedOrCompletedFailed = new ilCheckboxInputGUI(
81 $DIC->language()->txt('cmix_lp_mode_with_failed'),
83 );
84 $modePassedOrCompletedFailed->setInfo($DIC->language()->txt('cmix_lp_mode_with_failed_info'));
85 $modePassedOrCompleted->addSubItem($modePassedOrCompletedFailed);
86
87 switch ($this->getCurrentMode()) {
90 break;
93 $modeCompletedFailed->setChecked(true);
94 break;
97 break;
100 $modePassedFailed->setChecked(true);
101 break;
104 break;
107 $modePassedOrCompletedFailed->setChecked(true);
108 break;
109 }
110 }
111
112 public function fetchModeOption(ilPropertyFormGUI $form): int
113 {
114 $mainMode = (int) $form->getInput('modus');
115 $failedOpt = (int) $form->getInput('modus_' . $mainMode . '_failed');
116
117 if ($failedOpt) {
118 switch ($mainMode) {
121
124
127 }
128 }
129
130 return $mainMode;
131 }
132
133 public function getDefaultMode(): int
134 {
136 }
137
138 public function getValidModes(): array
139 {
140 return array(
148 );
149 }
150}
This class represents a checkbox property in a property form.
initModeOptions(ilRadioGroupInputGUI $modeRadio)
fetchModeOption(ilPropertyFormGUI $form)
const MOVEON_COMPLETED_OR_PASSED
const MOVEON_COMPLETED_AND_PASSED
const MOVEON_NOT_APPLICABLE
const LP_MODE_CMIX_COMPL_OR_PASSED_WITH_FAILED
Base class for object lp connectors.
This class represents a property form user interface.
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-...
This class represents a property in a property form.
addOption(ilRadioOption $a_option)
This class represents an option in a radio group.
global $DIC
Definition: shib_login.php:26