diff --git a/library/Icinga/Web/Widget/FilterEditor.php b/library/Icinga/Web/Widget/FilterEditor.php
index 84e21c3d4..bd4c7986e 100644
--- a/library/Icinga/Web/Widget/FilterEditor.php
+++ b/library/Icinga/Web/Widget/FilterEditor.php
@@ -48,31 +48,22 @@ class FilterEditor extends AbstractWidget
} else {
$attributes = $view->propertiesToString($attributes);
}
- $html = '' . "\n\n";
return $html;
}
@@ -145,7 +136,7 @@ class FilterEditor extends AbstractWidget
. '';
}
} else {
- $html .= $op . '
- ' . implode('
- ', $parts) . '
';
+ $html .= $op . "\n - \n" . implode("
\n - ", $parts) . "
\n
\n";
}
return $html;
}
@@ -205,6 +196,19 @@ class FilterEditor extends AbstractWidget
protected function selectColumn($filter)
{
$name = 'column_' . $filter->getId();
+ $cols = $this->arrayForSelect($this->query->getColumns());
+ $active = $filter->getColumn();
+ $seen = false;
+ foreach ($cols as $k => & $v) {
+ $v = str_replace('_', ' ', ucfirst($v));
+ if ($k === $active) {
+ $seen = true;
+ }
+ }
+
+ if (!$seen) {
+ $cols[$active] = str_replace('_', ' ', ucfirst(ltrim($active, '_')));
+ }
if ($this->query === null) {
return sprintf(
@@ -215,8 +219,8 @@ class FilterEditor extends AbstractWidget
} else {
return $this->select(
$name,
- $this->arrayForSelect($this->query->getColumns()),
- $filter->getColumn()
+ $cols,
+ $active
);
}
}