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
55e52801
Commit
55e52801
authored
Apr 29, 2018
by
itamair
Browse files
Better Label Alias description
Bugs fixes
parent
918427a2
Changes
3
Hide whitespace changes
Inline
Side-by-side
src/MapThemerBase.php
View file @
55e52801
...
...
@@ -70,6 +70,23 @@ abstract class MapThemerBase extends PluginBase implements MapThemerInterface, C
];
}
/**
* Generate Label Alias Help Message.
*
* @return array
* The label alias help render array..
*/
public
function
getLabelAliasHelp
()
{
return
[
'#type'
=>
'html_tag'
,
'#tag'
=>
'div'
,
'#value'
=>
$this
->
t
(
'If not empty, this will be used in the legend as label alias.'
),
'#attributes'
=>
[
'style'
=>
[
'style'
=>
'font-size:0.8em; color: gray; text-transform: lowercase; font-weight: normal'
],
],
];
}
/**
* Define if to return the default Legend Icon.
*
...
...
src/Plugin/GeofieldMapThemer/EntityTypeThemer.php
View file @
55e52801
...
...
@@ -134,7 +134,9 @@ class EntityTypeThemer extends MapThemerBase {
'#header'
=>
[
$this
->
t
(
'@entity type Type/Bundle'
,
[
'@entity type'
=>
$entity_type
]),
$this
->
t
(
'Weight'
),
$this
->
t
(
'Label Alias'
),
Markup
::
create
(
$this
->
t
(
'Label Alias @description'
,
[
'@description'
=>
$this
->
renderer
->
renderPlain
(
$this
->
getLabelAliasHelp
()),
])),
Markup
::
create
(
$this
->
t
(
'Marker Icon @file_upload_help'
,
[
'@file_upload_help'
=>
$this
->
renderer
->
renderPlain
(
$this
->
markerIcon
->
getFileUploadHelp
()),
])),
...
...
@@ -171,7 +173,6 @@ class EntityTypeThemer extends MapThemerBase {
'label_alias'
=>
[
'#type'
=>
'textfield'
,
'#default_value'
=>
isset
(
$default_element
[
$bundle
][
'label_alias'
])
?
$default_element
[
$bundle
][
'label_alias'
]
:
''
,
'#description'
=>
$this
->
t
(
'If not empty, this will be used in the legend as label alias.'
),
'#size'
=>
20
,
],
'icon_file'
=>
$this
->
markerIcon
->
getIconFileManagedElement
(
$fid
),
...
...
src/Plugin/GeofieldMapThemer/TaxonomyTermThemer.php
View file @
55e52801
...
...
@@ -212,12 +212,13 @@ class TaxonomyTermThemer extends MapThemerBase {
'#header'
=>
[
$this
->
t
(
'Taxonomy term'
),
$this
->
t
(
'Weight'
),
$this
->
t
(
'Term Alias'
),
Markup
::
create
(
$this
->
t
(
'Term Alias @description'
,
[
'@description'
=>
$this
->
renderer
->
renderPlain
(
$this
->
getLabelAliasHelp
()),
])),
Markup
::
create
(
$this
->
t
(
'Marker Icon @file_upload_help'
,
[
'@file_upload_help'
=>
$this
->
renderer
->
renderPlain
(
$this
->
markerIcon
->
getFileUploadHelp
()),
])),
$this
->
t
(
'Icon Image Style'
),
$this
->
t
(
'Notes'
),
],
'#tabledrag'
=>
[[
'action'
=>
'order'
,
...
...
@@ -256,7 +257,6 @@ class TaxonomyTermThemer extends MapThemerBase {
'label_alias'
=>
[
'#type'
=>
'textfield'
,
'#default_value'
=>
isset
(
$default_element
[
'fields'
][
$k
][
'terms'
][
$tid
][
'label_alias'
])
?
$default_element
[
'fields'
][
$k
][
'terms'
][
$tid
][
'label_alias'
]
:
''
,
'#description'
=>
$this
->
t
(
'If not empty, this will be used in the legend as label alias.'
),
'#size'
=>
20
,
],
'icon_file'
=>
$this
->
markerIcon
->
getIconFileManagedElement
(
$fid
),
...
...
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