Skip to content

Commit

Permalink
Fixed issue #05189: IE Non-Secure Warnings on HTTPS survey
Browse files Browse the repository at this point in the history
Dev Moved to Google Maps API V3 
Added switch for API link when using HTTPS
Dev Add map reset function - called when map question shown by conditions

git-svn-id: file:///Users/Shitiz/Downloads/lssvn/source/limesurvey_ci@10708 b72ed6b6-b9f8-46b5-92b4-906544132732
  • Loading branch information
Tony Partner committed Aug 12, 2011
1 parent 819ea67 commit 0841640
Show file tree
Hide file tree
Showing 4 changed files with 206 additions and 196 deletions.
6 changes: 4 additions & 2 deletions application/helpers/qanda_helper.php
Expand Up @@ -5172,8 +5172,10 @@ function textLimit(field, maxlen) {
class=\"mapservice\" value = \"{$qidattributes['location_mapservice']}\" >
<div id=\"gmap_canvas_$ia[1]_c\" style=\"width: {$qidattributes['location_mapwidth']}px; height: {$qidattributes['location_mapheight']}px\"></div>";

if ($qidattributes['location_mapservice']==1)
$js_header_includes[] = "http://maps.google.com/maps?file=api&amp;v=2&amp;sensor=false&amp;key={$googleMapsAPIKey}";
if ($qidattributes['location_mapservice']==1 && $_SERVER['HTTPS'] == "on")
$js_header_includes[] = "https://maps.googleapis.com/maps/api/js?sensor=false";
else if ($qidattributes['location_mapservice']==1)
$js_header_includes[] = "http://maps.googleapis.com/maps/api/js?sensor=false";
elseif ($qidattributes['location_mapservice']==2)
$js_header_includes[] = "http://www.openlayers.org/api/OpenLayers.js";

Expand Down
30 changes: 17 additions & 13 deletions application/libraries/Group_format.php
Expand Up @@ -636,7 +636,7 @@ function checkconditions(value, name, type)
$newjava_runonce = true;
$newjava ="";

$newjava .= "\n\tif (((";
$newjava .= "\n\t\tif (((";

}

Expand Down Expand Up @@ -965,17 +965,21 @@ function checkconditions(value, name, type)

if ((isset($oldq) && $oldq != $cd[0]) || !isset($oldq))//End If Statement
{
$endzone = ")))\n";
$endzone .= "\t{\n";
$endzone .= "document.getElementById('question$cd[0]').style.display='';\n";
$endzone .= "document.getElementById('display$cd[0]').value='on';\n";
$endzone .= "\t}\n";
$endzone .= "\telse\n";
$endzone .= "\t{\n";
$endzone .= "document.getElementById('question$cd[0]').style.display='none';\n";
$endzone .= "document.getElementById('display$cd[0]').value='';\n";
$endzone .= "\t}\n";
$cqcount++;
$endzone = ")))\n";
$endzone .= "\t\t{\n";
$endzone .= "\t\t\tdocument.getElementById('question$cd[0]').style.display='';\n";
$endzone .= "\t\t\tdocument.getElementById('display$cd[0]').value='on';\n";
$endzone .= "\t\t\tif(\$('#question$cd[0] div[id^=\"gmap_canvas\"]').length > 0)\n";
$endzone .= "\t\t\t{\n";
$endzone .= "\t\t\t\tresetMap($cd[0]);\n";
$endzone .= "\t\t\t}\n";
$endzone .= "\t\t}\n";
$endzone .= "\t\telse\n";
$endzone .= "\t\t{\n";
$endzone .= "\t\t\tdocument.getElementById('question$cd[0]').style.display='none';\n";
$endzone .= "\t\t\tdocument.getElementById('display$cd[0]').value='';\n";
$endzone .= "\t\t}\n";
$cqcount++;
}

// If next condition doesn't exist, or if nex condition is on a different question
Expand Down Expand Up @@ -1200,7 +1204,7 @@ function checkconditions(value, name, type)
}

if (isset($java)) {echo $java;}
echo "\n\tdocument.getElementById('runonce').value=1;\n"
echo "\n\t\tdocument.getElementById('runonce').value=1;\n"
. "\t}\n"
."\t//-->\n"
."\t</script>\n\n"; // End checkconditions javascript function
Expand Down
28 changes: 16 additions & 12 deletions application/libraries/Survey_format.php
Expand Up @@ -453,7 +453,7 @@ function checkconditions(value, name, type)
$java .= $endzone;
$endzone = "";
$cqcount=1;
$java .= "\n if (((";
$java .= "\n if (((";
}

if (!isset($oldcq) || !$oldcq)
Expand Down Expand Up @@ -686,17 +686,21 @@ function checkconditions(value, name, type)

if ((isset($oldq) && $oldq != $cd[0]) || !isset($oldq))//Close if statement
{
$endzone = ")))\n"
. " {\n"
. " document.getElementById('question$cd[0]').style.display='';\n"
. " document.getElementById('display$cd[0]').value='on';\n"
. " }\n"
. " else\n"
. " {\n"
. " document.getElementById('question$cd[0]').style.display='none';\n"
. " document.getElementById('display$cd[0]').value='';\n"
. " }\n";
$cqcount++;
$endzone = ")))\n"
. " {\n"
. " document.getElementById('question$cd[0]').style.display='';\n"
. " document.getElementById('display$cd[0]').value='on';\n"
. " if(\$('#question$cd[0] div[id^=\"gmap_canvas\"]').length > 0)\n"
. " {\n"
. " resetMap($cd[0]);\n"
. " }\n"
. " }\n"
. " else\n"
. " {\n"
. " document.getElementById('question$cd[0]').style.display='none';\n"
. " document.getElementById('display$cd[0]').value='';\n"
. " }\n";
$cqcount++;
}
$oldq = $cd[0]; //Update oldq for next loop
$oldcq = $cd[2]; //Update oldcq for next loop
Expand Down

0 comments on commit 0841640

Please sign in to comment.