ObjectsController: fix 'add' link for apply rules

This commit is contained in:
Thomas Gelf 2017-07-14 11:36:25 +02:00
parent 5457a0865f
commit ee582b7106

View File

@ -116,22 +116,27 @@ abstract class ObjectsController extends ActionController
public function applyrulesAction() public function applyrulesAction()
{ {
$type = $this->getType();
$tType = $this->translate(ucfirst($type));
$this $this
->assertApplyRulePermission() ->assertApplyRulePermission()
->addObjectsTabs() ->addObjectsTabs()
->addTitle( ->addTitle(
$this->translate('All your %s Apply Rules'), $this->translate('All your %s Apply Rules'),
$this->translate(ucfirst($this->getType())) $tType
); );
$this->actions()/*->add( $this->actions()/*->add(
$this->getBackToDashboardLink() $this->getBackToDashboardLink()
)*/->add( )*/->add(
Link::create( Link::create(
$this->translate('Add'), $this->translate('Add'),
'director/service/add', "director/$type/add",
['type' => 'apply_rule'], ['type' => 'apply_rule'],
[ [
'title' => $this->translate('Create a new Service Apply Rule'), 'title' => sprintf(
$this->translate('Create a new %s Apply Rule'),
$tType
),
'class' => 'icon-plus', 'class' => 'icon-plus',
'data-base-target' => '_next' 'data-base-target' => '_next'
] ]