Nextrek
Diff Revisions
1055
vs
1062
for /Web/Smartcharging_search/maps-frame.php
|
@@ -1,23 +1,5 @@ |
1 |
|
- |
<?php |
2 |
|
- |
|
3 |
|
- |
if ($_SERVER['HTTP_HOST'] != "localhost"){ |
4 |
|
- |
define( '_JEXEC', 1 ); |
5 |
|
- |
define('JPATH_BASE', '../'); |
6 |
|
- |
require_once ( JPATH_BASE .'/includes/defines.php' ); |
7 |
|
- |
require_once ( JPATH_BASE .'/includes/framework.php' ); |
8 |
|
- |
|
9 |
|
- |
$language = JFactory::getLanguage(); |
10 |
|
- |
$lang = $language->getTag(); |
11 |
|
- |
} else { |
12 |
|
- |
$lang = "it-IT"; |
13 |
|
- |
} |
14 |
|
- |
|
15 |
|
- |
$mapLang = substr($lang, 0, 2); |
16 |
|
- |
|
17 |
|
- |
?> |
18 |
|
- |
|
19 |
1 |
|
<!DOCTYPE html> |
20 |
|
- |
<html lang="<?php echo $lang ?>" > |
|
2 |
+ |
<html> |
21 |
3 |
|
<head> |
22 |
4 |
|
<meta content="width=device-width, initial-scale=1.0" name="viewport" user-scalable=no> |
23 |
5 |
|
<?php |
|
@@ -39,14 +21,27 @@ |
39 |
21 |
|
<script src="js/popup.js"></script> |
40 |
22 |
|
<script src="js/maps-google.js"></script> |
41 |
23 |
|
<script src="lang/lang.js"></script> |
|
24 |
+ |
<script> |
|
25 |
+ |
$('html').attr("lang", parent.document.documentElement.lang); |
|
26 |
+ |
</script> |
|
27 |
+ |
|
42 |
28 |
|
</head> |
43 |
|
- |
<body> |
|
29 |
+ |
<body id="map-body"> |
44 |
30 |
|
<input id="pac-input" class="controls" type="text"> |
45 |
31 |
|
<script>$('#pac-input').attr("placeholder", getText("Cerca", document.documentElement.lang));</script> |
46 |
32 |
|
<div id="map"></div> |
47 |
|
- |
<script async defer |
48 |
|
- |
src="https://maps.googleapis.com/maps/api/js?key=AIzaSyDUqBLxMo-RgdekbpMbRUQRxr9ZyXXBdWY&language=<?php echo $mapLang ?>&libraries=places&callback=initAutocomplete"> |
|
33 |
+ |
<script> |
|
34 |
+ |
var node = document.createElement("SCRIPT"); |
|
35 |
+ |
node.async = true; |
|
36 |
+ |
node.defer = true; |
|
37 |
+ |
if(document.documentElement.lang != "it-it") |
|
38 |
+ |
node.src="https://maps.googleapis.com/maps/api/js?key=AIzaSyDUqBLxMo-RgdekbpMbRUQRxr9ZyXXBdWY&language=en&libraries=places&callback=initAutocomplete"; |
|
39 |
+ |
else |
|
40 |
+ |
node.src = "https://maps.googleapis.com/maps/api/js?key=AIzaSyDUqBLxMo-RgdekbpMbRUQRxr9ZyXXBdWY&language=it&libraries=places&callback=initAutocomplete"; |
|
41 |
+ |
document.getElementById("map-body").appendChild(node); |
49 |
42 |
|
</script> |
50 |
|
- |
|
|
43 |
+ |
<!--script async defer |
|
44 |
+ |
src="https://maps.googleapis.com/maps/api/js?key=AIzaSyDUqBLxMo-RgdekbpMbRUQRxr9ZyXXBdWY&language=&libraries=places&callback=initAutocomplete"> |
|
45 |
+ |
</script--> |
51 |
46 |
|
</body> |
52 |
47 |
|
</html> |