Skip to content

Commit ad6daac

Browse files
committed
2.0.2
1 parent 4b96539 commit ad6daac

File tree

2 files changed

+31
-30
lines changed

2 files changed

+31
-30
lines changed

code/Module.class.php

+6-5
Original file line numberDiff line numberDiff line change
@@ -18,8 +18,8 @@ class Module extends FormToolsModule
1818
protected $author = "Ben Keen";
1919
protected $authorEmail = "[email protected]";
2020
protected $authorLink = "http://formtools.org";
21-
protected $version = "2.0.1";
22-
protected $date = "2017-11-07";
21+
protected $version = "2.0.2";
22+
protected $date = "2017-11-26";
2323
protected $originLanguage = "en_us";
2424

2525
protected $nav = array(
@@ -333,12 +333,13 @@ public function includeGoogleMaps($template, $page_data)
333333
*/
334334
public function includeStandaloneGoogleMaps($template, $page_data)
335335
{
336-
$settings = Modules::getModuleSettings();
337-
if (!isset($settings["google_maps_key"]) || empty($settings["google_maps_key"])) {
336+
$google_maps_key = Modules::getModuleSettings("google_maps_key", "field_type_google_maps");
337+
338+
if (empty($google_maps_key)) {
338339
return "";
339340
}
340341

341-
$string = "<script async defer id=\"google-maps-field-lib\" src=\"https://maps.googleapis.com/maps/api/js?key={$settings["google_maps_key"]}&callback=googleMapsInit\"></script>\n";
342+
$string = "<script async defer id=\"google-maps-field-lib\" src=\"https://maps.googleapis.com/maps/api/js?key={$google_maps_key}&callback=googleMapsInit\"></script>\n";
342343

343344
// this function can either return or just echo the code directly. The Form Builder needs it returned,
344345
// as the template hook is called via code to keep the actual templates entered by the administrator's as simple

module_config.php

+25-25
Original file line numberDiff line numberDiff line change
@@ -3,32 +3,32 @@
33
$STRUCTURE = array();
44

55
$HOOKS = array(
6-
array(
7-
"hook_type" => "template",
8-
"action_location" => "head_bottom",
9-
"function_name" => "",
10-
"hook_function" => "includeGoogleMaps",
11-
"priority" => "50"
12-
),
13-
array(
14-
"hook_type" => "template",
15-
"action_location" => "standalone_form_fields_head_bottom",
16-
"function_name" => "",
17-
"hook_function" => "includeStandaloneGoogleMaps",
18-
"priority" => "50"
19-
)
6+
array(
7+
"hook_type" => "template",
8+
"action_location" => "head_bottom",
9+
"function_name" => "",
10+
"hook_function" => "includeGoogleMaps",
11+
"priority" => "50"
12+
),
13+
array(
14+
"hook_type" => "template",
15+
"action_location" => "standalone_form_fields_head_bottom",
16+
"function_name" => "",
17+
"hook_function" => "includeStandaloneGoogleMaps",
18+
"priority" => "50"
19+
)
2020
);
2121

2222
$FILES = array(
23-
"code/",
24-
"code/Module.class.php",
25-
"images/",
26-
"images/google_maps_icon.png",
27-
"index.php",
28-
"lang/",
29-
"lang/en_us.php",
30-
"library.php",
31-
"module_config.php",
32-
"templates/",
33-
"templates/index.tpl"
23+
"code/",
24+
"code/Module.class.php",
25+
"images/",
26+
"images/google_maps_icon.png",
27+
"index.php",
28+
"lang/",
29+
"lang/en_us.php",
30+
"library.php",
31+
"module_config.php",
32+
"templates/",
33+
"templates/index.tpl"
3434
);

0 commit comments

Comments
 (0)