mirror of
https://github.com/Icinga/icingaweb2.git
synced 2025-07-28 16:24:04 +02:00
DataView: Provide default labels for non-labelled filter columns
refs #9029
This commit is contained in:
parent
84ac316cde
commit
8b8fb6379d
@ -204,11 +204,24 @@ abstract class DataView implements QueryInterface, SortRules, FilterColumns, Ite
|
|||||||
public function getFilterColumns()
|
public function getFilterColumns()
|
||||||
{
|
{
|
||||||
if ($this->filterColumns === null) {
|
if ($this->filterColumns === null) {
|
||||||
$this->filterColumns = array_merge(
|
$columns = array_merge(
|
||||||
$this->getColumns(),
|
$this->getColumns(),
|
||||||
$this->getStaticFilterColumns(),
|
$this->getStaticFilterColumns(),
|
||||||
$this->getDynamicFilterColumns()
|
$this->getDynamicFilterColumns()
|
||||||
);
|
);
|
||||||
|
|
||||||
|
$this->filterColumns = array();
|
||||||
|
foreach ($columns as $label => $column) {
|
||||||
|
if (is_int($label)) {
|
||||||
|
$label = ucwords(str_replace('_', ' ', $column));
|
||||||
|
}
|
||||||
|
|
||||||
|
if ($this->query->isCaseInsensitive($column)) {
|
||||||
|
$label .= ' ' . t('(Case insensitive)');
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->filterColumns[$label] = $column;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this->filterColumns;
|
return $this->filterColumns;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user