Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
gmap
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
drupal.org
gmap
Commits
c72311d5
Commit
c72311d5
authored
14 years ago
by
Brandon Bergren
Browse files
Options
Downloads
Patches
Plain Diff
More D7 porting. Fix coder warnings.
parent
78ece299
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
gmap_location.info
+1
-0
1 addition, 0 deletions
gmap_location.info
gmap_location.module
+25
-17
25 additions, 17 deletions
gmap_location.module
with
26 additions
and
17 deletions
gmap_location.info
+
1
−
0
View file @
c72311d5
...
...
@@ -3,5 +3,6 @@ name = GMap Location
description = Display location.module information on Google Maps
package = Location
core = 7.x
files[] = gmap_location.module
dependencies[] = gmap
dependencies[] = location
This diff is collapsed.
Click to expand it.
gmap_location.module
+
25
−
17
View file @
c72311d5
...
...
@@ -25,13 +25,22 @@ function gmap_location_theme() {
}
/**
* Implementation of hook_perm().
* Implementation of hook_perm
ission
().
*/
function
gmap_location_perm
()
{
function
gmap_location_perm
ission
()
{
return
array
(
'view node map'
,
'view user map'
,
'view user location details'
,
'view node map'
=>
array
(
'title'
=>
t
(
'View node map'
),
'description'
=>
t
(
'See the sitewide node map.'
),
),
'view user map'
=>
array
(
'title'
=>
t
(
'View user map'
),
'description'
=>
t
(
'See the sitewide user map.'
),
),
'view user location details'
=>
array
(
'title'
=>
t
(
'View user location details'
),
'description'
=>
t
(
'See the users associated with markers on the sitewide user map.'
),
),
);
}
...
...
@@ -138,7 +147,7 @@ function gmap_location_user_page() {
// The u.name, l.latitude, and l.longitude in the GROUP BY are needed for
// PostgreSQL.
foreach
(
$result
as
$row
)
{
foreach
(
$result
as
$row
)
{
// Determine marker type to show.
$marker
=
$markertypes
[
DRUPAL_AUTHENTICATED_RID
];
if
(
$row
->
role
&&
isset
(
$markertypes
[
$row
->
role
]))
{
...
...
@@ -201,7 +210,7 @@ function gmap_location_user_page() {
*/
function
gmap_location_user_point
()
{
$uid
=
arg
(
3
);
if
(
is_numeric
(
$uid
)
&&
$account
=
user_load
(
array
(
'uid'
=>
$uid
))
)
{
if
(
is_numeric
(
$uid
)
&&
$account
=
user_load
(
$uid
))
{
echo
theme
(
'gmap_location_infowindow_user'
,
$account
);
exit
();
}
...
...
@@ -250,7 +259,7 @@ function gmap_location_node_page($nid = NULL) {
$query
->
condition
(
'n.status'
,
1
)
->
condition
(
db_or
()
->
condition
(
'l.latitude'
,
0
,
'!='
)
->
condition
(
'l.longitude'
,
0
,
'!='
))
->
condition
(
db_or
()
->
condition
(
'l.latitude'
,
0
,
'!='
)
->
condition
(
'l.longitude'
,
0
,
'!='
))
->
fields
(
'n'
,
array
(
'nid'
,
'type'
,
'title'
))
->
fields
(
'l'
,
array
(
'latitude'
,
'longitude'
));
$query
->
innerjoin
(
'location_instance'
,
'i'
,
'n.vid = i.vid'
);
...
...
@@ -259,18 +268,17 @@ function gmap_location_node_page($nid = NULL) {
if
(
is_numeric
(
$nid
)
&&
$nid
>
0
)
{
$query
->
condition
(
'n.nid'
,
$nid
);
}
if
(
module_exists
(
'gmap_taxonomy'
))
{
$query
->
fields
(
'm'
,
array
(
'marker'
))
->
leftjoin
(
'gmap_taxonomy_node'
,
'm'
,
'n.vid = m.vid'
);
->
leftjoin
(
'gmap_taxonomy_node'
,
'm'
,
'n.vid = m.vid'
);
}
$query
->
addTag
(
'node_access'
);
$result
=
$query
->
execute
();
$count
=
0
;
foreach
(
$result
as
$row
)
{
foreach
(
$result
as
$row
)
{
$count
++
;
$newmarker
=
array
();
if
(
$mode
==
1
)
{
...
...
@@ -335,7 +343,7 @@ function gmap_location_node_page($nid = NULL) {
':nid'
=>
$nid
));
foreach
(
$result
as
$row
)
{
foreach
(
$result
as
$row
)
{
$newmarker
=
array
();
$newmarker
[
'rmt'
]
=
$nid
.
'/'
.
$row
->
uid
;
...
...
@@ -674,7 +682,7 @@ function gmap_location_block_view($nid) {
$markername
=
isset
(
$markertypes
[
$node
->
type
])
?
$markertypes
[
$node
->
type
]
:
'drupal'
;
if
(
module_exists
(
'gmap_taxonomy'
))
{
$t
=
db_query
(
'SELECT marker FROM {gmap_taxonomy_node} WHERE vid = :vid'
,
array
(
':vid'
=>
$node
->
vid
))
->
fetchField
();
->
fetchField
();
if
(
!
empty
(
$t
))
{
$markername
=
$t
;
}
...
...
@@ -715,7 +723,7 @@ function gmap_location_author_block_view($nid) {
$node
=
node_load
(
$nid
);
if
(
in_array
(
$node
->
type
,
variable_get
(
'gmap_location_author_block_types'
,
array
())))
{
$markername
=
variable_get
(
'gmap_location_author_block_marker'
,
'drupal'
);
$author
=
user_load
(
array
(
'uid'
=>
$node
->
uid
)
)
;
$author
=
user_load
(
$node
->
uid
);
$markers
=
array
();
$count
=
0
;
foreach
(
$author
->
locations
as
$loc
)
{
...
...
@@ -755,7 +763,7 @@ function gmap_location_author_block_view($nid) {
* @@@ Todo: Move to a tpl.
*/
function
theme_gmap_location_infowindow_node__image
(
$node
)
{
$out
=
'<a href="'
.
url
(
'node/'
.
$node
->
nid
)
.
'">'
.
check_plain
(
$node
->
title
)
.
'</a> <br>'
;
$out
=
'<a href="'
.
url
(
'node/'
.
$node
->
nid
)
.
'">'
.
check_plain
(
$node
->
title
)
.
'</a> <br>'
;
$out
.
=
image_display
(
$node
,
'thumbnail'
);
return
$out
;
}
...
...
@@ -766,7 +774,7 @@ function theme_gmap_location_infowindow_node__image($node) {
* Theme an Organic Groups node info window.
*/
function
theme_gmap_location_infowindow_node__og
(
$node
,
$opt
)
{
if
(
is_numeric
(
$opt
)
&&
$account
=
user_load
(
array
(
'uid'
=>
$opt
))
)
{
if
(
is_numeric
(
$opt
)
&&
$account
=
user_load
(
$opt
))
{
$output
=
theme
(
'user_picture'
,
$account
);
$output
.
=
theme
(
'username'
,
$account
);
echo
$output
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment