Переглянути джерело

Refactoring actions

feature/symfony6.1
Fab 3 роки тому
джерело
коміт
db826573de
1 змінених файлів з 7 додано та 3 видалено
  1. +7
    -3
      Controller/AbstractAdminController.php

+ 7
- 3
Controller/AbstractAdminController.php Переглянути файл

@@ -355,6 +355,9 @@ abstract class AbstractAdminController extends EaAbstractCrudController
$this->handleSortableEntityActions($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;
}

@@ -429,7 +432,6 @@ abstract class AbstractAdminController extends EaAbstractCrudController
{
$actions->add(Crud::PAGE_EDIT, Action::INDEX);
$actions->add(Crud::PAGE_EDIT, Action::DELETE);
$actions->reorder(Crud::PAGE_EDIT, [Action::INDEX, Action::SAVE_AND_RETURN, Action::SAVE_AND_CONTINUE]);


$this->actionUpdate(
@@ -468,13 +470,16 @@ abstract class AbstractAdminController extends EaAbstractCrudController
$this->actionUpdate(
$actions,
Crud::PAGE_EDIT,
Action::SAVE_AND_CONTINUE,
Action::DELETE,
[
'icon' => 'trash',
'class' => 'btn btn-outline-danger action-delete',
'label' => $this->get('translator_admin')->transAction('delete'),
]
);



}

public function buildDetailActions(Actions $actions): void
@@ -484,7 +489,6 @@ abstract class AbstractAdminController extends EaAbstractCrudController
public function buildNewActions(Actions $actions): void
{
$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(
$actions,

Завантаження…
Відмінити
Зберегти