function gmap_location_block_configure in GMap Module 7.2
Same name and namespace in other branches
- 7 gmap_location.module \gmap_location_block_configure()
Implements hook_block_configure().
File
- ./
gmap_location.module, line 637 - GMap Location module is a module to add some gmap funcationality based on location.modules information.
Code
function gmap_location_block_configure($delta = '') {
// Location map.
if ($delta == 0) {
$form['gmap_location_block_macro'] = array(
'#type' => 'textfield',
'#title' => t('Map Macro'),
'#size' => 60,
'#maxlength' => 500,
'#description' => t('A macro to be used as a base map for the location block. This map will be recentered on the location, so the center is not that important. <p>Alternate base map macros can be entered for a specific node type below.'),
'#default_value' => variable_get('gmap_location_block_macro', '[gmap |width=100% |height=200px |control=None |behavior=+autozoom +notype]'),
);
$ntypes = node_type_get_types();
foreach ($ntypes as $key => $value) {
$settings = variable_get("location_settings_node_{$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' => gmap_location_t("nodetype:type:{$key}:name", $value->name),
)),
'#size' => 60,
'#maxlength' => 500,
'#default_value' => variable_get("gmap_location_block_macro_{$key}", ''),
);
}
}
}
elseif ($delta == 1) {
$form['gmap_location_author_block_macro'] = array(
'#type' => 'textfield',
'#title' => t('Map Macro'),
'#size' => 60,
'#maxlength' => 500,
'#description' => t('A macro to be used as a base map for the location block author. This map will be recentered on the location, so the center is not that important.'),
'#default_value' => variable_get('gmap_location_author_block_macro', '[gmap |width=100% |height=200px |control=None |behavior=+autozoom +notype]'),
);
$ntypes = node_type_get_types();
foreach ($ntypes as $type => $name) {
$ntypes[$type] = check_plain(gmap_location_t("nodetype:type:{$type}:name", $name));
}
$form['gmap_location_author_block_types'] = array(
'#type' => 'checkboxes',
'#title' => t('Enable author block for the following content types'),
'#options' => $ntypes,
'#default_value' => variable_get('gmap_location_author_block_types', array()),
);
$form['gmap_location_author_block_marker'] = array(
'#type' => 'gmap_markerchooser',
'#title' => t('Marker to use for author map'),
'#default_value' => variable_get('gmap_location_author_block_marker', 'drupal'),
);
}
return $form;
}