-
-
+
";
-
+
}
return array($answer, $inputnames);
}
@@ -1753,6 +1760,7 @@
{
global $clang, $js_header_includes, $css_header_includes, $thissurvey;
$qidattributes=getQuestionAttributes($ia[0],$ia[4]);
+ $js_header_includes[] = '/scripts/jquery/jquery-ui.js';
$js_header_includes[] = '/scripts/jquery/lime-calendar.js';
@@ -1910,7 +1918,7 @@
{
if ($clang->langcode !== 'en')
{
- $js_header_includes[] = '/scripts/jquery/locale/jquery.ui.datepicker-'.$clang->langcode.'.js';
+ $js_header_includes[] = '/scripts/jquery/locale/ui.datepicker-'.$clang->langcode.'.js';
}
$css_header_includes[]= '/scripts/jquery/css/start/jquery-ui.css';
@@ -1949,9 +1957,9 @@
-
+
-
+
".sprintf($clang->gT('Format: %s'),$dateformatdetails['dateformat'])."
";
}
@@ -2019,7 +2027,7 @@
if (trim($qidattributes['other_replace_text'])!='')
{
- $othertext=$qidattributes['other_replace_text'];
+ $othertext=$clang->gT($qidattributes['other_replace_text']);
}
else
{
@@ -2059,10 +2067,10 @@
$ansresult = db_execute_assoc($ansquery) or safe_die('Couldn\'t get answers
'.$ansquery.'
'.$connect->ErrorMsg()); //Checked
if (!isset($optCategorySeparator))
- {
+ {
while ($ansrow = $ansresult->FetchRow())
{
- $opt_select = '';
+ $opt_select = '';
if ($_SESSION[$ia[1]] == $ansrow['code'])
{
$opt_select = SELECTED;
@@ -2310,7 +2318,7 @@
if (trim($qidattributes['other_replace_text'])!='')
{
- $othertext=$qidattributes['other_replace_text'];
+ $othertext=$clang->gT($qidattributes['other_replace_text']);
}
else
{
@@ -2644,7 +2652,7 @@
{
$check_ans = '';
}
- $answer .= '
'.$clang->gT('No answer')." \n";
+ $answer .= '
'.$clang->gT('No answer')." \n";
}
$answer .= '
@@ -2857,7 +2865,7 @@
$answer .= "\t
\n"
. "\t\n"
. "\t".$clang->gT("Your Ranking").": \n";
-
+
$answer .= $ranklist
. "\t
\n"
. "\t \n"
@@ -2920,10 +2928,10 @@
// Find out if any questions have attributes which reference this questions
// based on value of attribute. This could be array_filter and array_filter_exclude
-
+
$attribute_ref=false;
$inputnames=array();
-
+
$qaquery = "SELECT qid,attribute FROM ".db_table_name('question_attributes')." WHERE value LIKE '".strtolower($ia[2])."' and (attribute='array_filter' or attribute='array_filter_exclude')";
$qaresult = db_execute_assoc($qaquery); //Checked
while($qarow = $qaresult->FetchRow())
@@ -2932,10 +2940,10 @@
$qresult = db_execute_assoc($qquery); //Checked
if ($qresult->RecordCount() > 0)
{
- $attribute_ref = true;
+ $attribute_ref = true;
}
}
-
+
if ($ia[8] == 'Y' || $attribute_ref === true)
{
$checkconditionFunction = "checkconditions";
@@ -2949,7 +2957,7 @@
if (trim($qidattributes['other_replace_text'])!='')
{
- $othertext=$qidattributes['other_replace_text'];
+ $othertext=$clang->gT($qidattributes['other_replace_text']);
}
else
{
@@ -2983,7 +2991,7 @@
$maxanswscript = '';
$exclude_all_others_auto = trim($qidattributes["exclude_all_others_auto"]);
-
+
if ($exclude_all_others_auto=='1'){
$autoArray['list'][]=$ia[1];
$autoArray[$ia[1]]['parent'] = $ia[1];
@@ -3014,7 +3022,7 @@
$maxanswscript = "\t\n";
+ $maxanswscript .= "\tif (count > max)\n"
+ . "{\n"
+ . "alert('".sprintf($clang->gT("Please choose at most %d answer(s) for question \"%s\"","js"), $maxansw, trim(javascript_escape(str_replace(array("\n", "\r"), "", $ia[3]),true,true)))."');\n"
+ . "if (me.type == 'checkbox') {me.checked = false;}\n"
+ . "if (me.type == 'text') {\n"
+ . "\tme.value = '';\n"
+ . "\tif (document.getElementById(me.name + 'cbox') ){\n"
+ . " document.getElementById(me.name + 'cbox').checked = false;\n"
+ . "\t}\n"
+ . "}"
+ . "return max;\n"
+ . "}\n"
+ . "\t}\n"
+ . "\t//-->\n"
+ . "\t\n";
$answer = $maxanswscript . $answer;
}
@@ -3362,14 +3391,14 @@
if (count($excludeallothers)>0)
{
$excludeallotherscript .= "
- if (document.getElementById(value).checked)
- {
- $excludeallotherscripton
- }
- else
- {
- $excludeallotherscriptoff
- }
+ if (document.getElementById(value).checked)
+ {
+ $excludeallotherscripton
+ }
+ else
+ {
+ $excludeallotherscriptoff
+ }
}
//-->
";
@@ -3397,10 +3426,10 @@
$qresult = db_execute_assoc($qquery); //Checked
if ($qresult->RecordCount() > 0)
{
- $attribute_ref = true;
+ $attribute_ref = true;
}
}
-
+
if ($ia[8] == 'Y' || $attribute_ref == true)
{
$checkconditionFunction = "checkconditions";
@@ -3425,7 +3454,7 @@
if (trim($qidattributes['other_replace_text'])!='')
{
- $othertext=$qidattributes['other_replace_text'];
+ $othertext=$clang->gT($qidattributes['other_replace_text']);
}
else
{
@@ -3467,18 +3496,13 @@
;
}
- $qquery = "SELECT other FROM {$dbprefix}questions
- WHERE qid=".$ia[0]." AND language='".$_SESSION['s_lang']."' and parent_qid=0";
+ $qquery = "SELECT other FROM {$dbprefix}questions WHERE qid=".$ia[0]." AND language='".$_SESSION['s_lang']."' and parent_qid=0";
$qresult = db_execute_assoc($qquery); //Checked
while ($qrow = $qresult->FetchRow()) {$other = $qrow['other'];}
if ($qidattributes['random_order']==1) {
- $ansquery = "SELECT * FROM {$dbprefix}questions
- WHERE parent_qid=$ia[0] AND language='".$_SESSION['s_lang']."'
- ORDER BY ".db_random();
+ $ansquery = "SELECT * FROM {$dbprefix}questions WHERE parent_qid=$ia[0] AND language='".$_SESSION['s_lang']."' ORDER BY ".db_random();
} else {
- $ansquery = "SELECT * FROM {$dbprefix}questions
- WHERE parent_qid=$ia[0] AND language='".$_SESSION['s_lang']."'
- ORDER BY question_order";
+ $ansquery = "SELECT * FROM {$dbprefix}questions WHERE parent_qid=$ia[0] AND language='".$_SESSION['s_lang']."' ORDER BY question_order";
}
$ansresult = db_execute_assoc($ansquery); //Checked
$anscount = $ansresult->RecordCount()*2;
@@ -3501,7 +3525,7 @@
$myfname = $ia[1].$ansrow['title'];
$trbc='';
/* Check for array_filter */
-
+
list($htmltbody2, $hiddenfield)=return_array_filter_strings($ia, $qidattributes, $thissurvey, $ansrow, $myfname, $trbc, $myfname, "li");
if($label_width < strlen(trim(strip_tags($ansrow['question']))))
@@ -3544,7 +3568,7 @@
."
\n\t\n\n"
+ $answer_main .= "' onclick='cancelBubbleThis(event);' onkeypress='if (jQuery.trim($(\"#answer{$myfname2}\").val())!=\"\") { document.getElementById(\"answer{$myfname}\").checked=true;$checkconditionFunction(document.getElementById(\"answer{$myfname}\").value,\"$myfname\",\"checkbox\");}' onkeyup='".$callmaxanswscriptcheckbox2."(document.getElementById(\"answer{$myfname}\"))' />\n\t\n\n"
. "\t\n";
// --> END NEW FEATURE - SAVE
@@ -3613,7 +3637,7 @@
{
$maxanswscript .= "\tif (count > max)\n"
. "{\n"
- . "alert('".sprintf($clang->gT("Please choose at most %d answers for question \"%s\"","js"), $maxansw, trim(javascript_escape($ia[3],true,true)))."');\n"
+ . "alert('".sprintf($clang->gT("Please choose at most %d answer(s) for question \"%s\"","js"), $maxansw, trim(javascript_escape($ia[3],true,true)))."');\n"
. "var commentname='answer'+me.name+'comment';\n"
. "if (me.type == 'checkbox') {\n"
. "\tme.checked = false;\n"
@@ -3704,7 +3728,7 @@
// Fetch question attributes
$_SESSION['fieldname'] = $ia[1];
-
+
// Basic uploader
/* $basic = '
'
.'';
@@ -3765,19 +3789,14 @@
$scriptloc = 'uploader.php';
}
- $uploadbutton = " ";
+ $uploadbutton = " ";
- $answer = "\n";
if ($pos)
- $answer .= "";
+ $answer = "";
else
- $answer .= "";
+ $answer = "";
// Modal dialog
$answer .= $uploadbutton;
@@ -3786,25 +3805,15 @@
$answer .= " ";
- }
- else
- {
- $answer .= "0 />";
- }
- }
- else {
+ $answer .= $_SESSION[$ia[1]."_filecount"]." />";
+ else
$answer .= "0 />";
- }
$answer .= "
";
+ //$answer .= ' Trouble uploading files? Try the Simple Uploader '.$basic.'
';
+
$answer .= '';
-
+
$answer .= '
-
+
@@ -4810,7 +4820,7 @@
$js_header_includes[] = "http://maps.google.com/maps?file=api&v=2&sensor=false&key={$googleMapsAPIKey}";
elseif ($qidattributes['location_mapservice']==2)
$js_header_includes[] = "http://www.openlayers.org/api/OpenLayers.js";
-
+
if (isset($qidattributes['hide_tip']) && $qidattributes['hide_tip']==0)
{
$answer .= " \n"
@@ -5538,12 +5548,12 @@
$answertext = "{$answertext} ";
}
$trbc = alternation($trbc , 'row');
-
+
// Get array_filter stuff
list($htmltbody2, $hiddenfield)=return_array_filter_strings($ia, $qidattributes, $thissurvey, $ansrow, $myfname, $trbc, $myfname);
$answer_t_content .= $htmltbody2;
-
+
$answer_t_content .= "\n"
. "\t\n"
. $hiddenfield
@@ -5814,7 +5824,7 @@
{
$useDropdownLayout = false;
}
-
+
$lresult = db_execute_assoc($lquery); //Checked
if ($useDropdownLayout === false && $lresult->RecordCount() > 0)
{
@@ -5915,7 +5925,7 @@
$fn++;
}
$answer .= $htmltbody2;
-
+
$answer .= " \n"
. "\t\n$answertext"
. $hiddenfield
@@ -5967,7 +5977,7 @@
$answer .= " onclick=\"$checkconditionFunction(this.value, this.name, this.type)\" />\n\n\t\n";
// --> END NEW FEATURE - SAVE
}
-
+
$answer .= " \n";
$inputnames[]=$myfname;
//IF a MULTIPLE of flexi-redisplay figure, repeat the headings
@@ -6003,7 +6013,7 @@
'answer' => $lrow['answer']);
$ansquery = "SELECT question FROM {$dbprefix}questions WHERE parent_qid={$ia[0]} AND question like '%|%' ";
$ansresult = db_execute_assoc($ansquery); //Checked
- if ($ansresult->RecordCount()>0) {$right_exists=true;$answerwidth=$answerwidth/2;} else {$right_exists=false;}
+ if ($ansresult->RecordCount()>0) {$right_exists=true;$answerwidth=$answerwidth/2;} else {$right_exists=false;}
// $right_exists is a flag to find out if there are any right hand answer parts. If there arent we can leave out the right td column
if ($qidattributes['random_order']==1) {
$ansquery = "SELECT * FROM {$dbprefix}questions WHERE parent_qid={$ia[0]} AND language='".$_SESSION['s_lang']."' ORDER BY ".db_random();
@@ -6055,7 +6065,7 @@
// Get array_filter stuff
list($htmltbody2, $hiddenfield)=return_array_filter_strings($ia, $qidattributes, $thissurvey, $ansrow, $myfname, $trbc, $myfname);
$answer .= $htmltbody2;
-
+
$answer .= "\n"
. "\t\n$answertext"
. $hiddenfield
@@ -6065,7 +6075,7 @@
$answer .= $_SESSION[$myfname];
}
$answer .= "\" />\n\t \n";
-
+
$answer .= "\t\n"
. "\n";
@@ -6094,8 +6104,8 @@
$answer .= '>'.$clang->gT('No answer')."\n";
}
$answer .= " \n";
-
- if (strpos($answertextsave,'|'))
+
+ if (strpos($answertextsave,'|'))
{
$answertext=substr($answertextsave,strpos($answertextsave,'|')+1);
$answer .= "\t $answertext \n";
@@ -6104,7 +6114,7 @@
{
$answer .= "\t \n";
}
-
+
$answer .= " \n";
$inputnames[]=$myfname;
//IF a MULTIPLE of flexi-redisplay figure, repeat the headings
@@ -6662,12 +6672,12 @@
$answertext = ''.$answertext.' ';
}
}
-
+
// Get array_filter stuff
list($htmltbody2, $hiddenfield)=return_array_filter_strings($ia, $qidattributes, $thissurvey, $ansrow, $myfname, $trbc, $myfname);
$answer .= $htmltbody2;
-
+
if (strpos($answertext,'|')) {$answertext=substr($answertext,0, strpos($answertext,'|'));}
$trbc = alternation($trbc , 'row');
@@ -6701,7 +6711,7 @@
$answer .= "\t
\n"
. "\n"
. "\t \n";
-
+
if($inputboxlayout == false) {
$answer .= "\t\n";
-
+
$inputnames[]=$myfname2;
$thiskey++;
}
@@ -7109,7 +7119,7 @@
$odd_even = alternation($odd_even);
$mycolumns .= " \n";
}
-
+
}
if ($right_exists)
{
@@ -7310,7 +7320,7 @@
. "\t \n";
// --> END NEW FEATURE - SAVE
}
-
+
$answer .= " \n";
$answer .= "\t\n";
// $inputnames[]=$myfname;
@@ -7602,6 +7612,6 @@
} //while
return $text;
}
+
-
-// Closing PHP tag intentionally left out - yes, it is okay
+// Closing PHP tag intentionally left out - yes, it is okay