ILIAS  release_5-3 Revision v5.3.23-19-g915713cf615
ilTestSettingsChangeConfirmationGUI Class Reference
+ Inheritance diagram for ilTestSettingsChangeConfirmationGUI:
+ Collaboration diagram for ilTestSettingsChangeConfirmationGUI:

Public Member Functions

 __construct (ilLanguage $lng, ilObjTest $testOBJ)
 
 setOldQuestionSetType ($oldQuestionSetType)
 
 getOldQuestionSetType ()
 
 setNewQuestionSetType ($newQuestionSetType)
 
 getNewQuestionSetType ()
 
 setQuestionLossInfoEnabled ($questionLossInfoEnabled)
 
 isQuestionLossInfoEnabled ()
 
 build ()
 
 populateParametersFromPost ()
 
 populateParametersFromPropertyForm (ilPropertyFormGUI $form, $timezone)
 
- Public Member Functions inherited from ilConfirmationGUI
 __construct ()
 Constructor. More...
 
 setFormAction ($a_form_action)
 
 getFormAction ()
 
 setHeaderText ($a_headertext)
 Set Set header text. More...
 
 getHeaderText ()
 Get Set header text. More...
 
 addButton ($a_txt, $a_cmd)
 Set cancel button command and text. More...
 
 setCancel ($a_txt, $a_cmd, $a_id="")
 Set cancel button command and text. More...
 
 setConfirm ($a_txt, $a_cmd, $a_id="")
 Set confirmation button command and text. More...
 
 addItem ( $a_post_var, $a_id, $a_text, $a_img="", $a_alt="")
 Add row item. More...
 
 addHiddenItem ($a_post_var, $a_value)
 Add hidden item. More...
 
 getHTML ()
 Get confirmation screen HTML. More...
 
 setFormName ($a_name)
 Set form name. More...
 

Protected Attributes

 $lng
 
 $testOBJ
 
- Protected Attributes inherited from ilConfirmationGUI
 $lng
 

Private Member Functions

 buildHeaderText ()
 

Private Attributes

 $oldQuestionSetType
 
 $newQuestionSetType
 
 $questionLossInfoEnabled
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilTestSettingsChangeConfirmationGUI::__construct ( ilLanguage  $lng,
ilObjTest  $testOBJ 
)
Parameters
ilLanguage$lng
ilObjTest$testOBJ

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

References $lng, and $testOBJ.

46  {
47  $this->lng = $lng;
48  $this->testOBJ = $testOBJ;
49 
50  parent::__construct();
51  }

Member Function Documentation

◆ build()

ilTestSettingsChangeConfirmationGUI::build ( )

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

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

117  {
118  $this->setHeaderText($this->buildHeaderText());
119  }
setHeaderText($a_headertext)
Set Set header text.
+ Here is the call graph for this function:

◆ buildHeaderText()

ilTestSettingsChangeConfirmationGUI::buildHeaderText ( )
private

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

References getNewQuestionSetType(), getOldQuestionSetType(), and isQuestionLossInfoEnabled().

Referenced by build().

102  {
103  $headerText = sprintf(
104  $this->lng->txt('tst_change_quest_set_type_from_old_to_new_with_conflict'),
105  $this->testOBJ->getQuestionSetTypeTranslation($this->lng, $this->getOldQuestionSetType()),
106  $this->testOBJ->getQuestionSetTypeTranslation($this->lng, $this->getNewQuestionSetType())
107  );
108 
109  if ($this->isQuestionLossInfoEnabled()) {
110  $headerText .= '<br /><br />' . $this->lng->txt('tst_nonpool_questions_get_lost_warning');
111  }
112 
113  return $headerText;
114  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getNewQuestionSetType()

ilTestSettingsChangeConfirmationGUI::getNewQuestionSetType ( )
Returns
string

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

References $newQuestionSetType.

Referenced by buildHeaderText().

+ Here is the caller graph for this function:

◆ getOldQuestionSetType()

ilTestSettingsChangeConfirmationGUI::getOldQuestionSetType ( )
Returns
string

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

References $oldQuestionSetType.

Referenced by buildHeaderText().

+ Here is the caller graph for this function:

◆ isQuestionLossInfoEnabled()

ilTestSettingsChangeConfirmationGUI::isQuestionLossInfoEnabled ( )
Returns
boolean

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

References $questionLossInfoEnabled.

Referenced by buildHeaderText().

+ Here is the caller graph for this function:

◆ populateParametersFromPost()

ilTestSettingsChangeConfirmationGUI::populateParametersFromPost ( )

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

References $_POST, $key, and ilConfirmationGUI\addHiddenItem().

122  {
123  foreach ($_POST as $key => $value) {
124  if (strcmp($key, "cmd") != 0) {
125  if (is_array($value)) {
126  foreach ($value as $k => $v) {
127  $this->addHiddenItem("{$key}[{$k}]", $v);
128  }
129  } else {
130  $this->addHiddenItem($key, $value);
131  }
132  }
133  }
134  }
addHiddenItem($a_post_var, $a_value)
Add hidden item.
$key
Definition: croninfo.php:18
$_POST["username"]
+ Here is the call graph for this function:

◆ populateParametersFromPropertyForm()

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

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

References ilConfirmationGUI\$item, $key, $time, $type, ilConfirmationGUI\addHiddenItem(), array, ilPropertyFormGUI\getInputItemsRecursive(), and IL_CAL_DATETIME.

140  {
141  foreach ($form->getInputItemsRecursive() as $key => $item) {
142  //vd("$key // {$item->getType()} // ".json_encode($_POST[$item->getPostVar()]));
143 
144  switch ($item->getType()) {
145  case 'section_header':
146 
147  continue;
148 
149  case 'datetime':
150 
151  $datetime = $item->getDate();
152  if ($datetime instanceof ilDateTime) {
153  list($date, $time) = explode(' ', $datetime->get(IL_CAL_DATETIME));
154  if (!($date instanceof ilDate)) {
155  $this->addHiddenItem($item->getPostVar(), $date . ' ' . $time);
156  } else {
157  $this->addHiddenItem($item->getPostVar(), $date);
158  }
159  } else {
160  $this->addHiddenItem($item->getPostVar(), '');
161  }
162 
163  break;
164 
165  case 'duration':
166 
167  $this->addHiddenItem("{$item->getPostVar()}[MM]", (int) $item->getMonths());
168  $this->addHiddenItem("{$item->getPostVar()}[dd]", (int) $item->getDays());
169  $this->addHiddenItem("{$item->getPostVar()}[hh]", (int) $item->getHours());
170  $this->addHiddenItem("{$item->getPostVar()}[mm]", (int) $item->getMinutes());
171  $this->addHiddenItem("{$item->getPostVar()}[ss]", (int) $item->getSeconds());
172 
173  break;
174 
175  case 'dateduration':
176 
177  foreach (array("start", "end") as $type) {
178  $postVar = $item->getPostVar() . '[' . $type . ']';
179  $datetime = $item->{'get' . ucfirst($type)}();
180 
181  if ($datetime instanceof ilDateTime) {
182  list($date, $time) = explode(' ', $datetime->get(IL_CAL_DATETIME));
183  if (!($date instanceof ilDate)) {
184  $this->addHiddenItem($postVar, $date . ' ' . $time);
185  } else {
186  $this->addHiddenItem($postVar, $date);
187  }
188  } else {
189  $this->addHiddenItem($postVar, '');
190  }
191  }
192 
193  break;
194 
195  case 'checkboxgroup':
196 
197  if (is_array($item->getValue())) {
198  foreach ($item->getValue() as $option) {
199  $this->addHiddenItem("{$item->getPostVar()}[]", $option);
200  }
201  }
202 
203  break;
204 
205  case 'select':
206 
207  $value = $item->getValue();
208  if (!is_array($value)) {
209  $value = array($value);
210  }
211  foreach ($value as $option) {
212  $this->addHiddenItem("{$item->getPostVar()}[]", $option);
213  }
214 
215  break;
216 
217  case 'checkbox':
218 
219  if ($item->getChecked()) {
220  $this->addHiddenItem($item->getPostVar(), 1);
221  }
222 
223  break;
224 
225  default:
226 
227  $this->addHiddenItem($item->getPostVar(), $item->getValue());
228  }
229  }
230  }
addHiddenItem($a_post_var, $a_value)
Add hidden item.
const IL_CAL_DATETIME
$type
$time
Definition: cron.php:21
Class for single dates.
Date and time handling
Create styles array
The data for the language used.
getInputItemsRecursive()
returns a flat array of all input items including the possibly existing subitems recursively ...
$key
Definition: croninfo.php:18
+ Here is the call graph for this function:

◆ setNewQuestionSetType()

ilTestSettingsChangeConfirmationGUI::setNewQuestionSetType (   $newQuestionSetType)
Parameters
string$newQuestionSetType

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

References $newQuestionSetType.

◆ setOldQuestionSetType()

ilTestSettingsChangeConfirmationGUI::setOldQuestionSetType (   $oldQuestionSetType)
Parameters
string$oldQuestionSetType

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

References $oldQuestionSetType.

◆ setQuestionLossInfoEnabled()

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

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

References $questionLossInfoEnabled.

89  {
90  $this->questionLossInfoEnabled = $questionLossInfoEnabled;
91  }

Field Documentation

◆ $lng

ilTestSettingsChangeConfirmationGUI::$lng
protected

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

Referenced by __construct().

◆ $newQuestionSetType

ilTestSettingsChangeConfirmationGUI::$newQuestionSetType
private

◆ $oldQuestionSetType

ilTestSettingsChangeConfirmationGUI::$oldQuestionSetType
private

◆ $questionLossInfoEnabled

ilTestSettingsChangeConfirmationGUI::$questionLossInfoEnabled
private

◆ $testOBJ

ilTestSettingsChangeConfirmationGUI::$testOBJ
protected

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

Referenced by __construct().


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