|
| setValue ($a_value) |
| Set Value. More...
|
|
| checkInput () |
| Check input, strip slashes etc. More...
|
|
| insert ($a_tpl) |
| Insert property html. More...
|
|
| __construct ($a_title='', $a_postvar='') |
| Constructor. More...
|
|
| 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) |
|
| __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...
|
|
| setDataSourceSubmitOnSelection ($a_stat) |
|
| getDataSourceSubmitOnSelection () |
|
| setDataSourceSubmitUrl ($a_url) |
|
| getDataSourceSubmitUrl () |
|
| setMultiValues (array $a_values) |
|
| insert ($a_tpl) |
| Insert property html. More...
|
|
| getTableFilterHTML () |
| Get HTML for table filter. More...
|
|
| getToolbarHTML () |
| Get HTML for toolbar. More...
|
|
| setDisableHtmlAutoComplete ($autocomplete) |
|
| isHtmlAutoCompleteDisabled () |
|
| 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...
|
|
| __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...
|
|
| stripSlashesAddSpaceFallback ($a_str) |
| Strip slashes with add space fallback, see https://www.ilias.de/mantis/view.php?id=19727. More...
|
|
| getTableFilterLabelFor () |
| Get label "for" attribute value for filter. More...
|
|
| getFormLabelFor () |
| Get label "for" attribute value for form. More...
|
|
| getTableFilterLabelFor () |
| Get label "for" attribute value. More...
|
|
This class represents a multiple 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 13 of file class.ilMultipleChoiceWizardInputGUI.php.
ilMultipleChoiceWizardInputGUI::checkInput |
( |
| ) |
|
Check input, strip slashes etc.
set alert, if input is not ok.
- Returns
- boolean Input ok, true/false
Definition at line 39 of file class.ilMultipleChoiceWizardInputGUI.php.
References $_POST, $DIC, $filename, $index, ilFormPropertyGUI\$lng, ilTextInputGUI\$suffix, ilObjAdvancedEditing\_getUsedHTMLTagsAsString(), ilSingleChoiceWizardInputGUI\ALLOWED_PAGE_HTML_TAGS, ilSubEnabledFormPropertyGUI\checkSubItemsInput(), ilFormPropertyGUI\getPostVar(), ilFormPropertyGUI\getRequired(), ilSingleChoiceWizardInputGUI\getSingleline(), ilSingleChoiceWizardInputGUI\getSuffixes(), ilFormPropertyGUI\setAlert(), ilUtil\stripSlashesRecursive(), and ilUtil\virusHandling().
44 include_once
"./Services/AdvancedEditing/classes/class.ilObjAdvancedEditing.php";
55 if (is_array($foundvalues)) {
57 if (is_array($foundvalues[
'answer'])) {
58 foreach ($foundvalues[
'answer'] as $aidx => $answervalue) {
59 if (((strlen($answervalue)) == 0) && (strlen($foundvalues[
'imagename'][$aidx]) == 0)) {
67 if (is_array($foundvalues[
'points'])) {
68 foreach ($foundvalues[
'points'] as $points) {
72 if (((strlen($points)) == 0) || (!is_numeric($points))) {
73 $this->
setAlert(
$lng->txt(
"form_msg_numeric_value_required"));
77 foreach ($foundvalues[
'points_unchecked'] as $points) {
78 if (((strlen($points)) == 0) || (!is_numeric($points))) {
79 $this->
setAlert(
$lng->txt(
"form_msg_numeric_value_required"));
85 $this->
setAlert(
$lng->txt(
"enter_enough_positive_points_checked"));
89 if (is_array($_FILES) && count($_FILES) && $this->
getSingleline()) {
90 if (!$this->hideImages) {
91 if (is_array($_FILES[$this->
getPostVar()][
'error'][
'image'])) {
96 case UPLOAD_ERR_INI_SIZE:
97 $this->
setAlert(
$lng->txt(
"form_msg_file_size_exceeds"));
101 case UPLOAD_ERR_FORM_SIZE:
102 $this->
setAlert(
$lng->txt(
"form_msg_file_size_exceeds"));
106 case UPLOAD_ERR_PARTIAL:
107 $this->
setAlert(
$lng->txt(
"form_msg_file_partially_uploaded"));
111 case UPLOAD_ERR_NO_FILE:
113 if ((!strlen($foundvalues[
'imagename'][$index])) && (!strlen($foundvalues[
'answer'][$index]))) {
120 case UPLOAD_ERR_NO_TMP_DIR:
121 $this->
setAlert(
$lng->txt(
"form_msg_file_missing_tmp_dir"));
125 case UPLOAD_ERR_CANT_WRITE:
126 $this->
setAlert(
$lng->txt(
"form_msg_file_cannot_write_to_disk"));
130 case UPLOAD_ERR_EXTENSION:
131 $this->
setAlert(
$lng->txt(
"form_msg_file_upload_stopped_ext"));
144 if (is_array($_FILES[$this->
getPostVar()][
'tmp_name'][
'image'])) {
145 foreach ($_FILES[$this->
getPostVar()][
'tmp_name'][
'image'] as $index => $tmpname) {
148 $suffix = $filename_arr[
"extension"];
152 if (strlen($tmpname) && is_array($this->
getSuffixes())) {
154 $this->
setAlert(
$lng->txt(
"form_msg_file_wrong_file_type"));
161 if (is_array($_FILES[$this->
getPostVar()][
'tmp_name'][
'image'])) {
162 foreach ($_FILES[$this->
getPostVar()][
'tmp_name'][
'image'] as $index => $tmpname) {
165 $suffix = $filename_arr[
"extension"];
169 if (strlen($tmpname)) {
171 if ($vir[0] ==
false) {
172 $this->
setAlert(
$lng->txt(
"form_msg_file_virus_found") .
"<br />" . $vir[1]);
static virusHandling($a_file, $a_orig_name="", $a_clean=true)
scan file for viruses and clean files if possible
static _getUsedHTMLTagsAsString($a_module="")
Returns a string of all allowed HTML tags for text editing.
static stripSlashesRecursive($a_data, $a_strip_html=true, $a_allow="")
Strip slashes from array and sub-arrays.
ilMultipleChoiceWizardInputGUI::insert |
( |
|
$a_tpl | ) |
|
Insert property html.
- Parameters
-
Definition at line 192 of file class.ilMultipleChoiceWizardInputGUI.php.
References $DIC, $i, ilFormPropertyGUI\$lng, ilTextInputGUI\$suffix, $tpl, ilTextInputGUI\$value, ilGlyphGUI\ADD, ilGlyphGUI\DOWN, ilGlyphGUI\get(), ilSingleChoiceWizardInputGUI\getAllowMove(), ilFormPropertyGUI\getDisabled(), ilFormPropertyGUI\getFieldId(), ilUtil\getFileSizeInfo(), ilTextInputGUI\getMaxLength(), ilFormPropertyGUI\getPostVar(), ilSingleChoiceWizardInputGUI\getSingleline(), ilTextInputGUI\getSize(), ilSingleChoiceWizardInputGUI\getSuffixes(), ilUtil\prepareFormOutput(), ilGlyphGUI\REMOVE, and ilGlyphGUI\UP.
197 $tpl =
new ilTemplate(
"tpl.prop_multiplechoicewizardinput.html",
true,
true,
"Modules/TestQuestionPool");
199 foreach ($this->values as
$value) {
201 if (!$this->hideImages) {
202 if (strlen($value->getImage())) {
203 $imagename = $this->qstObject->getImagePathWeb() . $value->getImage();
204 if (($this->
getSingleline()) && ($this->qstObject->getThumbSize())) {
205 if (@file_exists($this->qstObject->getImagePath() . $this->qstObject->getThumbPrefix() . $value->getImage())) {
206 $imagename = $this->qstObject->getImagePathWeb() . $this->qstObject->getThumbPrefix() . $value->getImage();
209 $tpl->setCurrentBlock(
'image');
210 $tpl->setVariable(
'SRC_IMAGE', $imagename);
211 $tpl->setVariable(
'IMAGE_NAME', $value->getImage());
213 $tpl->setVariable(
"TXT_DELETE_EXISTING",
$lng->txt(
"delete_existing_file"));
214 $tpl->setVariable(
"IMAGE_ROW_NUMBER",
$i);
216 $tpl->parseCurrentBlock();
218 $tpl->setCurrentBlock(
'addimage');
219 $tpl->setVariable(
"IMAGE_BROWSE",
$lng->txt(
'select_file'));
220 $tpl->setVariable(
"IMAGE_ID", $this->
getPostVar() .
"[image][$i]");
221 $tpl->setVariable(
"IMAGE_SUBMIT",
$lng->txt(
"upload"));
222 $tpl->setVariable(
"IMAGE_ROW_NUMBER",
$i);
224 $tpl->parseCurrentBlock();
227 if (is_object($value)) {
228 $tpl->setCurrentBlock(
"prop_text_propval");
230 $tpl->parseCurrentBlock();
231 $tpl->setCurrentBlock(
"prop_points_propval");
233 $tpl->parseCurrentBlock();
234 $tpl->setCurrentBlock(
"prop_points_unchecked_propval");
236 $tpl->parseCurrentBlock();
237 $tpl->setCurrentBlock(
"prop_answer_id_propval");
239 $tpl->parseCurrentBlock();
241 $tpl->setCurrentBlock(
'singleline');
243 $tpl->setVariable(
"SINGLELINE_ID", $this->
getPostVar() .
"[answer][$i]");
244 $tpl->setVariable(
"SINGLELINE_ROW_NUMBER",
$i);
248 $tpl->setVariable(
"DISABLED_SINGLELINE",
" disabled=\"disabled\"");
250 $tpl->parseCurrentBlock();
252 if (is_object($value)) {
253 $tpl->setCurrentBlock(
"prop_points_propval");
255 $tpl->parseCurrentBlock();
256 $tpl->setCurrentBlock(
"prop_points_unchecked_propval");
258 $tpl->parseCurrentBlock();
259 $tpl->setCurrentBlock(
"prop_answer_id_propval");
261 $tpl->parseCurrentBlock();
263 $tpl->setCurrentBlock(
'multiline');
265 $tpl->setVariable(
"MULTILINE_ID", $this->
getPostVar() .
"[answer][$i]");
266 $tpl->setVariable(
"MULTILINE_ROW_NUMBER",
$i);
269 $tpl->setVariable(
"DISABLED_MULTILINE",
" disabled=\"disabled\"");
271 $tpl->parseCurrentBlock();
274 $tpl->setCurrentBlock(
"move");
275 $tpl->setVariable(
"CMD_UP",
"cmd[up" . $this->
getFieldId() .
"][$i]");
276 $tpl->setVariable(
"CMD_DOWN",
"cmd[down" . $this->
getFieldId() .
"][$i]");
280 $tpl->parseCurrentBlock();
282 $tpl->setCurrentBlock(
"row");
284 $tpl->setVariable(
"ROW_NUMBER",
$i);
286 $tpl->setVariable(
"POINTS_ID", $this->
getPostVar() .
"[points][$i]");
287 $tpl->setVariable(
"POINTS_UNCHECKED_ID", $this->
getPostVar() .
"[points_unchecked][$i]");
288 $tpl->setVariable(
"CMD_ADD",
"cmd[add" . $this->
getFieldId() .
"][$i]");
289 $tpl->setVariable(
"CMD_REMOVE",
"cmd[remove" . $this->
getFieldId() .
"][$i]");
291 $tpl->setVariable(
"DISABLED_POINTS",
" disabled=\"disabled\"");
295 $tpl->parseCurrentBlock();
300 if (!$this->hideImages) {
302 $suff_str = $delim =
"";
304 $suff_str .= $delim .
"." .
$suffix;
307 $tpl->setCurrentBlock(
'allowed_image_suffixes');
308 $tpl->setVariable(
"TXT_ALLOWED_SUFFIXES",
$lng->txt(
"file_allowed_suffixes") .
" " . $suff_str);
309 $tpl->parseCurrentBlock();
312 $tpl->setCurrentBlock(
"image_heading");
313 $tpl->setVariable(
"ANSWER_IMAGE",
$lng->txt(
'answer_image'));
315 $tpl->parseCurrentBlock();
320 $tpl->setVariable(
"TEXT_YES",
$lng->txt(
'yes'));
321 $tpl->setVariable(
"TEXT_NO",
$lng->txt(
'no'));
322 $tpl->setVariable(
"DELETE_IMAGE_HEADER",
$lng->txt(
'delete_image_header'));
323 $tpl->setVariable(
"DELETE_IMAGE_QUESTION",
$lng->txt(
'delete_image_question'));
324 $tpl->setVariable(
"ANSWER_TEXT",
$lng->txt(
'answer_text'));
325 $tpl->setVariable(
"POINTS_TEXT",
$lng->txt(
'points'));
326 $tpl->setVariable(
"COMMANDS_TEXT",
$lng->txt(
'actions'));
327 $tpl->setVariable(
"POINTS_CHECKED_TEXT",
$lng->txt(
'checkbox_checked'));
328 $tpl->setVariable(
"POINTS_UNCHECKED_TEXT",
$lng->txt(
'checkbox_unchecked'));
330 $a_tpl->setCurrentBlock(
"prop_generic");
331 $a_tpl->setVariable(
"PROP_GENERIC",
$tpl->get());
332 $a_tpl->parseCurrentBlock();
336 $tpl->addJavascript(
"./Services/Form/js/ServiceFormWizardInput.js");
337 $tpl->addJavascript(
"./Modules/TestQuestionPool/templates/default/multiplechoicewizard.js");
static prepareFormOutput($a_str, $a_strip=false)
prepares string output for html forms public
getMaxLength()
Get Max Length.
static get($a_glyph, $a_text="")
Get glyph html.
if($DIC->http() ->request() ->getMethod()=="GET" &&isset($DIC->http() ->request() ->getQueryParams()['tex'])) $tpl