Commit 55e52801 authored by itamair's avatar itamair
Browse files

Better Label Alias description

Bugs fixes
parent 918427a2
......@@ -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.
*
......
......@@ -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),
......
......@@ -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),
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment