LSformElement::labeledValue: fix label translation on freeze view

This commit is contained in:
Benjamin Renard 2020-12-10 17:21:21 +01:00
parent e2ff1503ab
commit 2abc369c73
2 changed files with 2 additions and 5 deletions

View file

@ -96,9 +96,6 @@ class LSformElement_labeledValue extends LSformElement {
$ret=array('raw_value' => $value);
if (preg_match('/^\[([^\]]*)\](.*)$/',$value,$m)) {
$ret['label'] = $m[1];
$label = $this -> getParam('html_options.labels.'.$ret['label']);
if ($label)
$ret['translated_label'] = $label;
$ret['value'] = $m[2];
}
return $ret;

View file

@ -1,8 +1,8 @@
{if $freeze}
{if isset($parseValue)}
{if $parseValue.label}
{if $parseValue.translated_label}
<span title='[{$parseValue.label|escape:'htmlall'}]'>{$parseValue.translated_label|escape:"htmlall"}</span>
{if isset($labels[$parseValue.label])}
<span title='[{$parseValue.label|escape:'htmlall'}]'>{$labels[$parseValue.label]|escape:"htmlall"}</span>
{else}
<span>{$parseValue.label|escape:"htmlall"} {$unrecognizedLabelTxt|escape:"htmlall"}</span>
{/if}