ILIAS  release_7 Revision v7.30-3-g800a261c036
class.ilCmiXapiLP.php
Go to the documentation of this file.
1<?php
2
3/* Copyright (c) 1998-2019 ILIAS open source, Extended GPL, see docs/LICENSE */
4
5
16{
17 const MOVEON_COMPLETED = 'Completed';
18 const MOVEON_PASSED = 'Passed';
19 const MOVEON_COMPLETED_OR_PASSED = 'CompletedOrPassed';
20 const MOVEON_COMPLETED_AND_PASSED = 'CompletedAndPassed';
21 const MOVEON_NOT_APPLICABLE = 'NotApplicable';
22
23 public function initModeOptions(ilRadioGroupInputGUI $modeRadio)
24 {
25 global $DIC; /* @var \ILIAS\DI\Container $DIC */
26 $modeCompleted = new ilRadioOption(
27 $DIC->language()->txt('cmix_lp_mode_deactivated'),
29 );
30 $modeCompleted->setInfo($DIC->language()->txt('cmix_lp_mode_deactivated_info'));
31 $modeRadio->addOption($modeCompleted);
32
33 $modeCompleted = new ilRadioOption(
34 $DIC->language()->txt('cmix_lp_mode_when_completed'),
36 );
37 $modeCompleted->setInfo($DIC->language()->txt('cmix_lp_mode_when_completed_info'));
38 $modeRadio->addOption($modeCompleted);
39 $modeCompletedFailed = new ilCheckboxInputGUI(
40 $DIC->language()->txt('cmix_lp_mode_with_failed'),
41 'modus_' . ilLPObjSettings::LP_MODE_CMIX_COMPLETED . '_failed'
42 );
43 $modeCompletedFailed->setInfo($DIC->language()->txt('cmix_lp_mode_with_failed_info'));
44 $modeCompleted->addSubItem($modeCompletedFailed);
45
46 $modePassed = new ilRadioOption(
47 $DIC->language()->txt('cmix_lp_mode_when_passed'),
49 );
50 $modePassed->setInfo($DIC->language()->txt('cmix_lp_mode_when_passed_info'));
51 $modeRadio->addOption($modePassed);
52 $modePassedFailed = new ilCheckboxInputGUI(
53 $DIC->language()->txt('cmix_lp_mode_with_failed'),
54 'modus_' . ilLPObjSettings::LP_MODE_CMIX_PASSED . '_failed'
55 );
56 $modePassedFailed->setInfo($DIC->language()->txt('cmix_lp_mode_with_failed_info'));
57 $modePassed->addSubItem($modePassedFailed);
58
59 $modePassedOrCompleted = new ilRadioOption(
60 $DIC->language()->txt('cmix_lp_mode_when_passed_or_completed'),
62 );
63 $modePassedOrCompleted->setInfo($DIC->language()->txt('cmix_lp_mode_when_passed_or_completed_info'));
64 $modeRadio->addOption($modePassedOrCompleted);
65 $modePassedOrCompletedFailed = new ilCheckboxInputGUI(
66 $DIC->language()->txt('cmix_lp_mode_with_failed'),
68 );
69 $modePassedOrCompletedFailed->setInfo($DIC->language()->txt('cmix_lp_mode_with_failed_info'));
70 $modePassedOrCompleted->addSubItem($modePassedOrCompletedFailed);
71
72 switch ($this->getCurrentMode()) {
75 break;
78 $modeCompletedFailed->setChecked(true);
79 break;
82 break;
85 $modePassedFailed->setChecked(true);
86 break;
89 break;
92 $modePassedOrCompletedFailed->setChecked(true);
93 break;
94 }
95 }
96
97 public function fetchModeOption(ilPropertyFormGUI $form)
98 {
99 $mainMode = (int) $form->getInput('modus');
100 $failedOpt = (int) $form->getInput('modus_' . $mainMode . '_failed');
101
102 if ($failedOpt) {
103 switch ($mainMode) {
106
109
112 }
113 }
114
115 return $mainMode;
116 }
117
118 public static function getDefaultModes($a_lp_active)
119 {
120 return array(
128 );
129 }
130
131 public function getDefaultMode()
132 {
134 }
135
136 public function getValidModes()
137 {
138 return array(
146 );
147 }
148}
An exception for terminatinating execution or to throw for unit testing.
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
static getDefaultModes($a_lp_active)
Get available type-specific default modes (no administration needed)
const MOVEON_NOT_APPLICABLE
const LP_MODE_CMIX_COMPL_OR_PASSED_WITH_FAILED
This class represents a property form user interface.
getInput($a_post_var, $ensureValidation=true)
Returns the value of a HTTP-POST variable, identified by the passed id.
This class represents a property in a property form.
addOption($a_option)
Add Option.
This class represents an option in a radio group.
global $DIC
Definition: goto.php:24