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) $form = $this->loadForm($formName)
->setDb($this->db()) ->setDb($this->db())
->setAuth($this->Auth()) ->setAuth($this->Auth())
->setObject($object) ->setObject($object);
->setAuth($this->Auth());
$this->beforeHandlingEditRequest($form); $this->beforeHandlingEditRequest($form);
$form->handleRequest(); $form->handleRequest();
$this->content()->add($form); $this->content()->add($form);

View File

@ -152,15 +152,34 @@ abstract class ObjectsController extends ActionController
public function setsAction() public function setsAction()
{ {
$type = $this->getType(); $type = $this->getType();
$tType = $this->translate(ucfirst($type));
$this $this
->assertPermission('director/admin') ->assertPermission('director/admin')
->addObjectsTabs() ->addObjectsTabs()
->requireSupportFor('Sets') ->requireSupportFor('Sets')
->addTitle( ->addTitle(
$this->translate('Icinga %s Sets'), $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); ObjectSetTable::create($type, $this->db())->renderTo($this);
} }