-
-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathgmap_picker.php
37 lines (33 loc) · 1.06 KB
/
gmap_picker.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<?php
// part of qEngine
require './includes/user_init.php';
// Show google map location picker popup
// $cmd = for now only 'picker'
// $mode = 'latlon1' to returns 'lat,lon' as a single value
// 'latlon2' to returns 'lat' & 'lon' as seperate values
// $fid = id of input form field the picker will write to, for $mode = 'latlon1' -> name of the id; for $mode = 'latlon2' -> name of the id, the script will write to '[id]_lat' & '[id]_lon' fields.
// $lat & $lon = default lat & lon
$cmd = get_param('cmd');
$mode = get_param('mode', 'latlon1');
$fid = get_param('fid', 'latlon');
$latlon = get_param('latlon');
$lat = get_param('lat');
$lon = get_param('lon');
// lat lon, if not defined, zoom = 0;
$zoom = 0;
if ($latlon) {
$foo = explode(',', $latlon);
$lat = $foo[0];
$lon = $foo[1];
}
if ($lat || $lon) {
$zoom = 15;
}
$txt['fid'] = $fid;
$txt['lat'] = $lat;
$txt['lon'] = $lon;
$txt['zoom'] = $zoom;
$txt['gmap_api'] = $config['gmap_api'];
$txt['main_body'] = quick_tpl(load_tpl('gmap_picker.tpl'), $txt);
generate_html_header();
flush_tpl('popup');