ILIAS  release_4-4 Revision
All Data Structures Namespaces Files Functions Variables Modules Pages
ilSingleChoiceWizardInputGUI Class Reference

This class represents a single choice wizard property in a property form. More...

+ Inheritance diagram for ilSingleChoiceWizardInputGUI:
+ Collaboration diagram for ilSingleChoiceWizardInputGUI:

Public Member Functions

 __construct ($a_title="", $a_postvar="")
 Constructor. More...
 
 setDisableUpload ($disable_upload)
 
 setDisableActions ($disable_actions)
 
 setDisableText ($disable_text)
 
 setValue ($a_value)
 Set Value. More...
 
 setSuffixes ($a_suffixes)
 Set Accepted Suffixes. More...
 
 setHideImages ($a_hide)
 Set hide images. More...
 
 getSuffixes ()
 Get Accepted Suffixes. More...
 
 setShowPoints ($a_value)
 
 getShowPoints ()
 
 setValues ($a_values)
 Set Values. More...
 
 getValues ()
 Get Values. More...
 
 setSingleline ($a_value)
 Set singleline. More...
 
 getSingleline ()
 Get singleline. More...
 
 setQuestionObject ($a_value)
 Set question object. More...
 
 getQuestionObject ()
 Get question object. More...
 
 setAllowMove ($a_allow_move)
 Set allow move. More...
 
 getAllowMove ()
 Get allow move. More...
 
 checkInput ()
 Check input, strip slashes etc. More...
 
 insert (&$a_tpl)
 Insert property html. More...
 
- Public Member Functions inherited from ilTextInputGUI
 __construct ($a_title="", $a_postvar="")
 Constructor. More...
 
 setValue ($a_value)
 Set Value. More...
 
 getValue ()
 Get Value. More...
 
 setValidationFailureMessage ($a_msg)
 Set message string for validation failure. More...
 
 getValidationFailureMessage ()
 
 setValidationRegexp ($a_value)
 Set validation regexp. More...
 
 getValidationRegexp ()
 Get validation regexp. More...
 
 setMaxLength ($a_maxlength)
 Set Max Length. More...
 
 getMaxLength ()
 Get Max Length. More...
 
 setSize ($a_size)
 Set Size. More...
 
 setInlineStyle ($a_style)
 Set inline style. More...
 
 getInlineStyle ()
 Get inline style. More...
 
 setCssClass ($a_class)
 
 getCssClass ()
 
 setValueByArray ($a_values)
 Set value by array. More...
 
 getSize ()
 Get Size. More...
 
 setSuffix ($a_value)
 Set suffix. More...
 
 getSuffix ()
 Get suffix. More...
 
 setInputType ($a_type)
 set input type More...
 
 getInputType ()
 get input type More...
 
 setSubmitFormOnEnter ($a_val)
 Set submit form on enter. More...
 
 getSubmitFormOnEnter ()
 Get submit form on enter. More...
 
 checkInput ()
 Check input, strip slashes etc. More...
 
 getDataSource ()
 get datasource link for js autocomplete More...
 
 setDataSource ($href, $a_delimiter=null)
 set datasource link for js autocomplete More...
 
 setMultiValues (array $a_values)
 
 render ($a_mode="")
 Render item. More...
 
 insert (&$a_tpl)
 Insert property html. More...
 
 getTableFilterHTML ()
 Get HTML for table filter. More...
 
 getToolbarHTML ()
 Get HTML for toolbar. More...
 
 setDisableHtmlAutoComplete ($autocomplete)
 
 isHtmlAutoCompleteDisabled ()
 
- Public Member Functions inherited from ilSubEnabledFormPropertyGUI
 addSubItem ($a_item)
 Add Subitem. More...
 
 getSubItems ()
 Get Subitems. More...
 
 getSubInputItemsRecursive ()
 returns a flat array of possibly existing subitems recursively More...
 
 checkSubItemsInput ()
 Check SubItems. More...
 
 getSubForm ()
 Get sub form html. More...
 
 getItemByPostVar ($a_post_var)
 Get item by post var. More...
 
- Public Member Functions inherited from ilFormPropertyGUI
 __construct ($a_title="", $a_postvar="")
 Constructor. More...
 
executeCommand ()
 Execute command. More...
 
 getType ()
 Get Type. More...
 
 setTitle ($a_title)
 Set Title. More...
 
 getTitle ()
 Get Title. More...
 
 setPostVar ($a_postvar)
 Set Post Variable. More...
 
 getPostVar ()
 Get Post Variable. More...
 
 getFieldId ()
 Get Post Variable. More...
 
 setInfo ($a_info)
 Set Information Text. More...
 
 getInfo ()
 Get Information Text. More...
 
 setAlert ($a_alert)
 Set Alert Text. More...
 
 getAlert ()
 Get Alert Text. More...
 
 setRequired ($a_required)
 Set Required. More...
 
 getRequired ()
 Get Required. More...
 
 setDisabled ($a_disabled)
 Set Disabled. More...
 
 getDisabled ()
 Get Disabled. More...
 
 checkInput ()
 Check input, strip slashes etc. More...
 
 setParentForm ($a_parentform)
 Set Parent Form. More...
 
 getParentForm ()
 Get Parent Form. More...
 
 setParent ($a_val)
 Set Parent GUI object. More...
 
 getParent ()
 Get Parent GUI object. More...
 
 getSubForm ()
 Get sub form html. More...
 
 hideSubForm ()
 Sub form hidden on init? More...
 
 setHiddenTitle ($a_val)
 Set hidden title (for screenreaders) More...
 
 getHiddenTitle ()
 Get hidden title. More...
 
 getItemByPostVar ($a_post_var)
 Get item by post var. More...
 
 serializeData ()
 serialize data More...
 
 unserializeData ($a_data)
 unserialize data More...
 
 writeToSession ()
 Write to session. More...
 
 clearFromSession ()
 Clear session value. More...
 
 readFromSession ()
 Read from session. More...
 
 getHiddenTag ($a_post_var, $a_value)
 Get hidden tag (used for disabled properties) More...
 
 setMulti ($a_multi, $a_sortable=false, $a_addremove=true)
 Set Multi. More...
 
 getMulti ()
 Get Multi. More...
 
 setMultiValues (array $a_values)
 Set multi values. More...
 
 getMultiValues ()
 Get multi values. More...
 
 getContentOutsideFormTag ()
 Get content that has to reside outside of the parent form tag, e.g. More...
 

Protected Attributes

 $values = array()
 
 $allowMove = false
 
 $singleline = true
 
 $qstObject = null
 
 $suffixes = array()
 
 $showPoints = true
 
 $hideImages = false
 
 $disable_text = false
 
 $disable_upload = false
 
 $disable_actions = false
 
- Protected Attributes inherited from ilTextInputGUI
 $value
 
 $maxlength = 200
 
 $size = 40
 
 $validationRegexp
 
 $validationFailureMessage = ''
 
 $suffix
 
 $style_css
 
 $css_class
 
 $ajax_datasource
 
 $ajax_datasource_delimiter
 
 $submit_form_on_enter = false
 
 $autocomplete_disabled = false
 
- Protected Attributes inherited from ilSubEnabledFormPropertyGUI
 $sub_items = array()
 
- Protected Attributes inherited from ilFormPropertyGUI
 $type
 
 $title
 
 $postvar
 
 $info
 
 $alert
 
 $required = false
 
 $parentgui
 
 $parentform
 
 $hidden_title = ""
 
 $multi = false
 
 $multi_sortable = false
 
 $multi_addremove = true
 
 $multi_values
 

Additional Inherited Members

- Protected Member Functions inherited from ilFormPropertyGUI
 setType ($a_type)
 Set Type. More...
 
 getMultiIconsHTML ()
 Get HTML for multiple value icons. More...
 

Detailed Description

This class represents a single choice wizard property in a property form.

Author
Helmut Schottmüller ilias.nosp@m.@aur.nosp@m.ealis.nosp@m..de
Version
$Id$

Definition at line 11 of file class.ilSingleChoiceWizardInputGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilSingleChoiceWizardInputGUI::__construct (   $a_title = "",
  $a_postvar = "" 
)

Constructor.

Parameters
string$a_titleTitle
string$a_postvarPost Variable

Definition at line 31 of file class.ilSingleChoiceWizardInputGUI.php.

References ilTextInputGUI\setSize(), and setSuffixes().

32  {
33  parent::__construct($a_title, $a_postvar);
34  $this->setSuffixes(array("jpg", "jpeg", "png", "gif"));
35  $this->setSize('25');
36  $this->validationRegexp = "";
37  }
setSize($a_size)
Set Size.
setSuffixes($a_suffixes)
Set Accepted Suffixes.
+ Here is the call graph for this function:

Member Function Documentation

◆ checkInput()

ilSingleChoiceWizardInputGUI::checkInput ( )

Check input, strip slashes etc.

set alert, if input is not ok.

Returns
boolean Input ok, true/false

Definition at line 210 of file class.ilSingleChoiceWizardInputGUI.php.

References $_POST, $filename, $hideImages, $lng, ilTextInputGUI\$suffix, ilObjAdvancedEditing\_getUsedHTMLTagsAsString(), ilSubEnabledFormPropertyGUI\checkSubItemsInput(), ilFormPropertyGUI\getPostVar(), ilFormPropertyGUI\getRequired(), getSingleline(), getSuffixes(), ilFormPropertyGUI\setAlert(), ilUtil\stripSlashesRecursive(), and ilUtil\virusHandling().

211  {
212  global $lng;
213 
214  include_once "./Services/AdvancedEditing/classes/class.ilObjAdvancedEditing.php";
215 
216  if (is_array($_POST[$this->getPostVar()])) $_POST[$this->getPostVar()] = ilUtil::stripSlashesRecursive($_POST[$this->getPostVar()], true, ilObjAdvancedEditing::_getUsedHTMLTagsAsString("assessment"));
217  $foundvalues = $_POST[$this->getPostVar()];
218  if (is_array($foundvalues))
219  {
220  // check answers
221  if (is_array($foundvalues['answer']))
222  {
223  foreach ($foundvalues['answer'] as $aidx => $answervalue)
224  {
225  if (((strlen($answervalue)) == 0) && (strlen($foundvalues['imagename'][$aidx]) == 0))
226  {
227  $this->setAlert($lng->txt("msg_input_is_required"));
228  return FALSE;
229  }
230  }
231  }
232  // check points
233  $max = 0;
234  if (is_array($foundvalues['points']))
235  {
236  foreach ($foundvalues['points'] as $points)
237  {
238  if ($points > $max) $max = $points;
239  if (((strlen($points)) == 0) || (!is_numeric($points)))
240  {
241  $this->setAlert($lng->txt("form_msg_numeric_value_required"));
242  return FALSE;
243  }
244  }
245  }
246  if ($max == 0)
247  {
248  $this->setAlert($lng->txt("enter_enough_positive_points"));
249  return false;
250  }
251 
252  if (is_array($_FILES) && count($_FILES) && $this->getSingleline() && (!$this->hideImages))
253  {
254  if (is_array($_FILES[$this->getPostVar()]['error']['image']))
255  {
256  foreach ($_FILES[$this->getPostVar()]['error']['image'] as $index => $error)
257  {
258  // error handling
259  if ($error > 0)
260  {
261  switch ($error)
262  {
263  case UPLOAD_ERR_INI_SIZE:
264  $this->setAlert($lng->txt("form_msg_file_size_exceeds"));
265  return false;
266  break;
267 
268  case UPLOAD_ERR_FORM_SIZE:
269  $this->setAlert($lng->txt("form_msg_file_size_exceeds"));
270  return false;
271  break;
272 
273  case UPLOAD_ERR_PARTIAL:
274  $this->setAlert($lng->txt("form_msg_file_partially_uploaded"));
275  return false;
276  break;
277 
278  case UPLOAD_ERR_NO_FILE:
279  if ($this->getRequired())
280  {
281  if ((!strlen($foundvalues['imagename'][$index])) && (!strlen($foundvalues['answer'][$index])))
282  {
283  $this->setAlert($lng->txt("form_msg_file_no_upload"));
284  return false;
285  }
286  }
287  break;
288 
289  case UPLOAD_ERR_NO_TMP_DIR:
290  $this->setAlert($lng->txt("form_msg_file_missing_tmp_dir"));
291  return false;
292  break;
293 
294  case UPLOAD_ERR_CANT_WRITE:
295  $this->setAlert($lng->txt("form_msg_file_cannot_write_to_disk"));
296  return false;
297  break;
298 
299  case UPLOAD_ERR_EXTENSION:
300  $this->setAlert($lng->txt("form_msg_file_upload_stopped_ext"));
301  return false;
302  break;
303  }
304  }
305  }
306  }
307  else
308  {
309  if ($this->getRequired())
310  {
311  $this->setAlert($lng->txt("form_msg_file_no_upload"));
312  return false;
313  }
314  }
315 
316  if (is_array($_FILES[$this->getPostVar()]['tmp_name']['image']))
317  {
318  foreach ($_FILES[$this->getPostVar()]['tmp_name']['image'] as $index => $tmpname)
319  {
320  $filename = $_FILES[$this->getPostVar()]['name']['image'][$index];
321  $filename_arr = pathinfo($filename);
322  $suffix = $filename_arr["extension"];
323  $mimetype = $_FILES[$this->getPostVar()]['type']['image'][$index];
324  $size_bytes = $_FILES[$this->getPostVar()]['size']['image'][$index];
325  // check suffixes
326  if (strlen($tmpname) && is_array($this->getSuffixes()))
327  {
328  if (!in_array(strtolower($suffix), $this->getSuffixes()))
329  {
330  $this->setAlert($lng->txt("form_msg_file_wrong_file_type"));
331  return false;
332  }
333  }
334  }
335  }
336 
337  if (is_array($_FILES[$this->getPostVar()]['tmp_name']['image']))
338  {
339  foreach ($_FILES[$this->getPostVar()]['tmp_name']['image'] as $index => $tmpname)
340  {
341  $filename = $_FILES[$this->getPostVar()]['name']['image'][$index];
342  $filename_arr = pathinfo($filename);
343  $suffix = $filename_arr["extension"];
344  $mimetype = $_FILES[$this->getPostVar()]['type']['image'][$index];
345  $size_bytes = $_FILES[$this->getPostVar()]['size']['image'][$index];
346  // virus handling
347  if (strlen($tmpname))
348  {
349  $vir = ilUtil::virusHandling($tmpname, $filename);
350  if ($vir[0] == false)
351  {
352  $this->setAlert($lng->txt("form_msg_file_virus_found")."<br />".$vir[1]);
353  return false;
354  }
355  }
356  }
357  }
358  }
359  }
360  else
361  {
362  $this->setAlert($lng->txt("msg_input_is_required"));
363  return FALSE;
364  }
365 
366  return $this->checkSubItemsInput();
367  }
$_POST['username']
Definition: cron.php:12
static virusHandling($a_file, $a_orig_name="", $a_clean=true)
scan file for viruses and clean files if possible
& _getUsedHTMLTagsAsString($a_module="")
Returns a string of all allowed HTML tags for text editing.
getPostVar()
Get Post Variable.
setAlert($a_alert)
Set Alert Text.
static stripSlashesRecursive($a_data, $a_strip_html=true, $a_allow="")
Strip slashes from array and sub-arrays.
$filename
Definition: buildRTE.php:89
global $lng
Definition: privfeed.php:40
+ Here is the call graph for this function:

◆ getAllowMove()

ilSingleChoiceWizardInputGUI::getAllowMove ( )

Get allow move.

Returns
boolean Allow move

Definition at line 200 of file class.ilSingleChoiceWizardInputGUI.php.

References $allowMove.

Referenced by ilMultipleChoiceWizardInputGUI\insert(), and insert().

+ Here is the caller graph for this function:

◆ getQuestionObject()

ilSingleChoiceWizardInputGUI::getQuestionObject ( )

Get question object.

Returns
object Value

Definition at line 180 of file class.ilSingleChoiceWizardInputGUI.php.

References $qstObject.

◆ getShowPoints()

ilSingleChoiceWizardInputGUI::getShowPoints ( )

Definition at line 120 of file class.ilSingleChoiceWizardInputGUI.php.

References $showPoints.

Referenced by insert().

+ Here is the caller graph for this function:

◆ getSingleline()

ilSingleChoiceWizardInputGUI::getSingleline ( )

◆ getSuffixes()

ilSingleChoiceWizardInputGUI::getSuffixes ( )

Get Accepted Suffixes.

Returns
array Accepted Suffixes

Definition at line 110 of file class.ilSingleChoiceWizardInputGUI.php.

References $suffixes.

Referenced by ilEssayKeywordWizardInputGUI\checkInput(), ilMultipleChoiceWizardInputGUI\checkInput(), checkInput(), ilMultipleChoiceWizardInputGUI\insert(), and insert().

+ Here is the caller graph for this function:

◆ getValues()

ilSingleChoiceWizardInputGUI::getValues ( )

Get Values.

Returns
array Values

Definition at line 140 of file class.ilSingleChoiceWizardInputGUI.php.

References $values.

◆ insert()

ilSingleChoiceWizardInputGUI::insert ( $a_tpl)

Insert property html.

Returns
int Size

Definition at line 374 of file class.ilSingleChoiceWizardInputGUI.php.

References $lng, ilTextInputGUI\$suffix, $tpl, ilTextInputGUI\$value, getAllowMove(), ilFormPropertyGUI\getDisabled(), ilFormPropertyGUI\getFieldId(), ilUtil\getFileSizeInfo(), ilUtil\getImagePath(), ilTextInputGUI\getMaxLength(), ilFormPropertyGUI\getPostVar(), getShowPoints(), getSingleline(), ilTextInputGUI\getSize(), getSuffixes(), ilYuiUtil\initDomEvent(), and ilUtil\prepareFormOutput().

375  {
376  global $lng;
377 
378  $tpl = new ilTemplate("tpl.prop_singlechoicewizardinput.html", true, true, "Modules/TestQuestionPool");
379  $i = 0;
380  foreach ($this->values as $value)
381  {
382  if ($this->getSingleline())
383  {
384  if (!$this->hideImages)
385  {
386  if (strlen($value->getImage()))
387  {
388  $imagename = $this->qstObject->getImagePathWeb() . $value->getImage();
389  if (($this->getSingleline()) && ($this->qstObject->getThumbSize()))
390  {
391  if (@file_exists($this->qstObject->getImagePath() . $this->qstObject->getThumbPrefix() . $value->getImage()))
392  {
393  $imagename = $this->qstObject->getImagePathWeb() . $this->qstObject->getThumbPrefix() . $value->getImage();
394  }
395  }
396  $tpl->setCurrentBlock('image');
397  $tpl->setVariable('SRC_IMAGE', $imagename);
398  $tpl->setVariable('IMAGE_NAME', $value->getImage());
399  $tpl->setVariable('ALT_IMAGE', ilUtil::prepareFormOutput($value->getAnswertext()));
400  $tpl->setVariable("TXT_DELETE_EXISTING", $lng->txt("delete_existing_file"));
401  $tpl->setVariable("IMAGE_ROW_NUMBER", $i);
402  $tpl->setVariable("IMAGE_POST_VAR", $this->getPostVar());
403  if($this->disable_upload)
404  {
405  $tpl->setVariable('DISABLED_UPLOAD', 'type="hidden" disabled="disabled"');
406  }
407  $tpl->parseCurrentBlock();
408  }
409  $tpl->setCurrentBlock('addimage');
410  $tpl->setVariable("IMAGE_ID", $this->getPostVar() . "[image][$i]");
411  $tpl->setVariable("IMAGE_SUBMIT", $lng->txt("upload"));
412  $tpl->setVariable("IMAGE_ROW_NUMBER", $i);
413  $tpl->setVariable("IMAGE_POST_VAR", $this->getPostVar());
414  if($this->disable_upload)
415  {
416  $tpl->setVariable('DISABLED_UPLOAD', 'type="hidden" disabled="disabled"');
417  }
418 
419  $tpl->parseCurrentBlock();
420  }
421 
422  if (is_object($value))
423  {
424  $tpl->setCurrentBlock("prop_text_propval");
425  $tpl->setVariable("PROPERTY_VALUE", ilUtil::prepareFormOutput($value->getAnswertext()));
426  $tpl->parseCurrentBlock();
427  if( $this->getShowPoints() ) {
428  $tpl->setCurrentBlock("prop_points_propval");
429  $tpl->setVariable("PROPERTY_VALUE", ilUtil::prepareFormOutput($value->getPoints()));
430  $tpl->parseCurrentBlock();
431  }
432  }
433  $tpl->setCurrentBlock('singleline');
434  if($this->disable_text)
435  {
436  $tpl->setVariable("DISABLED_SINGLELINE", 'readonly="readonly"');
437  $tpl->setVariable("DISABLED_SINGLELINE_BTN", 'readonly="readonly"');
438  }
439  $tpl->setVariable("SIZE", $this->getSize());
440  $tpl->setVariable("SINGLELINE_ID", $this->getPostVar() . "[answer][$i]");
441  $tpl->setVariable("SINGLELINE_ROW_NUMBER", $i);
442  $tpl->setVariable("SINGLELINE_POST_VAR", $this->getPostVar());
443  $tpl->setVariable("MAXLENGTH", $this->getMaxLength());
444  if ($this->getDisabled())
445  {
446  $tpl->setVariable("DISABLED_SINGLELINE", " disabled=\"disabled\"");
447  }
448  $tpl->parseCurrentBlock();
449  }
450  else if (!$this->getSingleline())
451  {
452  if (is_object($value))
453  {
454  if ($this->getShowPoints())
455  {
456  $tpl->setCurrentBlock("prop_points_propval");
457  $tpl->setVariable("PROPERTY_VALUE", ilUtil::prepareFormOutput($value->getPoints()));
458  $tpl->parseCurrentBlock();
459  }
460  }
461  $tpl->setCurrentBlock('multiline');
462  if($this->disable_text)
463  {
464  $tpl->setVariable("DISABLED_MULTILINE", 'readonly="readonly"');
465  }
466 
467  $tpl->setVariable("PROPERTY_VALUE", ilUtil::prepareFormOutput($value->getAnswertext()));
468  $tpl->setVariable("MULTILINE_ID", $this->getPostVar() . "[answer][$i]");
469  $tpl->setVariable("MULTILINE_ROW_NUMBER", $i);
470  $tpl->setVariable("MULTILINE_POST_VAR", $this->getPostVar());
471  if ($this->getDisabled())
472  {
473  $tpl->setVariable("DISABLED_MULTILINE", " disabled=\"disabled\"");
474  }
475  $tpl->parseCurrentBlock();
476  }
477  if ($this->getAllowMove())
478  {
479  $tpl->setCurrentBlock("move");
480  $tpl->setVariable("CMD_UP", "cmd[up" . $this->getFieldId() . "][$i]");
481  $tpl->setVariable("CMD_DOWN", "cmd[down" . $this->getFieldId() . "][$i]");
482  $tpl->setVariable("MOVE_ID", $this->getPostVar() . "[$i]");
483  $tpl->setVariable("UP_BUTTON", ilUtil::getImagePath('a_up.png'));
484  $tpl->setVariable("DOWN_BUTTON", ilUtil::getImagePath('a_down.png'));
485  $tpl->parseCurrentBlock();
486  }
487  if ($this->getShowPoints())
488  {
489  $tpl->setCurrentBlock("points");
490  $tpl->setVariable("POINTS_ID", $this->getPostVar() . "[points][$i]");
491  $tpl->setVariable("POINTS_POST_VAR", $this->getPostVar());
492  $tpl->setVariable("POINTS_ROW_NUMBER", $i);
493  $tpl->parseCurrentBlock();
494  }
495  $tpl->setCurrentBlock("row");
496  $class = ($i % 2 == 0) ? "even" : "odd";
497  if ($i == 0) $class .= " first";
498  if ($i == count($this->values)-1) $class .= " last";
499  $tpl->setVariable("ROW_CLASS", $class);
500  $tpl->setVariable("POST_VAR", $this->getPostVar());
501  $tpl->setVariable("ROW_NUMBER", $i);
502  if(!$this->disable_actions)
503  {
504  //$tpl->setCurrentBlock('addremove');
505  $tpl->setVariable( "ID", $this->getPostVar() . "[answer][$i]" );
506  $tpl->setVariable( "CMD_ADD", "cmd[add" . $this->getFieldId() . "][$i]" );
507  $tpl->setVariable( "CMD_REMOVE", "cmd[remove" . $this->getFieldId() . "][$i]" );
508  $tpl->setVariable("ADD_BUTTON", ilUtil::getImagePath('edit_add.png'));
509  $tpl->setVariable("REMOVE_BUTTON", ilUtil::getImagePath('edit_remove.png'));
510  }
511  if ($this->getDisabled())
512  {
513  $tpl->setVariable("DISABLED_POINTS", " disabled=\"disabled\"");
514  }
515  $tpl->parseCurrentBlock();
516  $i++;
517  }
518 
519  if ($this->getSingleline())
520  {
521  if (!$this->hideImages)
522  {
523  if (is_array($this->getSuffixes()))
524  {
525  $suff_str = $delim = "";
526  foreach($this->getSuffixes() as $suffix)
527  {
528  $suff_str.= $delim.".".$suffix;
529  $delim = ", ";
530  }
531  $tpl->setCurrentBlock('allowed_image_suffixes');
532  $tpl->setVariable("TXT_ALLOWED_SUFFIXES", $lng->txt("file_allowed_suffixes")." ".$suff_str);
533  $tpl->parseCurrentBlock();
534  }
535  $tpl->setCurrentBlock("image_heading");
536  $tpl->setVariable("ANSWER_IMAGE", $lng->txt('answer_image'));
537  $tpl->setVariable("TXT_MAX_SIZE", ilUtil::getFileSizeInfo());
538  $tpl->parseCurrentBlock();
539  }
540  }
541 
542  if ($this->getShowPoints())
543  {
544  $tpl->setCurrentBlock("points_heading");
545  $tpl->setVariable("POINTS_TEXT", $lng->txt('points'));
546  $tpl->parseCurrentBlock();
547  }
548  if(!$this->disable_actions)
549  {
550  $tpl->setVariable("COMMANDS_TEXT", $lng->txt('actions'));
551  }
552  $tpl->setVariable("ELEMENT_ID", $this->getPostVar());
553  $tpl->setVariable("TEXT_YES", $lng->txt('yes'));
554  $tpl->setVariable("TEXT_NO", $lng->txt('no'));
555  $tpl->setVariable("DELETE_IMAGE_HEADER", $lng->txt('delete_image_header'));
556  $tpl->setVariable("DELETE_IMAGE_QUESTION", $lng->txt('delete_image_question'));
557  $tpl->setVariable("ANSWER_TEXT", $lng->txt('answer_text'));
558  //$tpl->setVariable("COMMANDS_TEXT", $lng->txt('actions'));
559 
560  $a_tpl->setCurrentBlock("prop_generic");
561  $a_tpl->setVariable("PROP_GENERIC", $tpl->get());
562  $a_tpl->parseCurrentBlock();
563 
564  global $tpl;
565  include_once "./Services/YUI/classes/class.ilYuiUtil.php";
567  $tpl->addJavascript("./Modules/TestQuestionPool/templates/default/singlechoicewizard.js");
568  }
static prepareFormOutput($a_str, $a_strip=false)
prepares string output for html forms public
getMaxLength()
Get Max Length.
getPostVar()
Get Post Variable.
static getFileSizeInfo()
static getImagePath($img, $module_path="", $mode="output", $offline=false)
get image path (for images located in a template directory)
getFieldId()
Get Post Variable.
special template class to simplify handling of ITX/PEAR
static initDomEvent()
Init YUI DomEvent.
if(isset($_FILES['img_file']['size']) && $_FILES['img_file']['size'] > 0) $tpl
global $lng
Definition: privfeed.php:40
+ Here is the call graph for this function:

◆ setAllowMove()

ilSingleChoiceWizardInputGUI::setAllowMove (   $a_allow_move)

Set allow move.

Parameters
boolean$a_allow_moveAllow move

Definition at line 190 of file class.ilSingleChoiceWizardInputGUI.php.

191  {
192  $this->allowMove = $a_allow_move;
193  }

◆ setDisableActions()

ilSingleChoiceWizardInputGUI::setDisableActions (   $disable_actions)
Parameters
boolean$disable_actions

Definition at line 50 of file class.ilSingleChoiceWizardInputGUI.php.

References $disable_actions.

51  {
52  $this->disable_actions = $disable_actions;
53  }

◆ setDisableText()

ilSingleChoiceWizardInputGUI::setDisableText (   $disable_text)
Parameters
boolean$disable_text

Definition at line 58 of file class.ilSingleChoiceWizardInputGUI.php.

References $disable_text.

59  {
60  $this->disable_text = $disable_text;
61  }

◆ setDisableUpload()

ilSingleChoiceWizardInputGUI::setDisableUpload (   $disable_upload)
Parameters
boolean$disable_upload

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

References $disable_upload.

43  {
44  $this->disable_upload = $disable_upload;
45  }

◆ setHideImages()

ilSingleChoiceWizardInputGUI::setHideImages (   $a_hide)

Set hide images.

Parameters
array$a_hideHide images

Definition at line 100 of file class.ilSingleChoiceWizardInputGUI.php.

101  {
102  $this->hideImages = $a_hide;
103  }

◆ setQuestionObject()

ilSingleChoiceWizardInputGUI::setQuestionObject (   $a_value)

Set question object.

Parameters
object$a_valuetest object

Definition at line 170 of file class.ilSingleChoiceWizardInputGUI.php.

171  {
172  $this->qstObject =& $a_value;
173  }

◆ setShowPoints()

ilSingleChoiceWizardInputGUI::setShowPoints (   $a_value)

Definition at line 115 of file class.ilSingleChoiceWizardInputGUI.php.

116  {
117  $this->showPoints = $a_value;
118  }

◆ setSingleline()

ilSingleChoiceWizardInputGUI::setSingleline (   $a_value)

Set singleline.

Parameters
boolean$a_valueValue

Definition at line 150 of file class.ilSingleChoiceWizardInputGUI.php.

151  {
152  $this->singleline = $a_value;
153  }

◆ setSuffixes()

ilSingleChoiceWizardInputGUI::setSuffixes (   $a_suffixes)

Set Accepted Suffixes.

Parameters
array$a_suffixesAccepted Suffixes

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

Referenced by __construct().

91  {
92  $this->suffixes = $a_suffixes;
93  }
+ Here is the caller graph for this function:

◆ setValue()

ilSingleChoiceWizardInputGUI::setValue (   $a_value)

Set Value.

Parameters
string$a_valueValue

Definition at line 68 of file class.ilSingleChoiceWizardInputGUI.php.

References ilTextInputGUI\$value.

69  {
70  $this->values = array();
71  if (is_array($a_value))
72  {
73  if (is_array($a_value['answer']))
74  {
75  foreach ($a_value['answer'] as $index => $value)
76  {
77  include_once "./Modules/TestQuestionPool/classes/class.assAnswerBinaryStateImage.php";
78  $answer = new ASS_AnswerBinaryStateImage($value, $a_value['points'][$index], $index, 1, $a_value['imagename'][$index]);
79  array_push($this->values, $answer);
80  }
81  }
82  }
83  }
Class for answers with a binary state indicator.

◆ setValues()

ilSingleChoiceWizardInputGUI::setValues (   $a_values)

Set Values.

Parameters
array$a_valueValue

Definition at line 130 of file class.ilSingleChoiceWizardInputGUI.php.

131  {
132  $this->values = $a_values;
133  }

Field Documentation

◆ $allowMove

ilSingleChoiceWizardInputGUI::$allowMove = false
protected

Definition at line 14 of file class.ilSingleChoiceWizardInputGUI.php.

Referenced by getAllowMove().

◆ $disable_actions

ilSingleChoiceWizardInputGUI::$disable_actions = false
protected

Definition at line 23 of file class.ilSingleChoiceWizardInputGUI.php.

Referenced by setDisableActions().

◆ $disable_text

ilSingleChoiceWizardInputGUI::$disable_text = false
protected

Definition at line 21 of file class.ilSingleChoiceWizardInputGUI.php.

Referenced by setDisableText().

◆ $disable_upload

ilSingleChoiceWizardInputGUI::$disable_upload = false
protected

Definition at line 22 of file class.ilSingleChoiceWizardInputGUI.php.

Referenced by setDisableUpload().

◆ $hideImages

ilSingleChoiceWizardInputGUI::$hideImages = false
protected

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

Referenced by checkInput().

◆ $qstObject

ilSingleChoiceWizardInputGUI::$qstObject = null
protected

Definition at line 16 of file class.ilSingleChoiceWizardInputGUI.php.

Referenced by getQuestionObject().

◆ $showPoints

ilSingleChoiceWizardInputGUI::$showPoints = true
protected

Definition at line 18 of file class.ilSingleChoiceWizardInputGUI.php.

Referenced by getShowPoints().

◆ $singleline

ilSingleChoiceWizardInputGUI::$singleline = true
protected

Definition at line 15 of file class.ilSingleChoiceWizardInputGUI.php.

Referenced by getSingleline().

◆ $suffixes

ilSingleChoiceWizardInputGUI::$suffixes = array()
protected

Definition at line 17 of file class.ilSingleChoiceWizardInputGUI.php.

Referenced by getSuffixes().

◆ $values

ilSingleChoiceWizardInputGUI::$values = array()
protected

Definition at line 13 of file class.ilSingleChoiceWizardInputGUI.php.

Referenced by getValues().


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