ObjectsController: add missing 'add' link for sets

This commit is contained in:
Thomas Gelf 2017-07-25 14:47:35 +02:00
parent c0e723c57e
commit 39a1aa38b4
2 changed files with 21 additions and 3 deletions

View File

@ -166,8 +166,7 @@ abstract class ObjectController extends ActionController
$form = $this->loadForm($formName)
->setDb($this->db())
->setAuth($this->Auth())
->setObject($object)
->setAuth($this->Auth());
->setObject($object);
$this->beforeHandlingEditRequest($form);
$form->handleRequest();
$this->content()->add($form);

View File

@ -152,15 +152,34 @@ abstract class ObjectsController extends ActionController
public function setsAction()
{
$type = $this->getType();
$tType = $this->translate(ucfirst($type));
$this
->assertPermission('director/admin')
->addObjectsTabs()
->requireSupportFor('Sets')
->addTitle(
$this->translate('Icinga %s Sets'),
$this->translate(ucfirst($type))
$tType
);
$this->actions()/*->add(
$this->getBackToDashboardLink()
)*/->add(
Link::create(
$this->translate('Add'),
"director/${type}set/add",
null,
[
'title' => sprintf(
$this->translate('Create a new %s Set'),
$tType
),
'class' => 'icon-plus',
'data-base-target' => '_next'
]
)
);
ObjectSetTable::create($type, $this->db())->renderTo($this);
}