Example #1
0
 function addFillValue($variable)
 {
     //echo 'adding for: ' . $variable;
     $language = getSurveyLanguage();
     $var = $this->getVariableDescriptive($variable);
     $options = $var->getOptions();
     if (is_array($options)) {
         for ($i = 0; $i < sizeof($options); $i++) {
             $option =& $options[$i];
             $option["label"] = $this->replaceFills($option["label"], true);
         }
     }
     $t = $var->getAnswerType();
     $emptywarning = $this->replaceFills($var->getEmptyMessage(), true);
     $inlineansweredwarning = $this->replaceFills($var->getErrorMessageInlineAnswered());
     $inlinejavascript = $this->replaceFills($var->getInlineJavascript(), true);
     $pagejavascript = $this->replaceFills($var->getPageJavascript(), true);
     $scripts = $this->replaceFills($var->getScripts(), true);
     $id = $this->replaceFills($var->getID(), true);
     $inlinestyle = $this->replaceFills($var->getInlineStyle(), true);
     $pagestyle = $this->replaceFills($var->getPageStyle(), true);
     $filltext = $this->replaceFills($var->getFillText(), true);
     $checktext = $this->replaceFills($var->getCheckText(), true);
     $placeholder = $this->replaceFills($var->getPlaceholder(), true);
     $pageheader = $this->replaceFills($var->getPageHeader(), true);
     $pagefooter = $this->replaceFills($var->getPageFooter(), true);
     $extra = array();
     if (!inArray($t, array(ANSWER_TYPE_NONE, ANSWER_TYPE_SECTION))) {
         $eq = $this->replaceFills($var->getComparisonEqualTo(), true);
         $neq = $this->replaceFills($var->getComparisonNotEqualTo(), true);
         $geq = $this->replaceFills($var->getComparisonGreaterEqualTo(), true);
         $ge = $this->replaceFills($var->getComparisonGreater(), true);
         $seq = $this->replaceFills($var->getComparisonSmallerEqualTo(), true);
         $se = $this->replaceFills($var->getComparisonSmaller(), true);
         $ereq = "";
         $erneq = "";
         $ergeq = "";
         $erge = "";
         $erseq = "";
         $erse = "";
         if ($eq != "") {
             $ereq = $this->replaceFills($var->getErrorMessageComparisonEqualTo(), true);
         }
         if ($neq != "") {
             $erneq = $this->replaceFills($var->getErrorMessageComparisonNotEqualTo(), true);
         }
         if ($geq != "") {
             $ergeq = $this->replaceFills($var->getErrorMessageComparisonGreaterEqualTo(), true);
         }
         if ($ge != "") {
             $erge = $this->replaceFills($var->getErrorMessageComparisonGreater(), true);
         }
         if ($seq != "") {
             $erseq = $this->replaceFills($var->getErrorMessageComparisonSmallerEqualTo(), true);
         }
         if ($se != "") {
             $erse = $this->replaceFills($var->getErrorMessageComparisonSmaller(), true);
         }
         $one = array(SETTING_COMPARISON_EQUAL_TO => $eq, SETTING_COMPARISON_NOT_EQUAL_TO => $neq, SETTING_COMPARISON_GREATER_EQUAL_TO => $geq, SETTING_COMPARISON_GREATER => $ge, SETTING_COMPARISON_SMALLER_EQUAL_TO => $seq, SETTING_COMPARISON_SMALLER => $se);
         $two = array(SETTING_ERROR_MESSAGE_COMPARISON_EQUAL_TO => $ereq, SETTING_ERROR_MESSAGE_COMPARISON_NOT_EQUAL_TO => $erneq, SETTING_ERROR_MESSAGE_COMPARISON_GREATER_EQUAL_TO => $ergeq, SETTING_ERROR_MESSAGE_COMPARISON_GREATER => $erge, SETTING_ERROR_MESSAGE_COMPARISON_SMALLER_EQUAL_TO => $erseq, SETTING_ERROR_MESSAGE_COMPARISON_SMALLER => $erse);
         $extra = array_merge($one, $two);
     } else {
         if (inArray($t, array(ANSWER_TYPE_STRING, ANSWER_TYPE_OPEN))) {
             $eq = $this->replaceFills($var->getComparisonEqualTo(), true);
             $neq = $this->replaceFills($var->getComparisonNotEqualTo(), true);
             $eqign = $this->replaceFills($var->getComparisonEqualToIgnoreCase(), true);
             $neqign = $this->replaceFills($var->getComparisonNotEqualToIgnoreCase(), true);
             $ereq = "";
             $erneq = "";
             $ereqign = "";
             $erneqign = "";
             if ($eq != "") {
                 $ereq = $this->replaceFills($var->getErrorMessageComparisonEqualTo(), true);
             }
             if ($neq != "") {
                 $erneq = $this->replaceFills($var->getErrorMessageComparisonNotEqualTo(), true);
             }
             if ($eqign != "") {
                 $ereqign = $this->replaceFills($var->getErrorMessageComparisonEqualToIgnoreCase(), true);
             }
             if ($neqign != "") {
                 $erneqign = $this->replaceFills($var->getErrorMessageComparisonNotEqualToIgnoreCase(), true);
             }
             $one = array(SETTING_COMPARISON_EQUAL_TO => $eq, SETTING_COMPARISON_NOT_EQUAL_TO => $neq, SETTING_COMPARISON_EQUAL_TO_IGNORE_CASE => $eqign, SETTING_COMPARISON_NOT_EQUAL_TO_IGNORE_CASE => $neqign);
             $two = array(SETTING_ERROR_MESSAGE_COMPARISON_EQUAL_TO => $ereq, SETTING_ERROR_MESSAGE_COMPARISON_NOT_EQUAL_TO => $erneq, SETTING_ERROR_MESSAGE_COMPARISON_EQUAL_TO_IGNORE_CASE => $ereqign, SETTING_ERROR_MESSAGE_COMPARISON_NOT_EQUAL_TO_IGNORE_CASE => $erneqign);
             $extra = array_merge($one, $two);
         }
     }
     switch ($t) {
         case ANSWER_TYPE_STRING:
             /* fall through */
         /* fall through */
         case ANSWER_TYPE_OPEN:
             $inputmask = $this->replaceFills($var->getInputMask(), true);
             $inputmaskcustom = $this->replaceFills($var->getInputMaskCustom(), true);
             $inputmaskplaceholder = $this->replaceFills($var->getInputMaskPlaceholder(), true);
             $minlength = $this->replaceFills($var->getMinimumLength(), true);
             $maxlength = $this->replaceFills($var->getMaximumLength(), true);
             $minwords = $this->replaceFills($var->getMinimumWords(), true);
             $maxwords = $this->replaceFills($var->getMaximumWords(), true);
             $pattern = $this->replaceFills($var->getPattern(), true);
             $minwarning = replacePlaceHolders(array(PLACEHOLDER_MINIMUM_LENGTH => $minlength), $this->replaceFills($var->getErrorMessageMinimumLength(), true));
             $maxwarning = replacePlaceHolders(array(PLACEHOLDER_MAXIMUM_LENGTH => $maxlength), $this->replaceFills($var->getErrorMessageMaximumLength(), true));
             $minwordswarning = replacePlaceHolders(array(PLACEHOLDER_MINIMUM_WORDS => $minwords), $this->replaceFills($var->getErrorMessageMinimumWords(), true));
             $maxwordswarning = replacePlaceHolders(array(PLACEHOLDER_MAXIMUM_WORDS => $maxwords), $this->replaceFills($var->getErrorMessageMaximumWords(), true));
             $patternwarning = replacePlaceHolders(array(PLACEHOLDER_PATTERN => $pattern), $this->replaceFills($var->getErrorMessagePattern(), true));
             $arr = array(SETTING_PAGE_FOOTER => $pagefooter, SETTING_PAGE_HEADER => $pageheader, SETTING_PLACEHOLDER => $placeholder, SETTING_INPUT_MASK_CUSTOM => $inputmaskcustom, SETTING_INPUT_MASK => $inputmask, SETTING_INPUT_MASK_PLACEHOLDER => $inputmaskplaceholder, SETTING_ERROR_MESSAGE_INLINE_ANSWERED => $inlineansweredwarning, SETTING_FILLTEXT => $filltext, SETTING_PRETEXT => $this->replaceFills($var->getPreText(), true), SETTING_POSTTEXT => $this->replaceFills($var->getPostText(), true), SETTING_HOVERTEXT => $this->replaceFills($var->getHoverText(), true), SETTING_QUESTION => $this->replaceFills($var->getQuestion(), true), SETTING_MINIMUM_LENGTH => $minlength, SETTING_MAXIMUM_LENGTH => $maxlength, SETTING_MINIMUM_WORDS => $minwords, SETTING_MAXIMUM_WORDS => $maxwords, SETTING_PATTERN => $pattern, SETTING_ERROR_MESSAGE_MINIMUM_LENGTH => $minwarning, SETTING_ERROR_MESSAGE_MAXIMUM_LENGTH => $maxwarning, SETTING_ERROR_MESSAGE_MINIMUM_WORDS => $minwordswarning, SETTING_ERROR_MESSAGE_MAXIMUM_WORDS => $maxwordswarning, SETTING_ERROR_MESSAGE_PATTERN => $patternwarning, SETTING_EMPTY_MESSAGE => $emptywarning, SETTING_JAVASCRIPT_WITHIN_ELEMENT => $inlinejavascript, SETTING_JAVASCRIPT_WITHIN_PAGE => $pagejavascript, SETTING_SCRIPTS => $scripts, SETTING_ID => $id, SETTING_STYLE_WITHIN_ELEMENT => $inlinestyle, SETTING_STYLE_WITHIN_PAGE => $pagestyle, SETTING_CHECKTEXT => $checktext);
             break;
         case ANSWER_TYPE_RANGE:
             $inputmask = $this->replaceFills($var->getInputMask(), true);
             $inputmaskcustom = $this->replaceFills($var->getInputMaskCustom(), true);
             $inputmaskplaceholder = $this->replaceFills($var->getInputMaskPlaceholder(), true);
             $minimumrange = $this->replaceFills($var->getMinimum(), true);
             $maximumrange = $this->replaceFills($var->getMaximum(), true);
             $otherrange = $this->replaceFills($var->getOtherValues(), true);
             $rangewarning = replacePlaceHolders(array(PLACEHOLDER_MINIMUM => $minimumrange, PLACEHOLDER_MAXIMUM => $maximumrange, PLACEHOLDER_OTHERVALUES => $otherrange), $this->replaceFills($var->getErrorMessageRange(), true));
             $arr = array(SETTING_OTHER_RANGE => $otherrange, SETTING_PAGE_FOOTER => $pagefooter, SETTING_PAGE_HEADER => $pageheader, SETTING_PLACEHOLDER => $placeholder, SETTING_INPUT_MASK_CUSTOM => $inputmaskcustom, SETTING_INPUT_MASK => $inputmask, SETTING_INPUT_MASK_PLACEHOLDER => $inputmaskplaceholder, SETTING_ERROR_MESSAGE_INLINE_ANSWERED => $inlineansweredwarning, SETTING_FILLTEXT => $filltext, SETTING_PRETEXT => $this->replaceFills($var->getPreText(), true), SETTING_POSTTEXT => $this->replaceFills($var->getPostText(), true), SETTING_HOVERTEXT => $this->replaceFills($var->getHoverText(), true), SETTING_QUESTION => $this->replaceFills($var->getQuestion(), true), SETTING_MINIMUM_RANGE => $minimumrange, SETTING_MAXIMUM_RANGE => $maximumrange, SETTING_ERROR_MESSAGE_RANGE => $rangewarning, SETTING_EMPTY_MESSAGE => $emptywarning, SETTING_JAVASCRIPT_WITHIN_ELEMENT => $inlinejavascript, SETTING_JAVASCRIPT_WITHIN_PAGE => $pagejavascript, SETTING_SCRIPTS => $scripts, SETTING_ID => $id, SETTING_STYLE_WITHIN_ELEMENT => $inlinestyle, SETTING_STYLE_WITHIN_PAGE => $pagestyle, SETTING_CHECKTEXT => $checktext);
             break;
         case ANSWER_TYPE_DOUBLE:
             $inputmask = $this->replaceFills($var->getInputMask(), true);
             $inputmaskcustom = $this->replaceFills($var->getInputMaskCustom(), true);
             $inputmaskplaceholder = $this->replaceFills($var->getInputMaskPlaceholder(), true);
             $doublewarning = $this->replaceFills($var->getErrorMessageDouble(), true);
             $arr = array(SETTING_PAGE_FOOTER => $pagefooter, SETTING_PAGE_HEADER => $pageheader, SETTING_PLACEHOLDER => $placeholder, SETTING_INPUT_MASK_CUSTOM => $inputmaskcustom, SETTING_INPUT_MASK => $inputmask, SETTING_INPUT_MASK_PLACEHOLDER => $inputmaskplaceholder, SETTING_ERROR_MESSAGE_DOUBLE => $doublewarning, SETTING_ERROR_MESSAGE_INLINE_ANSWERED => $inlineansweredwarning, SETTING_FILLTEXT => $filltext, SETTING_PRETEXT => $this->replaceFills($var->getPreText(), true), SETTING_POSTTEXT => $this->replaceFills($var->getPostText(), true), SETTING_HOVERTEXT => $this->replaceFills($var->getHoverText(), true), SETTING_QUESTION => $this->replaceFills($var->getQuestion(), true), SETTING_EMPTY_MESSAGE => $emptywarning, SETTING_JAVASCRIPT_WITHIN_ELEMENT => $inlinejavascript, SETTING_JAVASCRIPT_WITHIN_PAGE => $pagejavascript, SETTING_SCRIPTS => $scripts, SETTING_ID => $id, SETTING_STYLE_WITHIN_ELEMENT => $inlinestyle, SETTING_STYLE_WITHIN_PAGE => $pagestyle, SETTING_CHECKTEXT => $checktext);
             break;
         case ANSWER_TYPE_INTEGER:
             $inputmask = $this->replaceFills($var->getInputMask(), true);
             $inputmaskcustom = $this->replaceFills($var->getInputMaskCustom(), true);
             $inputmaskplaceholder = $this->replaceFills($var->getInputMaskPlaceholder(), true);
             $intwarning = $this->replaceFills($var->getErrorMessageInteger(), true);
             $arr = array(SETTING_PAGE_FOOTER => $pagefooter, SETTING_PAGE_HEADER => $pageheader, SETTING_PLACEHOLDER => $placeholder, SETTING_INPUT_MASK_CUSTOM => $inputmaskcustom, SETTING_INPUT_MASK => $inputmask, SETTING_INPUT_MASK_PLACEHOLDER => $inputmaskplaceholder, SETTING_ERROR_MESSAGE_INTEGER => $intwarning, SETTING_ERROR_MESSAGE_INLINE_ANSWERED => $inlineansweredwarning, SETTING_FILLTEXT => $filltext, SETTING_PRETEXT => $this->replaceFills($var->getPreText(), true), SETTING_POSTTEXT => $this->replaceFills($var->getPostText(), true), SETTING_HOVERTEXT => $this->replaceFills($var->getHoverText(), true), SETTING_QUESTION => $this->replaceFills($var->getQuestion(), true), SETTING_EMPTY_MESSAGE => $emptywarning, SETTING_JAVASCRIPT_WITHIN_ELEMENT => $inlinejavascript, SETTING_JAVASCRIPT_WITHIN_PAGE => $pagejavascript, SETTING_SCRIPTS => $scripts, SETTING_ID => $id, SETTING_STYLE_WITHIN_ELEMENT => $inlinestyle, SETTING_STYLE_WITHIN_PAGE => $pagestyle, SETTING_CHECKTEXT => $checktext);
             break;
         case ANSWER_TYPE_SLIDER:
             $textlabel = $this->replaceFills($var->getTextBoxLabel(), true);
             $minimumrange = $this->replaceFills($var->getMinimum(), true);
             $maximumrange = $this->replaceFills($var->getMaximum(), true);
             $rangewarning = replacePlaceHolders(array(PLACEHOLDER_MINIMUM => $minimumrange, PLACEHOLDER_MAXIMUM => $maximumrange), $this->replaceFills($var->getErrorMessageRange(), true));
             $arr = array(SETTING_PAGE_FOOTER => $pagefooter, SETTING_PAGE_HEADER => $pageheader, SETTING_SLIDER_TEXTBOX_LABEL => $textlabel, SETTING_PLACEHOLDER => $placeholder, SETTING_ERROR_MESSAGE_INLINE_ANSWERED => $inlineansweredwarning, SETTING_FILLTEXT => $filltext, SETTING_QUESTION => $this->replaceFills($var->getQuestion(), true), SETTING_MINIMUM_RANGE => $minimumrange, SETTING_MAXIMUM_RANGE => $maximumrange, SETTING_ERROR_MESSAGE_RANGE => $rangewarning, SETTING_EMPTY_MESSAGE => $emptywarning, SETTING_JAVASCRIPT_WITHIN_ELEMENT => $inlinejavascript, SETTING_JAVASCRIPT_WITHIN_PAGE => $pagejavascript, SETTING_SCRIPTS => $scripts, SETTING_ID => $id, SETTING_STYLE_WITHIN_ELEMENT => $inlinestyle, SETTING_STYLE_WITHIN_PAGE => $pagestyle, SETTING_CHECKTEXT => $checktext);
             break;
         case ANSWER_TYPE_ENUMERATED:
             $textlabel = $this->replaceFills($var->getEnumeratedTextBoxLabel(), true);
             $exactinline = $this->replaceFills($var->getInlineExactRequired(), true);
             $exactinlinewarning = "";
             if ($exactinline != "") {
                 $exactinlinewarning = replacePlaceHolders(array(PLACEHOLDER_INLINE_EXACT_REQUIRED => $exactinline), $this->replaceFills($var->getErrorMessageInlineExactRequired(), true));
             }
             $mininline = $this->replaceFills($var->getInlineMinimumRequired(), true);
             $mininlinewarning = "";
             if ($mininline != "") {
                 $mininlinewarning = replacePlaceHolders(array(PLACEHOLDER_INLINE_MINIMUM_REQUIRED => $mininline), $this->replaceFills($var->getErrorMessageInlineMinimumRequired(), true));
             }
             $maxinline = $this->replaceFills($var->getInlineMaximumRequired(), true);
             $maxinlinewarning = "";
             if ($maxinline != "") {
                 $maxinlinewarning = replacePlaceHolders(array(PLACEHOLDER_INLINE_MAXIMUM_REQUIRED => $maxinline), $this->replaceFills($var->getErrorMessageInlineMaximumRequired(), true));
             }
             $exclusiveinlinewarning = $this->replaceFills($var->getErrorMessageInlineExclusive(), true);
             $inclusiveinlinewarning = $this->replaceFills($var->getErrorMessageInlineInclusive(), true);
             $custom = $this->replaceFills($var->getEnumeratedCustom(), true);
             $random = $this->replaceFills($var->getEnumeratedRandomizer(), true);
             $enteredwarning = $this->replaceFills($var->getErrorMessageEnumeratedEntered(), true);
             $arr = array(SETTING_PAGE_FOOTER => $pagefooter, SETTING_PAGE_HEADER => $pageheader, SETTING_ERROR_MESSAGE_ENUMERATED_ENTERED => $enteredwarning, SETTING_ENUMERATED_RANDOMIZER => $random, SETTING_ENUMERATED_CUSTOM => $custom, SETTING_ENUMERATED_TEXTBOX_LABEL => $textlabel, SETTING_PLACEHOLDER => $placeholder, SETTING_ERROR_MESSAGE_INLINE_ANSWERED => $inlineansweredwarning, SETTING_ERROR_MESSAGE_INLINE_EXACT_REQUIRED => $exactinlinewarning, SETTING_ERROR_MESSAGE_INLINE_MAXIMUM_REQUIRED => $maxinlinewarning, SETTING_ERROR_MESSAGE_INLINE_MINIMUM_REQUIRED => $mininlinewarning, SETTING_ERROR_MESSAGE_INLINE_EXCLUSIVE => $exclusiveinlinewarning, SETTING_ERROR_MESSAGE_INLINE_INCLUSIVE => $inclusiveinlinewarning, SETTING_INLINE_MINIMUM_REQUIRED => $mininline, SETTING_INLINE_MAXIMUM_REQUIRED => $maxinline, SETTING_INLINE_EXACT_REQUIRED => $exactinline, SETTING_FILLTEXT => $filltext, SETTING_QUESTION => $this->replaceFills($var->getQuestion(), true), SETTING_OPTIONS => $options, SETTING_EMPTY_MESSAGE => $emptywarning, SETTING_JAVASCRIPT_WITHIN_ELEMENT => $inlinejavascript, SETTING_JAVASCRIPT_WITHIN_PAGE => $pagejavascript, SETTING_SCRIPTS => $scripts, SETTING_ID => $id, SETTING_HOVERTEXT => $this->replaceFills($var->getHoverText(), true), SETTING_CHECKTEXT => $checktext);
             break;
         case ANSWER_TYPE_DROPDOWN:
             $random = $this->replaceFills($var->getEnumeratedRandomizer(), true);
             $arr = array(SETTING_PAGE_FOOTER => $pagefooter, SETTING_PAGE_HEADER => $pageheader, SETTING_ENUMERATED_RANDOMIZER => $random, SETTING_PLACEHOLDER => $placeholder, SETTING_ERROR_MESSAGE_INLINE_ANSWERED => $inlineansweredwarning, SETTING_FILLTEXT => $filltext, SETTING_PRETEXT => $this->replaceFills($var->getPreText(), true), SETTING_POSTTEXT => $this->replaceFills($var->getPostText(), true), SETTING_HOVERTEXT => $this->replaceFills($var->getHoverText(), true), SETTING_QUESTION => $this->replaceFills($var->getQuestion(), true), SETTING_OPTIONS => $options, SETTING_EMPTY_MESSAGE => $emptywarning, SETTING_JAVASCRIPT_WITHIN_ELEMENT => $inlinejavascript, SETTING_JAVASCRIPT_WITHIN_PAGE => $pagejavascript, SETTING_SCRIPTS => $scripts, SETTING_ID => $id, SETTING_STYLE_WITHIN_ELEMENT => $inlinestyle, SETTING_STYLE_WITHIN_PAGE => $pagestyle, SETTING_HOVERTEXT => $this->replaceFills($var->getHoverText(), true), SETTING_CHECKTEXT => $checktext);
             break;
         case ANSWER_TYPE_SETOFENUMERATED:
             $textlabel = $this->replaceFills($var->getEnumeratedTextBoxLabel(), true);
             $minselect = $this->replaceFills($var->getMinimumSelected(), true);
             $maxselect = $this->replaceFills($var->getMaximumSelected(), true);
             $exactselect = $this->replaceFills($var->getExactSelected(), true);
             $invalid = $this->replaceFills($var->getInvalidSelected(), true);
             $invalidsub = $this->replaceFills($var->getInvalidSubSelected(), true);
             $minwarning = "";
             $maxwarning = "";
             $exactwarning = "";
             $invalidsubwarning = "";
             $invalidwarning = "";
             if ($minselect != "") {
                 $minwarning = replacePlaceHolders(array(PLACEHOLDER_MINIMUM_SELECTED => $minselect), $this->replaceFills($var->getErrorMessageSelectMinimum(), true));
             }
             if ($maxselect != "") {
                 $maxwarning = replacePlaceHolders(array(PLACEHOLDER_MAXIMUM_SELECTED => $maxselect), $this->replaceFills($var->getErrorMessageSelectMaximum(), true));
             }
             if ($exactselect != "") {
                 $exactwarning = replacePlaceHolders(array(PLACEHOLDER_EXACT_SELECTED => $exactselect), $this->replaceFills($var->getErrorMessageSelectExact(), true));
             }
             if ($invalidsub != "") {
                 $invalidsubwarning = replacePlaceHolders(array(PLACEHOLDER_INVALIDSUBSET_SELECTED => getInvalidSubsetString($var, $invalidsub)), $this->replaceFills($var->getErrorMessageSelectInvalidSubset(), true));
             }
             if ($invalid != "") {
                 $invalidwarning = replacePlaceHolders(array(PLACEHOLDER_INVALIDSET_SELECTED => getInvalidSetString($var, $invalid)), $this->replaceFills($var->getErrorMessageSelectInvalidSet(), true));
             }
             $enteredwarning = $this->replaceFills($var->getErrorMessageSetOfEnumeratedEntered(), true);
             $exactinline = $this->replaceFills($var->getInlineExactRequired(), true);
             $exactinlinewarning = "";
             if ($exactinline != "") {
                 $exactinlinewarning = replacePlaceHolders(array(PLACEHOLDER_INLINE_EXACT_REQUIRED => $exactinline), $this->replaceFills($var->getErrorMessageInlineExactRequired(), true));
             }
             $mininline = $this->replaceFills($var->getInlineMinimumRequired(), true);
             $mininlinewarning = "";
             if ($mininline != "") {
                 $mininlinewarning = replacePlaceHolders(array(PLACEHOLDER_INLINE_MINIMUM_REQUIRED => $mininline), $this->replaceFills($var->getErrorMessageInlineMinimumRequired(), true));
             }
             $maxinline = $this->replaceFills($var->getInlineMaximumRequired(), true);
             $maxinlinewarning = "";
             if ($maxinline != "") {
                 $maxinlinewarning = replacePlaceHolders(array(PLACEHOLDER_INLINE_MAXIMUM_REQUIRED => $maxinline), $this->replaceFills($var->getErrorMessageInlineMaximumRequired(), true));
             }
             $exclusiveinlinewarning = $this->replaceFills($var->getErrorMessageInlineExclusive(), true);
             $inclusiveinlinewarning = $this->replaceFills($var->getErrorMessageInlineInclusive(), true);
             $custom = $this->replaceFills($var->getEnumeratedCustom(), true);
             $random = $this->replaceFills($var->getEnumeratedRandomizer(), true);
             $arr = array(SETTING_PAGE_FOOTER => $pagefooter, SETTING_PAGE_HEADER => $pageheader, SETTING_ERROR_MESSAGE_SETOFENUMERATED_ENTERED => $enteredwarning, SETTING_ENUMERATED_RANDOMIZER => $random, SETTING_ENUMERATED_CUSTOM => $custom, SETTING_ENUMERATED_TEXTBOX_LABEL => $textlabel, SETTING_PLACEHOLDER => $placeholder, SETTING_ERROR_MESSAGE_INLINE_ANSWERED => $inlineansweredwarning, SETTING_ERROR_MESSAGE_INLINE_EXACT_REQUIRED => $exactinlinewarning, SETTING_ERROR_MESSAGE_INLINE_MAXIMUM_REQUIRED => $maxinlinewarning, SETTING_ERROR_MESSAGE_INLINE_MINIMUM_REQUIRED => $mininlinewarning, SETTING_ERROR_MESSAGE_INLINE_EXCLUSIVE => $exclusiveinlinewarning, SETTING_ERROR_MESSAGE_INLINE_INCLUSIVE => $inclusiveinlinewarning, SETTING_INLINE_MINIMUM_REQUIRED => $mininline, SETTING_INLINE_MAXIMUM_REQUIRED => $maxinline, SETTING_INLINE_EXACT_REQUIRED => $exactinline, SETTING_FILLTEXT => $filltext, SETTING_QUESTION => $this->replaceFills($var->getQuestion(), true), SETTING_OPTIONS => $options, SETTING_MINIMUM_SELECTED => $minselect, SETTING_EXACT_SELECTED => $exactselect, SETTING_MAXIMUM_SELECTED => $maxselect, SETTING_INVALID_SELECTED => $invalid, SETTING_INVALIDSUB_SELECTED => $invalidsub, SETTING_ERROR_MESSAGE_MINIMUM_SELECT => $minwarning, SETTING_ERROR_MESSAGE_MAXIMUM_SELECT => $maxwarning, SETTING_ERROR_MESSAGE_EXACT_SELECT => $exactwarning, SETTING_ERROR_MESSAGE_INVALID_SUB_SELECT => $invalidsubwarning, SETTING_ERROR_MESSAGE_INVALID_SELECT => $invalidwarning, SETTING_EMPTY_MESSAGE => $emptywarning, SETTING_JAVASCRIPT_WITHIN_ELEMENT => $inlinejavascript, SETTING_JAVASCRIPT_WITHIN_PAGE => $pagejavascript, SETTING_SCRIPTS => $scripts, SETTING_ID => $id, SETTING_STYLE_WITHIN_ELEMENT => $inlinestyle, SETTING_STYLE_WITHIN_PAGE => $pagestyle, SETTING_HOVERTEXT => $this->replaceFills($var->getHoverText(), true), SETTING_CHECKTEXT => $checktext);
             break;
         case ANSWER_TYPE_MULTIDROPDOWN:
             $minselect = $this->replaceFills($var->getMinimumSelected(), true);
             $maxselect = $this->replaceFills($var->getMaximumSelected(), true);
             $exactselect = $this->replaceFills($var->getExactSelected(), true);
             $invalid = $this->replaceFills($var->getInvalidSelected(), true);
             $invalidsub = $this->replaceFills($var->getInvalidSubSelected(), true);
             $minwarning = "";
             $maxwarning = "";
             $exactwarning = "";
             $invalidsubwarning = "";
             $invalidwarning = "";
             if ($minselect != "") {
                 $minwarning = replacePlaceHolders(array(PLACEHOLDER_MINIMUM_SELECTED => $minselect), $this->replaceFills($var->getErrorMessageSelectMinimum(), true));
             }
             if ($maxselect != "") {
                 $maxwarning = replacePlaceHolders(array(PLACEHOLDER_MAXIMUM_SELECTED => $maxselect), $this->replaceFills($var->getErrorMessageSelectMaximum(), true));
             }
             if ($exactselect != "") {
                 $exactwarning = replacePlaceHolders(array(PLACEHOLDER_EXACT_SELECTED => $exactselect), $this->replaceFills($var->getErrorMessageSelectExact(), true));
             }
             if ($invalidsub != "") {
                 $invalidsubwarning = replacePlaceHolders(array(PLACEHOLDER_INVALIDSUBSET_SELECTED => getInvalidSubsetString($var, $invalidsub)), $this->replaceFills($var->getErrorMessageSelectInvalidSubset(), true));
             }
             if ($invalid != "") {
                 $invalidwarning = replacePlaceHolders(array(PLACEHOLDER_INVALIDSET_SELECTED => getInvalidSetString($var, $invalid)), $this->replaceFills($var->getErrorMessageSelectInvalidSet(), true));
             }
             $random = $this->replaceFills($var->getEnumeratedRandomizer(), true);
             $arr = array(SETTING_PAGE_FOOTER => $pagefooter, SETTING_PAGE_HEADER => $pageheader, SETTING_ENUMERATED_RANDOMIZER => $random, SETTING_PLACEHOLDER => $placeholder, SETTING_ERROR_MESSAGE_INLINE_ANSWERED => $inlineansweredwarning, SETTING_FILLTEXT => $filltext, SETTING_PRETEXT => $this->replaceFills($var->getPreText(), true), SETTING_POSTTEXT => $this->replaceFills($var->getPostText(), true), SETTING_HOVERTEXT => $this->replaceFills($var->getHoverText(), true), SETTING_QUESTION => $this->replaceFills($var->getQuestion(), true), SETTING_OPTIONS => $options, SETTING_MINIMUM_SELECTED => $minselect, SETTING_EXACT_SELECTED => $exactselect, SETTING_MAXIMUM_SELECTED => $maxselect, SETTING_INVALID_SELECTED => $invalid, SETTING_INVALIDSUB_SELECTED => $invalidsub, SETTING_ERROR_MESSAGE_MINIMUM_SELECT => $minwarning, SETTING_ERROR_MESSAGE_MAXIMUM_SELECT => $maxwarning, SETTING_ERROR_MESSAGE_EXACT_SELECT => $exactwarning, SETTING_ERROR_MESSAGE_INVALID_SUB_SELECT => $invalidsubwarning, SETTING_ERROR_MESSAGE_INVALID_SELECT => $invalidwarning, SETTING_EMPTY_MESSAGE => $emptywarning, SETTING_JAVASCRIPT_WITHIN_ELEMENT => $inlinejavascript, SETTING_JAVASCRIPT_WITHIN_PAGE => $pagejavascript, SETTING_SCRIPTS => $scripts, SETTING_ID => $id, SETTING_STYLE_WITHIN_ELEMENT => $inlinestyle, SETTING_STYLE_WITHIN_PAGE => $pagestyle, SETTING_HOVERTEXT => $this->replaceFills($var->getHoverText(), true), SETTING_CHECKTEXT => $checktext);
             break;
         case ANSWER_TYPE_CALENDAR:
             $dateswarning = replacePlaceHolders(array(PLACEHOLDER_MAXIMUM_CALENDAR => $this->replaceFills($var->getMaximumDatesSelected(), true)), $this->replaceFills($var->getErrorMessageMaximumCalendar(), true));
             $arr = array(SETTING_PAGE_FOOTER => $pagefooter, SETTING_PAGE_HEADER => $pageheader, SETTING_ERROR_MESSAGE_MAXIMUM_CALENDAR => $dateswarning, SETTING_PLACEHOLDER => $placeholder, SETTING_ERROR_MESSAGE_INLINE_ANSWERED => $inlineansweredwarning, SETTING_FILLTEXT => $filltext, SETTING_QUESTION => $this->replaceFills($var->getQuestion(), true), SETTING_MAXIMUM_CALENDAR => $this->replaceFills($var->getMaximumDatesSelected(), true), SETTING_EMPTY_MESSAGE => $emptywarning, SETTING_ERROR_MESSAGE_MAXIMUM_CALENDAR => $dateswarning, SETTING_JAVASCRIPT_WITHIN_ELEMENT => $inlinejavascript, SETTING_JAVASCRIPT_WITHIN_PAGE => $pagejavascript, SETTING_SCRIPTS => $scripts, SETTING_ID => $id, SETTING_STYLE_WITHIN_ELEMENT => $inlinestyle, SETTING_STYLE_WITHIN_PAGE => $pagestyle, SETTING_HOVERTEXT => $this->replaceFills($var->getHoverText(), true), SETTING_CHECKTEXT => $checktext);
             break;
         case ANSWER_TYPE_CUSTOM:
             $custom = $this->replaceFills($var->getAnswerTypeCustom(), true);
             //echo $custom . '---';
             $arr = array(SETTING_PAGE_FOOTER => $pagefooter, SETTING_PAGE_HEADER => $pageheader, SETTING_ANSWERTYPE_CUSTOM => $custom, SETTING_PLACEHOLDER => $placeholder, SETTING_ERROR_MESSAGE_INLINE_ANSWERED => $inlineansweredwarning, SETTING_FILLTEXT => $filltext, SETTING_QUESTION => $this->replaceFills($var->getQuestion(), true), SETTING_MAXIMUM_CALENDAR => $this->replaceFills($var->getMaximumDatesSelected(), true), SETTING_EMPTY_MESSAGE => $emptywarning, SETTING_ERROR_MESSAGE_MAXIMUM_CALENDAR => $dateswarning, SETTING_JAVASCRIPT_WITHIN_ELEMENT => $inlinejavascript, SETTING_JAVASCRIPT_WITHIN_PAGE => $pagejavascript, SETTING_SCRIPTS => $scripts, SETTING_ID => $id, SETTING_STYLE_WITHIN_ELEMENT => $inlinestyle, SETTING_STYLE_WITHIN_PAGE => $pagestyle, SETTING_HOVERTEXT => $this->replaceFills($var->getHoverText(), true), SETTING_CHECKTEXT => $checktext);
             break;
         case ANSWER_TYPE_SLIDER:
             $arr = array(SETTING_SLIDER_LABELS => $this->replaceFills($var->getSliderLabels(), true), SETTING_SLIDER_INCREMENT => $this->replaceFills($var->getIncrement(), true), SETTING_PAGE_FOOTER => $pagefooter, SETTING_PAGE_HEADER => $pageheader, SETTING_PLACEHOLDER => $placeholder, SETTING_ERROR_MESSAGE_INLINE_ANSWERED => $inlineansweredwarning, SETTING_FILLTEXT => $filltext, SETTING_QUESTION => $this->replaceFills($var->getQuestion(), true), SETTING_EMPTY_MESSAGE => $emptywarning, SETTING_JAVASCRIPT_WITHIN_ELEMENT => $inlinejavascript, SETTING_JAVASCRIPT_WITHIN_PAGE => $pagejavascript, SETTING_SCRIPTS => $scripts, SETTING_ID => $id, SETTING_STYLE_WITHIN_ELEMENT => $inlinestyle, SETTING_STYLE_WITHIN_PAGE => $pagestyle, SETTING_HOVERTEXT => $this->replaceFills($var->getHoverText(), true), SETTING_CHECKTEXT => $checktext);
             break;
         case ANSWER_TYPE_DATE:
             $arr = array(SETTING_DATE_FORMAT => $this->replaceFills($var->getDateFormat(), true), SETTING_PAGE_FOOTER => $pagefooter, SETTING_PAGE_HEADER => $pageheader, SETTING_PLACEHOLDER => $placeholder, SETTING_ERROR_MESSAGE_INLINE_ANSWERED => $inlineansweredwarning, SETTING_FILLTEXT => $filltext, SETTING_QUESTION => $this->replaceFills($var->getQuestion(), true), SETTING_EMPTY_MESSAGE => $emptywarning, SETTING_JAVASCRIPT_WITHIN_ELEMENT => $inlinejavascript, SETTING_JAVASCRIPT_WITHIN_PAGE => $pagejavascript, SETTING_SCRIPTS => $scripts, SETTING_ID => $id, SETTING_STYLE_WITHIN_ELEMENT => $inlinestyle, SETTING_STYLE_WITHIN_PAGE => $pagestyle, SETTING_HOVERTEXT => $this->replaceFills($var->getHoverText(), true), SETTING_CHECKTEXT => $checktext);
             break;
         case ANSWER_TYPE_DATETIME:
             $arr = array(SETTING_DATETIME_FORMAT => $this->replaceFills($var->getDateTimeFormat(), true), SETTING_PAGE_FOOTER => $pagefooter, SETTING_PAGE_HEADER => $pageheader, SETTING_PLACEHOLDER => $placeholder, SETTING_ERROR_MESSAGE_INLINE_ANSWERED => $inlineansweredwarning, SETTING_FILLTEXT => $filltext, SETTING_QUESTION => $this->replaceFills($var->getQuestion(), true), SETTING_EMPTY_MESSAGE => $emptywarning, SETTING_JAVASCRIPT_WITHIN_ELEMENT => $inlinejavascript, SETTING_JAVASCRIPT_WITHIN_PAGE => $pagejavascript, SETTING_SCRIPTS => $scripts, SETTING_ID => $id, SETTING_STYLE_WITHIN_ELEMENT => $inlinestyle, SETTING_STYLE_WITHIN_PAGE => $pagestyle, SETTING_HOVERTEXT => $this->replaceFills($var->getHoverText(), true), SETTING_CHECKTEXT => $checktext);
             break;
         case ANSWER_TYPE_TIME:
             $arr = array(SETTING_TIME_FORMAT => $this->replaceFills($var->getTimeFormat(), true), SETTING_PAGE_FOOTER => $pagefooter, SETTING_PAGE_HEADER => $pageheader, SETTING_PLACEHOLDER => $placeholder, SETTING_ERROR_MESSAGE_INLINE_ANSWERED => $inlineansweredwarning, SETTING_FILLTEXT => $filltext, SETTING_QUESTION => $this->replaceFills($var->getQuestion(), true), SETTING_EMPTY_MESSAGE => $emptywarning, SETTING_JAVASCRIPT_WITHIN_ELEMENT => $inlinejavascript, SETTING_JAVASCRIPT_WITHIN_PAGE => $pagejavascript, SETTING_SCRIPTS => $scripts, SETTING_ID => $id, SETTING_STYLE_WITHIN_ELEMENT => $inlinestyle, SETTING_STYLE_WITHIN_PAGE => $pagestyle, SETTING_HOVERTEXT => $this->replaceFills($var->getHoverText(), true), SETTING_CHECKTEXT => $checktext);
             break;
         default:
             $arr = array(SETTING_PAGE_FOOTER => $pagefooter, SETTING_PAGE_HEADER => $pageheader, SETTING_PLACEHOLDER => $placeholder, SETTING_ERROR_MESSAGE_INLINE_ANSWERED => $inlineansweredwarning, SETTING_FILLTEXT => $filltext, SETTING_QUESTION => $this->replaceFills($var->getQuestion(), true), SETTING_EMPTY_MESSAGE => $emptywarning, SETTING_JAVASCRIPT_WITHIN_ELEMENT => $inlinejavascript, SETTING_JAVASCRIPT_WITHIN_PAGE => $pagejavascript, SETTING_SCRIPTS => $scripts, SETTING_ID => $id, SETTING_STYLE_WITHIN_ELEMENT => $inlinestyle, SETTING_STYLE_WITHIN_PAGE => $pagestyle, SETTING_HOVERTEXT => $this->replaceFills($var->getHoverText(), true), SETTING_CHECKTEXT => $checktext);
             break;
     }
     // add
     $this->state->addFillText($variable, array_merge($arr, $extra));
 }
Example #2
0
 function addSetOfEnumeratedChecks($name, $variable, $var, $type)
 {
     $min = $this->engine->getFill($variable, $var, SETTING_MINIMUM_SELECTED);
     if ($min != "") {
         if ($type == ANSWER_TYPE_SETOFENUMERATED) {
             $this->addErrorCheck($name, new ErrorCheck(ERROR_CHECK_MINSELECTED, $min), replacePlaceHolders(array(PLACEHOLDER_MINIMUM_SELECTED => $min), $this->engine->getFill($variable, $var, SETTING_ERROR_MESSAGE_MINIMUM_SELECT)));
         } else {
             $this->addErrorCheck($name, new ErrorCheck(ERROR_CHECK_MINSELECTEDDROPDOWN, $min), replacePlaceHolders(array(PLACEHOLDER_MINIMUM_SELECTED => $min), $this->engine->getFill($variable, $var, SETTING_ERROR_MESSAGE_MINIMUM_SELECT)));
         }
     }
     $max = $this->engine->getFill($variable, $var, SETTING_MAXIMUM_SELECTED);
     if ($max != "") {
         if ($type == ANSWER_TYPE_SETOFENUMERATED) {
             $this->addErrorCheck($name, new ErrorCheck(ERROR_CHECK_MAXSELECTED, $max), replacePlaceHolders(array(PLACEHOLDER_MAXIMUM_SELECTED => $max), $this->engine->getFill($variable, $var, SETTING_ERROR_MESSAGE_MAXIMUM_SELECT)));
         } else {
             $this->addErrorCheck($name, new ErrorCheck(ERROR_CHECK_MAXSELECTEDDROPDOWN, $max), replacePlaceHolders(array(PLACEHOLDER_MAXIMUM_SELECTED => $max), $this->engine->getFill($variable, $var, SETTING_ERROR_MESSAGE_MAXIMUM_SELECT)));
         }
     }
     $exact = $this->engine->getFill($variable, $var, SETTING_EXACT_SELECTED);
     if ($exact != "") {
         if ($type == ANSWER_TYPE_SETOFENUMERATED) {
             $this->addErrorCheck($name, new ErrorCheck(ERROR_CHECK_EXACTSELECTED, $exact), replacePlaceHolders(array(PLACEHOLDER_EXACT_SELECTED => $exact), $this->engine->getFill($variable, $var, SETTING_ERROR_MESSAGE_EXACT_SELECT)));
         } else {
             $this->addErrorCheck($name, new ErrorCheck(ERROR_CHECK_EXACTSELECTEDDROPDOWN, $exact), replacePlaceHolders(array(PLACEHOLDER_EXACT_SELECTED => $exact), $this->engine->getFill($variable, $var, SETTING_ERROR_MESSAGE_EXACT_SELECT)));
         }
     }
     $invalidsub = $this->engine->getFill($variable, $var, SETTING_INVALIDSUB_SELECTED);
     if ($invalidsub != "") {
         if ($type == ANSWER_TYPE_SETOFENUMERATED) {
             $this->addErrorCheck($name, new ErrorCheck(ERROR_CHECK_INVALIDSUBSELECTED, "'" . $invalidsub . "'"), replacePlaceHolders(array(PLACEHOLDER_INVALIDSUBSET_SELECTED => getInvalidSubsetString($var, $invalidsub)), $this->engine->getFill($variable, $var, SETTING_ERROR_MESSAGE_INVALID_SUB_SELECT)));
         } else {
             $this->addErrorCheck($name, new ErrorCheck(ERROR_CHECK_INVALIDSUBSELECTEDDROPDOWN, "'" . $invalidsub . "'"), replacePlaceHolders(array(PLACEHOLDER_INVALIDSUBSET_SELECTED => getInvalidSubsetString($var, $invalidsub)), $this->engine->getFill($variable, $var, SETTING_ERROR_MESSAGE_INVALID_SUB_SELECT)));
         }
     }
     $invalid = $this->engine->getFill($variable, $var, SETTING_INVALID_SELECTED);
     if ($invalid != "") {
         if ($type == ANSWER_TYPE_SETOFENUMERATED) {
             $this->addErrorCheck($name, new ErrorCheck(ERROR_CHECK_INVALIDSELECTED, "'" . $invalid . "'"), replacePlaceHolders(array(PLACEHOLDER_INVALIDSET_SELECTED => getInvalidSetString($var, $invalid)), $this->engine->getFill($variable, $var, SETTING_ERROR_MESSAGE_INVALID_SELECT)));
         } else {
             $this->addErrorCheck($name, new ErrorCheck(ERROR_CHECK_INVALIDSELECTEDDROPDOWN, "'" . $invalid . "'"), replacePlaceHolders(array(PLACEHOLDER_INVALIDSET_SELECTED => getInvalidSetString($var, $invalid)), $this->engine->getFill($variable, $var, SETTING_ERROR_MESSAGE_INVALID_SELECT)));
         }
     }
 }