HostController: move tab handling to ObjectTabs
Helps to unify tabs on usage/edit
This commit is contained in:
parent
5ca7740285
commit
34c6134b21
|
@ -24,24 +24,6 @@ use ipl\Web\Widget\ActionBar;
|
|||
|
||||
class HostController extends ObjectController
|
||||
{
|
||||
public function init()
|
||||
{
|
||||
parent::init();
|
||||
if ($this->object) {
|
||||
$tabs = $this->tabs();
|
||||
$name = $this->object->getObjectName();
|
||||
$tabs->add('services', [
|
||||
'url' => 'director/host/services',
|
||||
'urlParams' => ['name' => $name],
|
||||
'label' => 'Services'
|
||||
])->add('agent', [
|
||||
'url' => 'director/host/agent',
|
||||
'urlParams' => ['name' => $name],
|
||||
'label' => 'Agent'
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
protected function checkDirectorPermissions()
|
||||
{
|
||||
$this->assertPermission('director/hosts');
|
||||
|
|
|
@ -105,7 +105,7 @@ class ObjectTabs extends Tabs
|
|||
if ($object->supportsRanges()) {
|
||||
$this->add('ranges', [
|
||||
'url' => 'director/timeperiod/ranges',
|
||||
'urlParams' => $object->getUrlParams(),
|
||||
'urlParams' => $params,
|
||||
'label' => $this->translate('Ranges')
|
||||
]);
|
||||
}
|
||||
|
@ -117,6 +117,18 @@ class ObjectTabs extends Tabs
|
|||
'label' => $this->translate('Inspect')
|
||||
]);
|
||||
}
|
||||
|
||||
if ($object->getShortTableName() === 'host') {
|
||||
$this->add('services', [
|
||||
'url' => 'director/host/services',
|
||||
'urlParams' => $params,
|
||||
'label' => $this->translate('Services')
|
||||
])->add('agent', [
|
||||
'url' => 'director/host/agent',
|
||||
'urlParams' => $params,
|
||||
'label' => $this->translate('Agent')
|
||||
]);
|
||||
}
|
||||
}
|
||||
|
||||
protected function hasFields()
|
||||
|
|
Loading…
Reference in New Issue