icingaweb2-module-director/application/tables/SyncruleTable.php

57 lines
1.4 KiB
PHP
Raw Normal View History

<?php
namespace Icinga\Module\Director\Tables;
use Icinga\Module\Director\Web\Table\QuickTable;
class SyncruleTable extends QuickTable
{
public function getColumns()
{
return array(
'id' => 's.id',
'rule_name' => 's.rule_name',
'object_type' => 's.object_type',
'update_policy' => 's.update_policy',
'purge_existing' => 's.purge_existing',
'filter_expression' => 's.filter_expression',
);
}
protected function getActionUrl($row)
{
return $this->url('director/syncrule/add', array('id' => $row->id));
}
2015-07-24 10:55:31 +02:00
protected function renderAdditionalActions($row)
{
return $this->view->qlink(
'Run',
'director/syncrule/run',
array('id' => $row->id),
array('data-base-target' => '_main')
);
}
public function getTitles()
{
$view = $this->view();
return array(
'rule_name' => $view->translate('Rule name'),
'object_type' => $view->translate('Object type'),
);
}
public function getBaseQuery()
{
$db = $this->connection()->getConnection();
$query = $db->select()->from(
array('s' => 'sync_rule'),
array()
)->order('id');
return $query;
}
}