diff --git a/gmap.module b/gmap.module index 53ba7cf8a4c50e9caa967c8c7e10ad067150fbe6..473384288077efca3b33ac2bd24d27cd78191f66 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 = '
'.$mytext.'
'; } 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 = '
'.$mytext.'
'; } 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 .= "

" . views_theme_field('views_handle_field', $field['queryname'], $fields, $field, $node) . "

"; + $marker_label .= '
'. views_theme_field('views_handle_field', $field['queryname'], $fields, $field, $node) .'
'; } - $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 5f555ea487cadbed16a4b426317a631332bc7375..3a2045845803bd617f239f715ad642dc695a5da4 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;