Skip to content
Snippets Groups Projects
Commit 36f9aaa5 authored by Brandon Bergren's avatar Brandon Bergren
Browse files

Patch gmap in preparation for a major change to location settings.

parent f8755634
No related branches found
No related tags found
No related merge requests found
......@@ -522,7 +522,8 @@ function gmap_location_admin_settings() {
'#title' => t('Marker for %type', array('%type' => $value->name)),
'#default_value' => isset($defaults[$key]) ? $defaults[$key] : 'drupal',
);
if (intval(variable_get('location_maxnum_'. $key, 0)) === 0) {
$settings = variable_get("location_settings_$key", FALSE);
if (!((isset($settings['multiple']['max']) && $settings['multiple']['max']) || variable_get("location_maxnum_$key", 0))) {
$form['node']['gmap_node_markers'][$key]['#description'] = t('This content type is not currently Location enabled.');
}
}
......@@ -553,13 +554,14 @@ function gmap_location_block($op = 'list', $delta = 0, $edit = array()) {
$ntypes = node_get_types();
foreach ($ntypes as $key => $value) {
if (variable_get('location_maxnum_'. $key, 0)) {
$form['gmap_location_block_macro_'. $key] = array(
$settings = variable_get("location_settings_$key", FALSE);
if ((isset($settings['multiple']['max']) && $settings['multiple']['max']) || variable_get("location_maxnum_$key", 0)) {
$form["gmap_location_block_macro_$key"] = array(
'#type' => 'textfield',
'#title' => t('Map Macro for %type', array('%type' => $value->name)),
'#size' => 60,
'#maxlength' => 500,
'#default_value' => variable_get('gmap_location_block_macro_'. $key, ''),
'#default_value' => variable_get("gmap_location_block_macro_$key", ''),
);
}
}
......@@ -605,7 +607,8 @@ function gmap_location_block($op = 'list', $delta = 0, $edit = array()) {
// Save node type specific macros.
$ntypes = node_get_types();
foreach ($ntypes as $key => $value) {
if (variable_get('location_maxnum_'. $key, 0)) {
$settings = variable_get("location_settings_$key", FALSE);
if ((isset($settings['multiple']['max']) && $settings['multiple']['max']) || variable_get("location_maxnum_$key", 0)) {
$val = trim($edit["gmap_location_block_macro_$key"]);
if (empty($val)) {
variable_del("gmap_location_block_macro_$key");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment