2017-07-12 10:37:24 +02:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace Icinga\Module\Director\Web\Table;
|
|
|
|
|
2019-05-02 13:23:06 +02:00
|
|
|
use gipfl\IcingaWeb2\Link;
|
|
|
|
use gipfl\IcingaWeb2\Table\ZfQueryBasedTable;
|
2017-07-12 10:37:24 +02:00
|
|
|
|
|
|
|
class DatalistTable extends ZfQueryBasedTable
|
|
|
|
{
|
|
|
|
protected $searchColumns = ['list_name'];
|
|
|
|
|
|
|
|
public function getColumns()
|
|
|
|
{
|
|
|
|
return [
|
|
|
|
'id' => 'l.id',
|
|
|
|
'list_name' => 'l.list_name',
|
|
|
|
];
|
|
|
|
}
|
|
|
|
|
|
|
|
public function renderRow($row)
|
|
|
|
{
|
|
|
|
return $this::tr($this::td(Link::create(
|
|
|
|
$row->list_name,
|
|
|
|
'director/data/listentry',
|
2018-11-26 00:11:35 +01:00
|
|
|
array('list' => $row->list_name)
|
2017-07-12 10:37:24 +02:00
|
|
|
)));
|
|
|
|
}
|
|
|
|
|
|
|
|
public function getColumnsToBeRendered()
|
|
|
|
{
|
|
|
|
return [$this->translate('List name')];
|
|
|
|
}
|
|
|
|
|
|
|
|
public function prepareQuery()
|
|
|
|
{
|
|
|
|
return $this->db()->select()->from(
|
|
|
|
['l' => 'director_datalist'],
|
|
|
|
$this->getColumns()
|
|
|
|
)->order('list_name ASC');
|
|
|
|
}
|
|
|
|
}
|