Syncrule/Importsource: add dedicated controllers

This commit is contained in:
Thomas Gelf 2017-08-16 09:43:05 +02:00
parent e5f7633d1e
commit 5311f37708
6 changed files with 56 additions and 4 deletions

View File

@ -123,7 +123,7 @@ class SyncruleController extends ActionController
public function editAction() public function editAction()
{ {
$form = SyncRuleForm::load() $form = SyncRuleForm::load()
->setListUrl('director/list/syncrule') ->setListUrl('director/syncrules')
->setDb($this->db()); ->setDb($this->db());
if ($id = $this->params->get('id')) { if ($id = $this->params->get('id')) {

View File

@ -0,0 +1,22 @@
<?php
namespace Icinga\Module\Director\Controllers;
use Icinga\Module\Director\Web\Table\SyncruleTable;
use Icinga\Module\Director\Web\Controller\ActionController;
use Icinga\Module\Director\Web\Tabs\ImportTabs;
class SyncrulesController extends ActionController
{
public function indexAction()
{
$this->addTitle($this->translate('Sync rule'))
->setAutoRefreshInterval(10)
->addAddLink(
$this->translate('Add a new Sync Rule'),
'director/syncrule/add'
)->tabs(new ImportTabs())->activate('syncrule');
(new SyncruleTable($this->db()))->renderTo($this);
}
}

View File

@ -86,7 +86,7 @@ $section->add(N_('Notifications'))
->setPermission('director/notifications') ->setPermission('director/notifications')
->setPriority(70); ->setPriority(70);
$section->add(N_('Automation')) $section->add(N_('Automation'))
->setUrl('director/list/importsource') ->setUrl('director/importsources')
->setPermission('director/admin') ->setPermission('director/admin')
->setPriority(901); ->setPriority(901);
$section->add(N_('Activity log')) $section->add(N_('Activity log'))

View File

@ -55,7 +55,7 @@ class ImportSourceDashlet extends Dashlet
public function getUrl() public function getUrl()
{ {
return 'director/list/importsource'; return 'director/importsources';
} }
public function listRequiredPermissions() public function listRequiredPermissions()

View File

@ -55,7 +55,7 @@ class SyncDashlet extends Dashlet
public function getUrl() public function getUrl()
{ {
return 'director/list/syncrule'; return 'director/syncrules';
} }
public function listRequiredPermissions() public function listRequiredPermissions()

View File

@ -0,0 +1,30 @@
<?php
namespace Icinga\Module\Director\Web\Tabs;
use ipl\Translation\TranslationHelper;
use ipl\Web\Widget\Tabs;
class ImportTabs extends Tabs
{
use TranslationHelper;
public function __construct()
{
$this->assemble();
}
protected function assemble()
{
$this->add('importsource', [
'label' => $this->translate('Import source'),
'url' => 'director/importsources'
])->add('syncrule', [
'label' => $this->translate('Sync rule'),
'url' => 'director/syncrules'
])->add('jobs', [
'label' => $this->translate('Jobs'),
'url' => 'director/jobs'
]);
}
}