ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
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
 

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 117 of file class.ilTestSettingsChangeConfirmationGUI.php.

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

118  {
119  $this->setHeaderText( $this->buildHeaderText() );
120  }
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  {
111  $headerText .= '<br /><br />'.$this->lng->txt('tst_nonpool_questions_get_lost_warning');
112  }
113 
114  return $headerText;
115  }
+ 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 122 of file class.ilTestSettingsChangeConfirmationGUI.php.

References $_POST, and ilConfirmationGUI\addHiddenItem().

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

◆ populateParametersFromPropertyForm()

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

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

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

147  {
148  foreach ($form->getInputItemsRecursive() as $key => $item)
149  {
150  //vd("$key // {$item->getType()} // ".json_encode($_POST[$item->getPostVar()]));
151 
152  switch( $item->getType() )
153  {
154  case 'section_header':
155 
156  continue;
157 
158  case 'datetime':
159 
160  $datetime = $item->getDate();
161  if($datetime instanceof ilDateTime)
162  {
163  list($date, $time) = explode(' ', $datetime->get(IL_CAL_DATETIME));
164  if(!($date instanceof ilDate))
165  {
166  $this->addHiddenItem($item->getPostVar(), $date . ' ' . $time);
167  }
168  else
169  {
170  $this->addHiddenItem($item->getPostVar(), $date);
171  }
172  }
173  else
174  {
175  $this->addHiddenItem($item->getPostVar(), '');
176  }
177 
178  break;
179 
180  case 'duration':
181 
182  $this->addHiddenItem("{$item->getPostVar()}[MM]", (int)$item->getMonths());
183  $this->addHiddenItem("{$item->getPostVar()}[dd]", (int)$item->getDays());
184  $this->addHiddenItem("{$item->getPostVar()}[hh]", (int)$item->getHours());
185  $this->addHiddenItem("{$item->getPostVar()}[mm]", (int)$item->getMinutes());
186  $this->addHiddenItem("{$item->getPostVar()}[ss]", (int)$item->getSeconds());
187 
188  break;
189 
190  case 'dateduration':
191 
192  foreach(array("start", "end") as $type)
193  {
194  $postVar = $item->getPostVar() . '[' . $type .']';
195  $datetime = $item->{'get' . ucfirst($type)}();
196 
197  if($datetime instanceof ilDateTime)
198  {
199  list($date, $time) = explode(' ', $datetime->get(IL_CAL_DATETIME));
200  if(!($date instanceof ilDate))
201  {
202  $this->addHiddenItem($postVar, $date . ' ' . $time);
203  }
204  else
205  {
206  $this->addHiddenItem($postVar, $date);
207  }
208  }
209  else
210  {
211  $this->addHiddenItem($postVar, '');
212  }
213  }
214 
215  break;
216 
217  case 'checkboxgroup':
218 
219  if( is_array($item->getValue()) )
220  {
221  foreach( $item->getValue() as $option )
222  {
223  $this->addHiddenItem("{$item->getPostVar()}[]", $option);
224  }
225  }
226 
227  break;
228 
229  case 'select':
230 
231  $value = $item->getValue();
232  if( !is_array($value) )
233  {
234  $value = array($value);
235  }
236  foreach( $value as $option )
237  {
238  $this->addHiddenItem("{$item->getPostVar()}[]", $option);
239  }
240 
241  break;
242 
243  case 'checkbox':
244 
245  if( $item->getChecked() )
246  {
247  $this->addHiddenItem($item->getPostVar(), 1);
248  }
249 
250  break;
251 
252  default:
253 
254  $this->addHiddenItem($item->getPostVar(), $item->getValue());
255  }
256  }
257  }
addHiddenItem($a_post_var, $a_value)
Add hidden item.
const IL_CAL_DATETIME
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 ...
+ 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: