summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorwebgeer2006-10-23 07:19:24 (GMT)
committer webgeer2006-10-23 07:19:24 (GMT)
commit872982b22f574e09a686851849d975cca290be5e (patch)
treef7d63cba3ad2b8839cbf478da70856a88250e0e9
parentd34058abb0f22e4d15cf0dcd200846309747463d (diff)
various fixes
-rw-r--r--gmap.module12
-rw-r--r--gmap_location.module4
2 files changed, 9 insertions, 7 deletions
diff --git a/gmap.module b/gmap.module
index 53ba7cf..4733842 100644
--- a/gmap.module
+++ b/gmap.module
@@ -87,7 +87,7 @@ function gmap_perm() {
*
*/
function gmap_draw_map($gmap, $javascript='') {
- global $base_url;
+ global $base_url, $node;
_gmap_doheader();
if (file_exists('misc/gxmarker.2.js')) {
@@ -345,6 +345,8 @@ function gmap_draw_map($gmap, $javascript='') {
$mytext = '<div class="gmap-popup" style="'.$divstyle.'">'.$mytext.'</div>';
}
elseif (strlen(trim($mytext))>0){
+ //special line to insert nodeid into text. Uncomment this for it to work.
+ $mytext=str_replace('##NODE##', $node->nid, $mytext);
$mytext = '<div class="gmap-popup">'.$mytext.'</div>';
}
else {
@@ -1220,11 +1222,11 @@ function theme_views_view_gmap($view, $nodes) {
if (($location['lat']) && ($location['lon'])) {
$marker_label = '';
foreach ($view->field as $field) {
- $marker_label .= "<p>" . views_theme_field('views_handle_field', $field['queryname'], $fields, $field, $node) . "</p>";
+ $marker_label .= '<div class="'. $field['field'] .'">'. views_theme_field('views_handle_field', $field['queryname'], $fields, $field, $node) .'</div>';
}
- $markers[] = array('markername'=>'view',
- 'label' => $marker_label,
- 'point' =>$location['lat'] . ',' . $location['lon']);
+ $markers[] = array('markername' => variable_get('gmap_node_marker_'.$node_data->type, ''),
+ 'label' => str_replace("'","\'",$marker_label),
+ 'point' => $location['lat'] . ',' . $location['lon']);
}
}
$thismap = array('id' => 'view_gmap', 'markers' => $markers);
diff --git a/gmap_location.module b/gmap_location.module
index 5f555ea..3a20458 100644
--- a/gmap_location.module
+++ b/gmap_location.module
@@ -27,7 +27,7 @@ function gmap_location_help($section) {
*/
function gmap_location_perm() {
- return array('show user map', 'user locations', 'show node map');
+ return array('set user location', 'show user map', 'user locations', 'show node map');
}
/**
@@ -566,7 +566,7 @@ function theme_gmap_location_user_html($account) {
}
function gmap_location_user($op, &$edit, &$user, $category = NULL) {
- if (module_exist('gmap') && variable_get('gmap_user', 0)) {
+ if (module_exist('gmap') && variable_get('gmap_user', 0) && user_access('set user location')) {
$object->gmap_location_latitude = $edit['gmap_location_latitude'];
$object->gmap_location_longitude = $edit['gmap_location_longitude'];
$object->oid = $user->uid;