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()
|
||||
{
|
||||
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;
|
||||
|
|
Loading…
Reference in New Issue