SingleValueSearchControl: Allow to pass html as labels

This commit is contained in:
Johannes Meyer 2021-04-07 15:58:25 +02:00
parent d49962ac82
commit a6507daaaf
1 changed files with 3 additions and 3 deletions

View File

@ -156,8 +156,8 @@ class SingleValueSearchControl extends Form
public static function createSuggestions(array $groups)
{
$ul = new HtmlElement('ul');
foreach ($groups as $name => $entries) {
if (is_string($name)) {
foreach ($groups as list($name, $entries)) {
if ($name) {
if ($entries === false) {
$ul->add(new HtmlElement('li', ['class' => 'failure-message'], [
new HtmlElement('em', null, t('Can\'t search:')),
@ -169,7 +169,7 @@ class SingleValueSearchControl extends Form
}
}
foreach ($entries as $label => $metaData) {
foreach ($entries as list($label, $metaData)) {
$attributes = [
'value' => $label,
'type' => 'button',