Browse Source

Refactoring actions

develop
Fab 3 years ago
parent
commit
db826573de
1 changed files with 7 additions and 3 deletions
  1. +7
    -3
      Controller/AbstractAdminController.php

+ 7
- 3
Controller/AbstractAdminController.php View File

$this->handleSortableEntityActions($actions); $this->handleSortableEntityActions($actions);
$this->handleTreeEntityActions($actions); $this->handleTreeEntityActions($actions);


/*$actions->reorder(Crud::PAGE_EDIT, [Action::INDEX, Action::SAVE_AND_RETURN, Action::SAVE_AND_CONTINUE, Action::DELETE]);
$actions->reorder(Crud::PAGE_NEW, [Action::INDEX, Action::SAVE_AND_RETURN, Action::SAVE_AND_ADD_ANOTHER]);*/

return $actions; return $actions;
} }


{ {
$actions->add(Crud::PAGE_EDIT, Action::INDEX); $actions->add(Crud::PAGE_EDIT, Action::INDEX);
$actions->add(Crud::PAGE_EDIT, Action::DELETE); $actions->add(Crud::PAGE_EDIT, Action::DELETE);
$actions->reorder(Crud::PAGE_EDIT, [Action::INDEX, Action::SAVE_AND_RETURN, Action::SAVE_AND_CONTINUE]);




$this->actionUpdate( $this->actionUpdate(
$this->actionUpdate( $this->actionUpdate(
$actions, $actions,
Crud::PAGE_EDIT, Crud::PAGE_EDIT,
Action::SAVE_AND_CONTINUE,
Action::DELETE,
[ [
'icon' => 'trash', 'icon' => 'trash',
'class' => 'btn btn-outline-danger action-delete', 'class' => 'btn btn-outline-danger action-delete',
'label' => $this->get('translator_admin')->transAction('delete'), 'label' => $this->get('translator_admin')->transAction('delete'),
] ]
); );



} }


public function buildDetailActions(Actions $actions): void public function buildDetailActions(Actions $actions): void
public function buildNewActions(Actions $actions): void public function buildNewActions(Actions $actions): void
{ {
$actions->add(Crud::PAGE_NEW, Action::INDEX); $actions->add(Crud::PAGE_NEW, Action::INDEX);
$actions->reorder(Crud::PAGE_NEW, [Action::INDEX, Action::SAVE_AND_RETURN, Action::SAVE_AND_ADD_ANOTHER]);


$this->actionUpdate( $this->actionUpdate(
$actions, $actions,

Loading…
Cancel
Save