summaryrefslogtreecommitdiffstats
path: root/application/views/helpers/ColumnHeader.php
blob: 3c7f7cd01ad5cf4455d1e6bbb6be5849b0c87911 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
<?php
/* Icinga Web 2 | (c) 2016 Icinga Development Team | GPLv2+ */

class Zend_View_Helper_ColumnHeader extends Zend_View_Helper_Abstract
{
    public function columnHeader($columnHeader, $classes = array(), $plain = false)
    {
        $header = $this->view->columnConfig->get($columnHeader, 'label', ucwords(str_replace('_', ' ', $columnHeader)));
        if ($plain) {
            return $header;
        }
        $htm = '<th classes="' . implode(' ', $classes) . '">';
        $htm .= $this->view->escape($header);
        $htm .= '</th>';
        return $htm;
    }
}