Monitoring/DataView: allow to hook in columns

This commit is contained in:
Thomas Gelf 2015-11-13 14:33:32 +01:00
parent 4b9607ad35
commit f3cb1f915d
1 changed files with 13 additions and 0 deletions

View File

@ -4,6 +4,7 @@
namespace Icinga\Module\Monitoring\DataView;
use IteratorAggregate;
use Icinga\Application\Hook;
use Icinga\Data\ConnectionInterface;
use Icinga\Data\Filter\Filter;
use Icinga\Data\Filter\FilterMatch;
@ -122,6 +123,18 @@ abstract class DataView implements QueryInterface, SortRules, FilterColumns, Ite
return $view;
}
protected function getHookedColumns()
{
$columns = array();
foreach (Hook::all('monitoring/dataviewExtension') as $hook) {
foreach ($hook->getAdditionalQueryColumns($this->getQueryName()) as $col) {
$columns[] = $col;
}
}
return $columns;
}
// TODO: This is not the right place for this, move it away
protected function applyUrlFilter($request = null)
{