ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
ilTestSettingsChangeConfirmationGUI Class Reference
+ Inheritance diagram for ilTestSettingsChangeConfirmationGUI:
+ Collaboration diagram for ilTestSettingsChangeConfirmationGUI:

Public Member Functions

 __construct (private readonly RequestDataCollector $request_data_collector, protected readonly ilObjTest $testOBJ)
 
 setOldQuestionSetType (string $oldQuestionSetType)
 
 getOldQuestionSetType ()
 
 setNewQuestionSetType (string $newQuestionSetType)
 
 getNewQuestionSetType ()
 
 setQuestionLossInfoEnabled (bool $questionLossInfoEnabled)
 
 isQuestionLossInfoEnabled ()
 
 build ()
 
 populateParametersFromPost ()
 
 populateParametersFromPropertyForm (ilPropertyFormGUI $form, $timezone)
 
- Public Member Functions inherited from ilConfirmationGUI
 setFormAction (string $a_form_action)
 
 getFormAction ()
 
 setHeaderText (string $a_headertext)
 
 getHeaderText ()
 
 setFormName (string $a_name)
 
 addButton (string $a_txt, string $a_cmd)
 
 setCancel (string $a_txt, string $a_cmd, string $a_id='')
 
 setConfirm (string $a_txt, string $a_cmd, string $a_id='')
 
 addItem (string $a_post_var, string $a_id, string $a_text, string $a_img='', string $a_alt='')
 
 addHiddenItem (string $a_post_var, string $a_value)
 
 getHTML ()
 

Private Member Functions

 buildHeaderText ()
 

Private Attributes

string $oldQuestionSetType
 
string $newQuestionSetType
 
bool $questionLossInfoEnabled
 

Additional Inherited Members

- Protected Attributes inherited from ilConfirmationGUI
ilLanguage $lng
 
string $form_action = ''
 
string $headertext = ''
 
string $cancel_txt = ''
 
string $cancel_cmd = ''
 
string $cancel_id = ''
 
string $confirm_txt = ''
 
string $confirm_cmd = ''
 
string $confirm_id = ''
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilTestSettingsChangeConfirmationGUI::__construct ( private readonly RequestDataCollector  $request_data_collector,
protected readonly ilObjTest  $testOBJ 
)

Definition at line 35 of file class.ilTestSettingsChangeConfirmationGUI.php.

38 {
40 }
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc

References ILIAS\GlobalScreen\Provider\__construct().

+ Here is the call graph for this function:

Member Function Documentation

◆ build()

ilTestSettingsChangeConfirmationGUI::build ( )

Definition at line 90 of file class.ilTestSettingsChangeConfirmationGUI.php.

References buildHeaderText(), and ilConfirmationGUI\setHeaderText().

+ Here is the call graph for this function:

◆ buildHeaderText()

ilTestSettingsChangeConfirmationGUI::buildHeaderText ( )
private

Definition at line 75 of file class.ilTestSettingsChangeConfirmationGUI.php.

75 : string
76 {
77 $headerText = sprintf(
78 $this->lng->txt('tst_change_quest_set_type_from_old_to_new_with_conflict'),
79 $this->testOBJ->getQuestionSetTypeTranslation($this->lng, $this->getOldQuestionSetType()),
80 $this->testOBJ->getQuestionSetTypeTranslation($this->lng, $this->getNewQuestionSetType())
81 );
82
83 if ($this->isQuestionLossInfoEnabled()) {
84 $headerText .= '<br /><br />' . $this->lng->txt('tst_nonpool_questions_get_lost_warning');
85 }
86
87 return $headerText;
88 }

References isQuestionLossInfoEnabled(), and ILIAS\Repository\lng().

Referenced by build().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getNewQuestionSetType()

ilTestSettingsChangeConfirmationGUI::getNewQuestionSetType ( )

◆ getOldQuestionSetType()

ilTestSettingsChangeConfirmationGUI::getOldQuestionSetType ( )

◆ isQuestionLossInfoEnabled()

ilTestSettingsChangeConfirmationGUI::isQuestionLossInfoEnabled ( )

Definition at line 70 of file class.ilTestSettingsChangeConfirmationGUI.php.

References $questionLossInfoEnabled.

Referenced by buildHeaderText().

+ Here is the caller graph for this function:

◆ populateParametersFromPost()

ilTestSettingsChangeConfirmationGUI::populateParametersFromPost ( )

Definition at line 95 of file class.ilTestSettingsChangeConfirmationGUI.php.

95 : void
96 {
97 foreach ($this->request_data_collector->getPostKeys() as $key) {
98 if ($key !== 'cmd') {
99 $value = $this->request_data_collector->raw($key);
100
101 if (is_array($value)) {
102 foreach ($value as $k => $v) {
103 $this->addHiddenItem("{$key}[{$k}]", $v);
104 }
105 } elseif (is_string($value)) {
106 $this->addHiddenItem($key, $value);
107 }
108 }
109 }
110 }
addHiddenItem(string $a_post_var, string $a_value)

References ilConfirmationGUI\addHiddenItem().

+ Here is the call graph for this function:

◆ populateParametersFromPropertyForm()

ilTestSettingsChangeConfirmationGUI::populateParametersFromPropertyForm ( ilPropertyFormGUI  $form,
  $timezone 
)

Definition at line 112 of file class.ilTestSettingsChangeConfirmationGUI.php.

112 : void
113 {
114 foreach ($form->getInputItemsRecursive() as $key => $item) {
115 switch ($item->getType()) {
116 case 'section_header':
117
118 continue 2;
119
120 case 'datetime':
121
122 $datetime = $item->getDate();
123 if ($datetime instanceof ilDateTime && !$datetime->isNull()) {
124 $parts = explode(' ', $datetime->get(IL_CAL_DATETIME));
125 if ($datetime instanceof ilDate) {
126 $this->addHiddenItem($item->getPostVar(), $parts[0]);
127 } else {
128 $this->addHiddenItem($item->getPostVar(), $parts[0] . ' ' . $parts[1]);
129 }
130 } else {
131 $this->addHiddenItem($item->getPostVar(), '');
132 }
133
134 break;
135
136 case 'duration':
137
138 $this->addHiddenItem("{$item->getPostVar()}[MM]", (string) $item->getMonths());
139 $this->addHiddenItem("{$item->getPostVar()}[dd]", (string) $item->getDays());
140 $this->addHiddenItem("{$item->getPostVar()}[hh]", (string) $item->getHours());
141 $this->addHiddenItem("{$item->getPostVar()}[mm]", (string) $item->getMinutes());
142 $this->addHiddenItem("{$item->getPostVar()}[ss]", (string) $item->getSeconds());
143
144 break;
145
146 case 'dateduration':
147
148 foreach (["start", "end"] as $type) {
149 $postVar = $item->getPostVar() . '[' . $type . ']';
150 $datetime = $item->{'get' . ucfirst($type)}();
151
152 if ($datetime instanceof ilDateTime && !$datetime->isNull()) {
153 $parts = explode(' ', $datetime->get(IL_CAL_DATETIME));
154 if ($datetime instanceof ilDate) {
155 $this->addHiddenItem($postVar, $parts[0]);
156 } else {
157 $this->addHiddenItem($postVar, $parts[0] . ' ' . $parts[1]);
158 }
159 } else {
160 $this->addHiddenItem($postVar, '');
161 }
162 }
163
164 break;
165
166 case 'checkboxgroup':
167
168 if (is_array($item->getValue())) {
169 foreach ($item->getValue() as $option) {
170 $this->addHiddenItem("{$item->getPostVar()}[]", $option);
171 }
172 }
173
174 break;
175
176 case 'select':
177
178 $value = $item->getValue();
179 if (!is_array($value)) {
180 $value = [$value];
181 }
182 foreach ($value as $option) {
183 $this->addHiddenItem("{$item->getPostVar()}[]", $option);
184 }
185
186 break;
187
188 case 'checkbox':
189
190 if ($item->getChecked()) {
191 $this->addHiddenItem($item->getPostVar(), '1');
192 }
193
194 break;
195
196 default:
197
198 $this->addHiddenItem($item->getPostVar(), (string) $item->getValue());
199 }
200 }
201 }
$datetime
const IL_CAL_DATETIME
@classDescription Date and time handling
Class for single dates.
getInputItemsRecursive()
returns a flat array of all input items including the possibly existing subitems recursively
if($clientAssertionType !='urn:ietf:params:oauth:client-assertion-type:jwt-bearer'|| $grantType !='client_credentials') $parts
Definition: ltitoken.php:61

References $datetime, ilConfirmationGUI\$item, $parts, ilConfirmationGUI\addHiddenItem(), ilPropertyFormGUI\getInputItemsRecursive(), and IL_CAL_DATETIME.

+ Here is the call graph for this function:

◆ setNewQuestionSetType()

ilTestSettingsChangeConfirmationGUI::setNewQuestionSetType ( string  $newQuestionSetType)

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

52 : void
53 {
54 $this->newQuestionSetType = $newQuestionSetType;
55 }

References $newQuestionSetType.

◆ setOldQuestionSetType()

ilTestSettingsChangeConfirmationGUI::setOldQuestionSetType ( string  $oldQuestionSetType)

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

42 : void
43 {
44 $this->oldQuestionSetType = $oldQuestionSetType;
45 }

References $oldQuestionSetType.

◆ setQuestionLossInfoEnabled()

ilTestSettingsChangeConfirmationGUI::setQuestionLossInfoEnabled ( bool  $questionLossInfoEnabled)
Parameters
bool$questionLossInfoEnabled

Definition at line 65 of file class.ilTestSettingsChangeConfirmationGUI.php.

65 : void
66 {
67 $this->questionLossInfoEnabled = $questionLossInfoEnabled;
68 }

References $questionLossInfoEnabled.

Field Documentation

◆ $newQuestionSetType

string ilTestSettingsChangeConfirmationGUI::$newQuestionSetType
private

◆ $oldQuestionSetType

string ilTestSettingsChangeConfirmationGUI::$oldQuestionSetType
private

◆ $questionLossInfoEnabled

bool ilTestSettingsChangeConfirmationGUI::$questionLossInfoEnabled
private

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