Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fixed issue: Google Maps API key not being used when entered

  • Loading branch information...
commit 95b8f8afed61c9279189e135dff3d2ed7c83e551 1 parent 61b3ddd
@c-schmitz c-schmitz authored
View
3  .htaccess
@@ -3,8 +3,7 @@
# if a directory or a file exists, use it directly
RewriteCond %{REQUEST_FILENAME} !-f
- RewriteCond %{REQUEST_FILENAME} !-d
-
+
# otherwise forward it to index.php
RewriteRule . index.php
</IfModule>
View
7 application/helpers/admin/statistics_helper.php
@@ -3188,7 +3188,12 @@ public function generate_statistics($surveyid, $allfields, $q2show='all', $usegr
break;
case 'html':
- $statisticsoutput .= "<script type=\"text/javascript\" src=\"http://maps.googleapis.com/maps/api/js?sensor=false\"></script>\n"
+ $sGoogleMapsAPIKey = trim(Yii::app()->getConfig("googleMapsAPIKey"));
+ if ($sGoogleMapsAPIKey!='')
+ {
+ $sGoogleMapsAPIKey='&key='.$sGoogleMapsAPIKey;
+ }
+ $statisticsoutput .= "<script type=\"text/javascript\" src=\"http://maps.googleapis.com/maps/api/js?sensor=false$sGoogleMapsAPIKey\"></script>\n"
."<script type=\"text/javascript\">var site_url='".Yii::app()->baseUrl."';var temppath='$tempurl';var imgpath='".Yii::app()->getConfig('adminimageurl')."';var aGMapData=".ls_json_encode($agmapdata) .";var aStatData=".ls_json_encode($astatdata)."</script>";
return $statisticsoutput;
View
10 application/helpers/qanda_helper.php
@@ -3463,7 +3463,11 @@ function do_shortfreetext($ia)
global $thissurvey;
$clang = Yii::app()->lang;
- $googleMapsAPIKey = Yii::app()->getConfig("googleMapsAPIKey");
+ $sGoogleMapsAPIKey = trim(Yii::app()->getConfig("googleMapsAPIKey"));
+ if ($sGoogleMapsAPIKey!='')
+ {
+ $sGoogleMapsAPIKey='&key='.$sGoogleMapsAPIKey;
+ }
$extraclass ="";
$aQuestionAttributes = getQuestionAttributeValues($ia[0], $ia[4]);
@@ -3615,9 +3619,9 @@ class=\"mapservice\" value = \"{$aQuestionAttributes['location_mapservice']}\" >
</div>";
Yii::app()->getClientScript()->registerScriptFile(Yii::app()->getConfig('generalscripts')."map.js");
if ($aQuestionAttributes['location_mapservice']==1 && !empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != "off")
- Yii::app()->getClientScript()->registerScriptFile("https://maps.googleapis.com/maps/api/js?sensor=false");
+ Yii::app()->getClientScript()->registerScriptFile("https://maps.googleapis.com/maps/api/js?sensor=false$sGoogleMapsAPIKey");
else if ($aQuestionAttributes['location_mapservice']==1)
- Yii::app()->getClientScript()->registerScriptFile("http://maps.googleapis.com/maps/api/js?sensor=false");
+ Yii::app()->getClientScript()->registerScriptFile("http://maps.googleapis.com/maps/api/js?sensor=false$sGoogleMapsAPIKey");
elseif ($aQuestionAttributes['location_mapservice']==2)
Yii::app()->getClientScript()->registerScriptFile("http://www.openlayers.org/api/OpenLayers.js");
Please sign in to comment.
Something went wrong with that request. Please try again.