DataView: Provide default labels for non-labelled filter columns

refs #9029
This commit is contained in:
Johannes Meyer 2015-08-17 15:06:52 +02:00
parent 84ac316cde
commit 8b8fb6379d
1 changed files with 14 additions and 1 deletions

View File

@ -204,11 +204,24 @@ abstract class DataView implements QueryInterface, SortRules, FilterColumns, Ite
public function getFilterColumns()
{
if ($this->filterColumns === null) {
$this->filterColumns = array_merge(
$columns = array_merge(
$this->getColumns(),
$this->getStaticFilterColumns(),
$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;