Inline rendering of aggregarion value

Fixes #674
This commit is contained in:
Anna Dabrowska
2023-11-21 22:17:55 +01:00
parent 7a256bc039
commit c2839eb299
2 changed files with 7 additions and 2 deletions

View File

@ -30,6 +30,9 @@ abstract class Aggregation
/** @var int number of all results */
protected $resultCount;
/** @var string usually a div, but AggregationValue needs to be wrapped in a span */
protected $tagName = 'div';
/**
* @todo we might be able to get rid of this helper and move this to SearchConfig
* @var \helper_plugin_struct_config
@ -123,7 +126,7 @@ abstract class Aggregation
$hash = $this->renderer->info['struct_table_hash'] ?? '';
$id = $hash ? " id=\"$hash\" " : '';
$this->renderer->doc .= '<div ' . $id . 'class="' . implode(' ', $classes) . '">';
$this->renderer->doc .= '<' . $this->tagName . $id . ' class="' . implode(' ', $classes) . '">';
}
}
@ -137,7 +140,7 @@ abstract class Aggregation
public function finishScope()
{
if ($this->mode == 'xhtml') {
$this->renderer->doc .= '</div>';
$this->renderer->doc .= '</' . $this->tagName . '>';
}
}
}

View File

@ -24,6 +24,8 @@ class AggregationValue extends Aggregation
$searchConfig->setOffset(0);
parent::__construct($id, $mode, $renderer, $searchConfig);
$this->tagName = 'span';
}
/**