ObjectController: add beforeTabs hook

This commit is contained in:
Thomas Gelf 2016-03-18 11:44:48 +01:00
parent 1dbf2e8410
commit 6bd8a492b6

View File

@ -22,7 +22,7 @@ abstract class ObjectController extends ActionController
$type = $this->getType(); $type = $this->getType();
if ($object = $this->loadObject()) { if ($object = $this->loadObject()) {
$this->beforeTabs();
$params = $object->getUrlParams(); $params = $object->getUrlParams();
$tabs = $this->getTabs()->add('modify', array( $tabs = $this->getTabs()->add('modify', array(
@ -52,6 +52,7 @@ abstract class ObjectController extends ActionController
)); ));
} }
} else { } else {
$this->beforeTabs();
$this->getTabs()->add('add', array( $this->getTabs()->add('add', array(
'url' => sprintf('director/%s/add', $type), 'url' => sprintf('director/%s/add', $type),
'label' => sprintf($this->translate('Add %s'), ucfirst($type)), 'label' => sprintf($this->translate('Add %s'), ucfirst($type)),
@ -385,4 +386,8 @@ abstract class ObjectController extends ActionController
} }
} }
} }
protected function beforeTabs()
{
}
} }