mvc - minor modification in for processing for multiselect tokenizers, when style contains "tokenize" as part of a list of styles, copy/paste buttons won't show. Unfortunately volt templates don't support an inline "split" operator, which means we need to embed php code to split the styles.

This commit is contained in:
Ad Schellevis 2024-02-06 19:57:24 +01:00
parent 12001a32f2
commit e48d3f740e

View File

@ -86,9 +86,10 @@
{% if separator|default(false) %}data-separator="{{separator}}"{% endif %}
></select>
{% if type == 'select_multiple' %}
{% if style|default('selectpicker') != "tokenize" %}<br />{% endif %}
<a href="#" class="text-danger" id="clear-options_{{ id }}"><i class="fa fa-times-circle"></i> <small>{{ lang._('Clear All') }}</small></a>
{% if style|default('selectpicker') == "tokenize" %}&nbsp;&nbsp;<a href="#" class="text-danger" id="copy-options_{{ id }}"><i class="fa fa-copy"></i> <small>{{ lang._('Copy') }}</small></a>
<?php $this_style = explode(' ', $style ?? '');?>
{% if "tokenize" not in this_style %}<br />{% endif %}
<a href="#" class="text-danger" id="clear-options_{{ id }}"><i class="fa fa-times-circle"></i> <small>{{ lang._('Clear All') }}</small></a>
{% if "tokenize" in this_style %}&nbsp;&nbsp;<a href="#" class="text-danger" id="copy-options_{{ id }}"><i class="fa fa-copy"></i> <small>{{ lang._('Copy') }}</small></a>
&nbsp;&nbsp;<a href="#" class="text-danger" id="paste-options_{{ id }}" style="display:none"><i class="fa fa-paste"></i> <small>{{ lang._('Paste') }}</small></a>
{% endif %}
{% endif %}