Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
drupal.org
geofield_map
Commits
c83ccf57
Commit
c83ccf57
authored
May 09, 2018
by
itamair
Browse files
Added 'Exclude from Legend' options for the Map Theming Plugins.
parent
55e52801
Changes
2
Hide whitespace changes
Inline
Side-by-side
src/Plugin/GeofieldMapThemer/EntityTypeThemer.php
View file @
c83ccf57
...
...
@@ -141,6 +141,7 @@ class EntityTypeThemer extends MapThemerBase {
'@file_upload_help'
=>
$this
->
renderer
->
renderPlain
(
$this
->
markerIcon
->
getFileUploadHelp
()),
])),
$this
->
t
(
'Icon Image Style'
),
$this
->
t
(
'Exclude from Legend'
),
],
'#tabledrag'
=>
[[
'action'
=>
'order'
,
...
...
@@ -183,6 +184,10 @@ class EntityTypeThemer extends MapThemerBase {
'#options'
=>
$this
->
markerIcon
->
getImageStyleOptions
(),
'#default_value'
=>
isset
(
$default_element
[
$bundle
][
'image_style'
])
?
$default_element
[
$bundle
][
'image_style'
]
:
'geofield_map_default_icon_style'
,
],
'legend_exclude'
=>
[
'#type'
=>
'checkbox'
,
'#default_value'
=>
isset
(
$default_element
[
$bundle
][
'legend_exclude'
])
?
$default_element
[
$bundle
][
'legend_exclude'
]
:
'0'
,
],
'#attributes'
=>
[
'class'
=>
[
'draggable'
]],
];
...
...
src/Plugin/GeofieldMapThemer/TaxonomyTermThemer.php
View file @
c83ccf57
...
...
@@ -219,6 +219,7 @@ class TaxonomyTermThemer extends MapThemerBase {
'@file_upload_help'
=>
$this
->
renderer
->
renderPlain
(
$this
->
markerIcon
->
getFileUploadHelp
()),
])),
$this
->
t
(
'Icon Image Style'
),
$this
->
t
(
'Exclude from Legend'
),
],
'#tabledrag'
=>
[[
'action'
=>
'order'
,
...
...
@@ -267,6 +268,10 @@ class TaxonomyTermThemer extends MapThemerBase {
'#options'
=>
$this
->
markerIcon
->
getImageStyleOptions
(),
'#default_value'
=>
isset
(
$default_element
[
'fields'
][
$k
][
'terms'
][
$tid
][
'image_style'
])
?
$default_element
[
'fields'
][
$k
][
'terms'
][
$tid
][
'image_style'
]
:
'geofield_map_default_icon_style'
,
],
'legend_exclude'
=>
[
'#type'
=>
'checkbox'
,
'#default_value'
=>
isset
(
$default_element
[
'fields'
][
$k
][
'terms'
][
$tid
][
'legend_exclude'
])
?
$default_element
[
'fields'
][
$k
][
'terms'
][
$tid
][
'legend_exclude'
]
:
'0'
,
],
'#attributes'
=>
[
'class'
=>
[
'draggable'
]],
];
$i
++
;
...
...
@@ -322,9 +327,11 @@ class TaxonomyTermThemer extends MapThemerBase {
}
$fid
=
(
integer
)
!
empty
(
$term
[
'icon_file'
][
'fids'
])
?
$term
[
'icon_file'
][
'fids'
]
:
NULL
;
// Don't render legend row in case no image is associated and the plugin
// denies to render the DefaultLegendIcon definition.
if
(
empty
(
$fid
)
&&
!
$this
->
renderDefaultLegendIcon
())
{
// Don't render legend row in case:
// - the specific value is flagged as excluded from the Legend, or
// - no image is associated and the plugin denies to render the
// DefaultLegendIcon definition.
if
(
$term
[
'legend_exclude'
]
||
(
empty
(
$fid
)
&&
!
$this
->
renderDefaultLegendIcon
()))
{
continue
;
}
$label
=
isset
(
$term
[
'label'
])
?
$term
[
'label'
]
:
$vid
;
...
...
Write
Preview
Supports
Markdown
0%
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!
Cancel
Please
register
or
sign in
to comment