icingaweb2-module-director/application/controllers/ImportrunController.php

37 lines
1.2 KiB
PHP
Raw Normal View History

2015-07-26 15:39:37 +02:00
<?php
2015-10-20 22:34:04 +02:00
namespace Icinga\Module\Director\Controllers;
use Icinga\Module\Director\Objects\ImportRun;
2015-07-26 15:39:37 +02:00
use Icinga\Module\Director\Web\Controller\ActionController;
2015-10-20 22:34:04 +02:00
class ImportrunController extends ActionController
2015-07-26 15:39:37 +02:00
{
public function indexAction()
{
$db = $this->db();
2016-06-26 16:30:12 +02:00
$id = $this->getRequest()->getUrl()->getParams()->shift('id');
$importRun = ImportRun::load($id, $db);
$url = clone($this->getRequest()->getUrl());
$chosenColumns = $this->getRequest()->getUrl()->shift('chosenColumns');
2015-07-26 15:39:37 +02:00
$this->view->title = $this->translate('Import run');
$this->getTabs()->add('importrun', array(
'label' => $this->view->title,
'url' => $url
))->activate('importrun');
2016-06-26 16:30:12 +02:00
$table = $this
->loadTable('importedrows')
->setConnection($db)
->setImportRun($importRun);
if ($chosenColumns) {
$table->setColumns(preg_split('/,/', $chosenColumns, -1, PREG_SPLIT_NO_EMPTY));
}
2016-06-26 16:30:12 +02:00
2015-08-28 23:56:25 +02:00
$this->view->table = $this->applyPaginationLimits($table);
2016-06-26 16:30:12 +02:00
$this->view->filterEditor = $table->getFilterEditor($this->getRequest());
2015-07-26 15:39:37 +02:00
}
}