ObjectsController: add missing 'add' link for sets
This commit is contained in:
parent
c0e723c57e
commit
39a1aa38b4
|
@ -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);
|
||||
|
|
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue