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
fcafbc28
Commit
fcafbc28
authored
16 years ago
by
Brandon Bergren
Browse files
Options
Downloads
Patches
Plain Diff
#367547 by ssherrie: Add user role markers capability to GMap views.
parent
709e422d
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
gmap_plugin_style_gmap.inc
+15
-0
15 additions, 0 deletions
gmap_plugin_style_gmap.inc
with
15 additions
and
0 deletions
gmap_plugin_style_gmap.inc
+
15
−
0
View file @
fcafbc28
...
...
@@ -49,6 +49,9 @@ class gmap_plugin_style_gmap extends views_plugin_style {
else
if
(
$this
->
options
[
'markers'
]
==
'taxonomy'
)
{
$this
->
view
->
query
->
add_field
(
'gmap_taxonomy_node'
,
'marker'
,
'gmap_node_marker'
);
}
else
if
(
$this
->
options
[
'markers'
]
==
'userrole'
)
{
$this
->
view
->
query
->
add_field
(
'users_roles'
,
'rid'
,
'gmap_role_marker'
);
}
}
function
render
()
{
...
...
@@ -77,6 +80,9 @@ class gmap_plugin_style_gmap extends views_plugin_style {
if
(
$this
->
options
[
'markers'
]
==
'nodetype'
)
{
$markertypes
=
variable_get
(
'gmap_node_markers'
,
array
());
}
else
if
(
$this
->
options
[
'markers'
]
==
'userrole'
)
{
$markertypes
=
variable_get
(
'gmap_role_markers'
,
array
(
DRUPAL_AUTHENTICATED_RID
=>
'drupal'
));
}
// Group the rows according to the grouping field, if specified.
$sets
=
$this
->
render_grouping
(
$this
->
view
->
result
,
$this
->
options
[
'grouping'
]);
...
...
@@ -101,6 +107,14 @@ class gmap_plugin_style_gmap extends views_plugin_style {
$markername
=
$row
->
gmap_node_marker
;
}
}
else
if
(
$this
->
options
[
'markers'
]
==
'userrole'
)
{
if
(
!
empty
(
$row
->
gmap_role_marker
))
{
$markername
=
$markertypes
[
DRUPAL_AUTHENTICATED_RID
];
if
(
isset
(
$markertypes
[
$row
->
gmap_role_marker
]))
{
$markername
=
$markertypes
[
$row
->
gmap_role_marker
];
}
}
}
else
if
(
$this
->
options
[
'markers'
]
==
'field'
)
{
if
(
!
empty
(
$row
->
{
$marker_field
}))
{
$markername
=
$row
->
{
$marker_field
};
...
...
@@ -186,6 +200,7 @@ class gmap_plugin_style_gmap extends views_plugin_style {
'#options'
=>
array
(
'nodetype'
=>
t
(
'By content type (for node views)'
),
'taxonomy'
=>
t
(
'By term (for node views)'
),
'userrole'
=>
t
(
'By user role (for user views)'
),
'field'
=>
t
(
'Use marker field'
),
'static'
=>
t
(
'Use single marker type'
),
),
...
...
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