|
|
|
|
|
|
|
|
use EasyCorp\Bundle\EasyAdminBundle\Provider\AdminContextProvider; |
|
|
use EasyCorp\Bundle\EasyAdminBundle\Provider\AdminContextProvider; |
|
|
use EasyCorp\Bundle\EasyAdminBundle\Router\AdminUrlGenerator; |
|
|
use EasyCorp\Bundle\EasyAdminBundle\Router\AdminUrlGenerator; |
|
|
use EasyCorp\Bundle\EasyAdminBundle\Security\Permission; |
|
|
use EasyCorp\Bundle\EasyAdminBundle\Security\Permission; |
|
|
use Lc\CaracoleBundle\Controller\Order\OrderShopAdminController; |
|
|
|
|
|
use Lc\SovBundle\Component\EntityComponent; |
|
|
use Lc\SovBundle\Component\EntityComponent; |
|
|
use Lc\SovBundle\Container\ComponentContainer; |
|
|
use Lc\SovBundle\Container\ComponentContainer; |
|
|
use Lc\SovBundle\Container\File\FileContainer; |
|
|
use Lc\SovBundle\Container\File\FileContainer; |
|
|
|
|
|
|
|
|
use Lc\SovBundle\Container\Ticket\TicketMessageContainer; |
|
|
use Lc\SovBundle\Container\Ticket\TicketMessageContainer; |
|
|
use Lc\SovBundle\Container\User\GroupUserContainer; |
|
|
use Lc\SovBundle\Container\User\GroupUserContainer; |
|
|
use Lc\SovBundle\Container\User\UserContainer; |
|
|
use Lc\SovBundle\Container\User\UserContainer; |
|
|
|
|
|
use Lc\SovBundle\Definition\ActionDefinition; |
|
|
use Lc\SovBundle\Doctrine\Extension\DevAliasInterface; |
|
|
use Lc\SovBundle\Doctrine\Extension\DevAliasInterface; |
|
|
use Lc\SovBundle\Doctrine\Extension\SeoInterface; |
|
|
use Lc\SovBundle\Doctrine\Extension\SeoInterface; |
|
|
use Lc\SovBundle\Doctrine\Extension\SortableInterface; |
|
|
use Lc\SovBundle\Doctrine\Extension\SortableInterface; |
|
|
|
|
|
|
|
|
use Lc\SovBundle\Form\Common\FiltersFormType; |
|
|
use Lc\SovBundle\Form\Common\FiltersFormType; |
|
|
use Lc\SovBundle\Form\Common\PositionType; |
|
|
use Lc\SovBundle\Form\Common\PositionType; |
|
|
use Lc\SovBundle\Notification\MailMailjetNotification; |
|
|
use Lc\SovBundle\Notification\MailMailjetNotification; |
|
|
|
|
|
use Lc\SovBundle\Solver\Setting\SettingSolver; |
|
|
use Lc\SovBundle\Translation\FlashBagTranslator; |
|
|
use Lc\SovBundle\Translation\FlashBagTranslator; |
|
|
use Lc\SovBundle\Translation\TranslatorAdmin; |
|
|
use Lc\SovBundle\Translation\TranslatorAdmin; |
|
|
use Symfony\Component\Form\Extension\Core\Type\ChoiceType; |
|
|
|
|
|
use Symfony\Component\Form\Extension\Core\Type\CollectionType; |
|
|
use Symfony\Component\Form\Extension\Core\Type\CollectionType; |
|
|
use Symfony\Component\Form\Extension\Core\Type\DateTimeType; |
|
|
|
|
|
use Symfony\Component\Form\Extension\Core\Type\DateType; |
|
|
|
|
|
use Symfony\Component\Form\Extension\Core\Type\IntegerType; |
|
|
|
|
|
use Symfony\Component\Form\Extension\Core\Type\TextType; |
|
|
use Symfony\Component\Form\Extension\Core\Type\TextType; |
|
|
use Symfony\Component\Form\FormInterface; |
|
|
use Symfony\Component\Form\FormInterface; |
|
|
use Symfony\Component\HttpFoundation\JsonResponse; |
|
|
use Symfony\Component\HttpFoundation\JsonResponse; |
|
|
use Symfony\Component\HttpFoundation\RequestStack; |
|
|
use Symfony\Component\HttpFoundation\RequestStack; |
|
|
use Symfony\Component\HttpFoundation\Session\Flash\FlashBagInterface; |
|
|
|
|
|
use Symfony\Component\HttpFoundation\Session\SessionInterface; |
|
|
use Symfony\Component\HttpFoundation\Session\SessionInterface; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
UserContainer::class => UserContainer::class, |
|
|
UserContainer::class => UserContainer::class, |
|
|
SiteSettingContainer::class => SiteSettingContainer::class, |
|
|
SiteSettingContainer::class => SiteSettingContainer::class, |
|
|
MailMailjetNotification::class => MailMailjetNotification::class, |
|
|
MailMailjetNotification::class => MailMailjetNotification::class, |
|
|
|
|
|
SettingSolver::class => SettingSolver::class |
|
|
] |
|
|
] |
|
|
); |
|
|
); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
if (Crud::PAGE_INDEX === $responseParameters->get('pageName')) { |
|
|
if (Crud::PAGE_INDEX === $responseParameters->get('pageName')) { |
|
|
$responseParameters->set('fields', $this->configureFields('index')); |
|
|
$responseParameters->set('fields', $this->configureFields('index')); |
|
|
|
|
|
|
|
|
if ($this->filtersForm === null) { |
|
|
|
|
|
|
|
|
//TODO supprimer ce code rapport au filtre dans les index |
|
|
|
|
|
/*if ($this->filtersForm === null) { |
|
|
die('nncncd'); |
|
|
die('nncncd'); |
|
|
//TODO delete under code |
|
|
|
|
|
|
|
|
|
|
|
$options['fields'] = $responseParameters->get('fields'); |
|
|
$options['fields'] = $responseParameters->get('fields'); |
|
|
$options['entity_class'] = $this->getEntityFqcn(); |
|
|
$options['entity_class'] = $this->getEntityFqcn(); |
|
|
$options['entity_name'] = $responseParameters->get('entity')->getName(); |
|
|
$options['entity_name'] = $responseParameters->get('entity')->getName(); |
|
|
$this->filtersForm = $this->createForm(FiltersFormType::class, null, $options); |
|
|
$this->filtersForm = $this->createForm(FiltersFormType::class, null, $options); |
|
|
} |
|
|
|
|
|
|
|
|
}*/ |
|
|
$responseParameters->set('filters_form', $this->filtersForm); |
|
|
$responseParameters->set('filters_form', $this->filtersForm); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
$url = $this->get(AdminUrlGenerator::class) |
|
|
$url = $this->get(AdminUrlGenerator::class) |
|
|
->setAction(Action::INDEX) |
|
|
|
|
|
|
|
|
->setAction(ActionDefinition::INDEX) |
|
|
->generateUrl(); |
|
|
->generateUrl(); |
|
|
$this->addFlashTranslator('success', 'sorted'); |
|
|
$this->addFlashTranslator('success', 'sorted'); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$em->flush(); |
|
|
$em->flush(); |
|
|
|
|
|
|
|
|
$url = $this->get(AdminUrlGenerator::class) |
|
|
$url = $this->get(AdminUrlGenerator::class) |
|
|
->setAction(Action::EDIT) |
|
|
|
|
|
|
|
|
->setAction(ActionDefinition::EDIT) |
|
|
->setEntityId($newEntity->getId()) |
|
|
->setEntityId($newEntity->getId()) |
|
|
->generateUrl(); |
|
|
->generateUrl(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$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]);*/ |
|
|
|
|
|
|
|
|
/*$actions->reorder(Crud::PAGE_EDIT, [ActionDefinition::INDEX, ActionDefinition::SAVE_AND_RETURN, ActionDefinition::SAVE_AND_CONTINUE, ActionDefinition::DELETE]); |
|
|
|
|
|
$actions->reorder(Crud::PAGE_NEW, [ActionDefinition::INDEX, ActionDefinition::SAVE_AND_RETURN, ActionDefinition::SAVE_AND_ADD_ANOTHER]);*/ |
|
|
|
|
|
|
|
|
return $actions; |
|
|
return $actions; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
public function getDuplicateAction(): Action |
|
|
public function getDuplicateAction(): Action |
|
|
{ |
|
|
{ |
|
|
$duplicateAction = Action::new( |
|
|
$duplicateAction = Action::new( |
|
|
'duplicate', |
|
|
|
|
|
$this->get(TranslatorAdmin::class)->transAction('duplicate'), |
|
|
|
|
|
|
|
|
ActionDefinition::DUPLICATE, |
|
|
|
|
|
$this->get(TranslatorAdmin::class)->transAction(ActionDefinition::DUPLICATE), |
|
|
'fa fa-fw fa-copy' |
|
|
'fa fa-fw fa-copy' |
|
|
) |
|
|
) |
|
|
->linkToCrudAction('duplicate') |
|
|
|
|
|
->setLabel($this->get(TranslatorAdmin::class)->transAction('duplicate')) |
|
|
|
|
|
|
|
|
->linkToCrudAction(ActionDefinition::DUPLICATE) |
|
|
|
|
|
->setLabel($this->get(TranslatorAdmin::class)->transAction(ActionDefinition::DUPLICATE)) |
|
|
->setCssClass('in-dropdown text-info action-confirm'); |
|
|
->setCssClass('in-dropdown text-info action-confirm'); |
|
|
|
|
|
|
|
|
return $duplicateAction; |
|
|
return $duplicateAction; |
|
|
|
|
|
|
|
|
$this->actionUpdate( |
|
|
$this->actionUpdate( |
|
|
$actions, |
|
|
$actions, |
|
|
Crud::PAGE_INDEX, |
|
|
Crud::PAGE_INDEX, |
|
|
Action::NEW, |
|
|
|
|
|
|
|
|
ActionDefinition::NEW, |
|
|
[ |
|
|
[ |
|
|
'icon' => 'plus', |
|
|
'icon' => 'plus', |
|
|
'label' => $this->get(TranslatorAdmin::class)->transAction('create'), |
|
|
'label' => $this->get(TranslatorAdmin::class)->transAction('create'), |
|
|
|
|
|
|
|
|
$this->actionUpdate( |
|
|
$this->actionUpdate( |
|
|
$actions, |
|
|
$actions, |
|
|
Crud::PAGE_INDEX, |
|
|
Crud::PAGE_INDEX, |
|
|
Action::EDIT, |
|
|
|
|
|
|
|
|
ActionDefinition::EDIT, |
|
|
[ |
|
|
[ |
|
|
'class' => 'btn btn-sm btn-primary', |
|
|
'class' => 'btn btn-sm btn-primary', |
|
|
'icon' => 'edit', |
|
|
'icon' => 'edit', |
|
|
|
|
|
|
|
|
$this->actionUpdate( |
|
|
$this->actionUpdate( |
|
|
$actions, |
|
|
$actions, |
|
|
Crud::PAGE_INDEX, |
|
|
Crud::PAGE_INDEX, |
|
|
Action::DETAIL, |
|
|
|
|
|
|
|
|
ActionDefinition::DETAIL, |
|
|
[ |
|
|
[ |
|
|
'icon' => 'eye', |
|
|
'icon' => 'eye', |
|
|
'add_class' => 'btn btn-sm btn-success', |
|
|
'add_class' => 'btn btn-sm btn-success', |
|
|
|
|
|
|
|
|
$this->actionUpdate( |
|
|
$this->actionUpdate( |
|
|
$actions, |
|
|
$actions, |
|
|
Crud::PAGE_INDEX, |
|
|
Crud::PAGE_INDEX, |
|
|
Action::DELETE, |
|
|
|
|
|
|
|
|
ActionDefinition::DELETE, |
|
|
[ |
|
|
[ |
|
|
'icon' => 'trash', |
|
|
'icon' => 'trash', |
|
|
'dropdown' => true, |
|
|
'dropdown' => true, |
|
|
|
|
|
|
|
|
$this->actionUpdate( |
|
|
$this->actionUpdate( |
|
|
$actions, |
|
|
$actions, |
|
|
Crud::PAGE_INDEX, |
|
|
Crud::PAGE_INDEX, |
|
|
Action::BATCH_DELETE, |
|
|
|
|
|
|
|
|
ActionDefinition::BATCH_DELETE, |
|
|
[ |
|
|
[ |
|
|
'class' => 'btn btn-sm btn-danger', |
|
|
'class' => 'btn btn-sm btn-danger', |
|
|
'icon' => 'trash', |
|
|
'icon' => 'trash', |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public function buildEditActions(Actions $actions): void |
|
|
public function buildEditActions(Actions $actions): void |
|
|
{ |
|
|
{ |
|
|
$actions->add(Crud::PAGE_EDIT, Action::INDEX); |
|
|
|
|
|
$actions->add(Crud::PAGE_EDIT, Action::DELETE); |
|
|
|
|
|
|
|
|
$actions->add(Crud::PAGE_EDIT, ActionDefinition::INDEX); |
|
|
|
|
|
$actions->add(Crud::PAGE_EDIT, ActionDefinition::DELETE); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
$this->actionUpdate( |
|
|
$this->actionUpdate( |
|
|
$actions, |
|
|
$actions, |
|
|
Crud::PAGE_EDIT, |
|
|
Crud::PAGE_EDIT, |
|
|
Action::SAVE_AND_RETURN, |
|
|
|
|
|
|
|
|
ActionDefinition::SAVE_AND_RETURN, |
|
|
[ |
|
|
[ |
|
|
'add_class' => 'float-right ', |
|
|
'add_class' => 'float-right ', |
|
|
'icon' => 'check', |
|
|
'icon' => 'check', |
|
|
|
|
|
|
|
|
$this->actionUpdate( |
|
|
$this->actionUpdate( |
|
|
$actions, |
|
|
$actions, |
|
|
Crud::PAGE_EDIT, |
|
|
Crud::PAGE_EDIT, |
|
|
Action::INDEX, |
|
|
|
|
|
|
|
|
ActionDefinition::INDEX, |
|
|
[ |
|
|
[ |
|
|
'icon' => 'chevron-left', |
|
|
'icon' => 'chevron-left', |
|
|
'class' => 'btn btn-link', |
|
|
'class' => 'btn btn-link', |
|
|
|
|
|
|
|
|
$this->actionUpdate( |
|
|
$this->actionUpdate( |
|
|
$actions, |
|
|
$actions, |
|
|
Crud::PAGE_EDIT, |
|
|
Crud::PAGE_EDIT, |
|
|
Action::SAVE_AND_CONTINUE, |
|
|
|
|
|
|
|
|
ActionDefinition::SAVE_AND_CONTINUE, |
|
|
[ |
|
|
[ |
|
|
'class' => 'btn btn-info float-right action-save-continue', |
|
|
'class' => 'btn btn-info float-right action-save-continue', |
|
|
'label' => $this->get(TranslatorAdmin::class)->transAction('save_and_continue'), |
|
|
'label' => $this->get(TranslatorAdmin::class)->transAction('save_and_continue'), |
|
|
|
|
|
|
|
|
$this->actionUpdate( |
|
|
$this->actionUpdate( |
|
|
$actions, |
|
|
$actions, |
|
|
Crud::PAGE_EDIT, |
|
|
Crud::PAGE_EDIT, |
|
|
Action::DELETE, |
|
|
|
|
|
|
|
|
ActionDefinition::DELETE, |
|
|
[ |
|
|
[ |
|
|
'icon' => 'trash', |
|
|
'icon' => 'trash', |
|
|
'class' => 'btn btn-outline-danger action-delete', |
|
|
'class' => 'btn btn-outline-danger action-delete', |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public function buildNewActions(Actions $actions): void |
|
|
public function buildNewActions(Actions $actions): void |
|
|
{ |
|
|
{ |
|
|
$actions->add(Crud::PAGE_NEW, Action::INDEX); |
|
|
|
|
|
|
|
|
$actions->add(Crud::PAGE_NEW, ActionDefinition::INDEX); |
|
|
|
|
|
|
|
|
$this->actionUpdate( |
|
|
$this->actionUpdate( |
|
|
$actions, |
|
|
$actions, |
|
|
Crud::PAGE_EDIT, |
|
|
Crud::PAGE_EDIT, |
|
|
Action::SAVE_AND_RETURN, |
|
|
|
|
|
|
|
|
ActionDefinition::SAVE_AND_RETURN, |
|
|
[ |
|
|
[ |
|
|
'add_class' => 'float-right', |
|
|
'add_class' => 'float-right', |
|
|
'icon' => 'check', |
|
|
'icon' => 'check', |
|
|
|
|
|
|
|
|
$this->actionUpdate( |
|
|
$this->actionUpdate( |
|
|
$actions, |
|
|
$actions, |
|
|
Crud::PAGE_EDIT, |
|
|
Crud::PAGE_EDIT, |
|
|
Action::INDEX, |
|
|
|
|
|
|
|
|
ActionDefinition::INDEX, |
|
|
[ |
|
|
[ |
|
|
'icon' => 'chevron-left', |
|
|
'icon' => 'chevron-left', |
|
|
'class' => 'btn btn-link', |
|
|
'class' => 'btn btn-link', |
|
|
|
|
|
|
|
|
$this->actionUpdate( |
|
|
$this->actionUpdate( |
|
|
$actions, |
|
|
$actions, |
|
|
Crud::PAGE_EDIT, |
|
|
Crud::PAGE_EDIT, |
|
|
Action::SAVE_AND_ADD_ANOTHER, |
|
|
|
|
|
|
|
|
ActionDefinition::SAVE_AND_ADD_ANOTHER, |
|
|
[ |
|
|
[ |
|
|
'class' => 'btn btn-info float-right', |
|
|
'class' => 'btn btn-info float-right', |
|
|
'label' => $this->get(TranslatorAdmin::class)->transAction('save_and_add_another'), |
|
|
'label' => $this->get(TranslatorAdmin::class)->transAction('save_and_add_another'), |
|
|
|
|
|
|
|
|
if ($this->isInstanceOf(TranslatableInterface::class)) { |
|
|
if ($this->isInstanceOf(TranslatableInterface::class)) { |
|
|
$actions->update( |
|
|
$actions->update( |
|
|
Crud::PAGE_INDEX, |
|
|
Crud::PAGE_INDEX, |
|
|
Action::EDIT, |
|
|
|
|
|
|
|
|
ActionDefinition::EDIT, |
|
|
function (Action $action) { |
|
|
function (Action $action) { |
|
|
$action->setTemplatePath('@LcSov/adminlte/crud/action/translatable.html.twig'); |
|
|
$action->setTemplatePath('@LcSov/adminlte/crud/action/translatable.html.twig'); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
public function handleSortableEntityActions(Actions $actions): void |
|
|
public function handleSortableEntityActions(Actions $actions): void |
|
|
{ |
|
|
{ |
|
|
if ($this->isInstanceOf(SortableInterface::class)) { |
|
|
if ($this->isInstanceOf(SortableInterface::class)) { |
|
|
$sortAction = Action::new('sort', $this->get(TranslatorAdmin::class)->transAction('sort'), 'fa fa-sort') |
|
|
|
|
|
->linkToCrudAction('sort') |
|
|
|
|
|
|
|
|
$sortAction = Action::new(ActionDefinition::SORT, $this->get(TranslatorAdmin::class)->transAction(ActionDefinition::SORT), 'fa fa-sort') |
|
|
|
|
|
->linkToCrudAction(ActionDefinition::SORT) |
|
|
->setCssClass('btn btn-sm btn-success') |
|
|
->setCssClass('btn btn-sm btn-success') |
|
|
->createAsGlobalAction(); |
|
|
->createAsGlobalAction(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
{ |
|
|
{ |
|
|
if ($this->isInstanceOf(TreeInterface::class)) { |
|
|
if ($this->isInstanceOf(TreeInterface::class)) { |
|
|
$indexChildAction = Action::new( |
|
|
$indexChildAction = Action::new( |
|
|
'index_children', |
|
|
|
|
|
$this->get(TranslatorAdmin::class)->transAction('index_children'), |
|
|
|
|
|
|
|
|
ActionDefinition::INDEX_CHILDREN, |
|
|
|
|
|
$this->get(TranslatorAdmin::class)->transAction(ActionDefinition::INDEX_CHILDREN), |
|
|
'fa fa-list' |
|
|
'fa fa-list' |
|
|
) |
|
|
) |
|
|
->linkToCrudAction(Action::INDEX) |
|
|
|
|
|
|
|
|
->linkToCrudAction(ActionDefinition::INDEX) |
|
|
->setLabel('') |
|
|
->setLabel('') |
|
|
->setHtmlAttributes(array('data-toggle' => 'tooltip', 'title' => 'Afficher les enfants')) |
|
|
->setHtmlAttributes(array('data-toggle' => 'tooltip', 'title' => 'Afficher les enfants')) |
|
|
->setTemplatePath('@LcSov/adminlte/crud/action/index_children.html.twig') |
|
|
->setTemplatePath('@LcSov/adminlte/crud/action/index_children.html.twig') |
|
|
->setCssClass('btn btn-sm btn-success'); |
|
|
->setCssClass('btn btn-sm btn-success'); |
|
|
|
|
|
|
|
|
$backParentAction = Action::new( |
|
|
$backParentAction = Action::new( |
|
|
'index_parent', |
|
|
|
|
|
$this->get(TranslatorAdmin::class)->transAction('index_parent'), |
|
|
|
|
|
|
|
|
ActionDefinition::INDEX_PARENT, |
|
|
|
|
|
$this->get(TranslatorAdmin::class)->transAction(ActionDefinition::INDEX_PARENT), |
|
|
'fa fa-chevron-left' |
|
|
'fa fa-chevron-left' |
|
|
) |
|
|
) |
|
|
->linkToCrudAction(Action::INDEX) |
|
|
|
|
|
|
|
|
->linkToCrudAction(ActionDefinition::INDEX) |
|
|
->setCssClass('btn btn-sm btn-info') |
|
|
->setCssClass('btn btn-sm btn-info') |
|
|
->createAsGlobalAction(); |
|
|
->createAsGlobalAction(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** @var CrudControllerInterface $controller */ |
|
|
/** @var CrudControllerInterface $controller */ |
|
|
$controller = $this->get(ControllerFactory::class)->getCrudControllerInstance( |
|
|
$controller = $this->get(ControllerFactory::class)->getCrudControllerInstance( |
|
|
$autocompleteContext[EA::CRUD_CONTROLLER_FQCN], |
|
|
$autocompleteContext[EA::CRUD_CONTROLLER_FQCN], |
|
|
Action::INDEX, |
|
|
|
|
|
|
|
|
ActionDefinition::INDEX, |
|
|
$context->getRequest() |
|
|
$context->getRequest() |
|
|
); |
|
|
); |
|
|
/** @var FieldDto $field */ |
|
|
/** @var FieldDto $field */ |
|
|
|
|
|
|
|
|
public function createCustomForm($class, $action, $controller, $entity, $dataInOption = true, $options = array()) |
|
|
public function createCustomForm($class, $action, $controller, $entity, $dataInOption = true, $options = array()) |
|
|
{ |
|
|
{ |
|
|
if ($dataInOption) { |
|
|
if ($dataInOption) { |
|
|
$options['data'] = $entity; |
|
|
|
|
|
|
|
|
$data = $entity; |
|
|
|
|
|
}else{ |
|
|
|
|
|
$data = null; |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
$options['action'] = $this->get(AdminUrlGenerator::class) |
|
|
$options['action'] = $this->get(AdminUrlGenerator::class) |
|
|
|
|
|
|
|
|
->setEntityId($entity->getId()) |
|
|
->setEntityId($entity->getId()) |
|
|
->generateUrl(); |
|
|
->generateUrl(); |
|
|
|
|
|
|
|
|
return $this->createForm($class, null, $options); |
|
|
|
|
|
|
|
|
return $this->createForm($class, $data, $options); |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
public function generateEaUrl(string $controller =null, string $action=null, int $entityId=null, array $extraParam = array()): string |
|
|
|
|
|
{ |
|
|
|
|
|
$adminUrlGenerator = $this->get(AdminUrlGenerator::class); |
|
|
|
|
|
if ($controller) { |
|
|
|
|
|
$adminUrlGenerator->setController($controller); |
|
|
|
|
|
} |
|
|
|
|
|
if ($action) { |
|
|
|
|
|
$adminUrlGenerator->setAction($action); |
|
|
|
|
|
} |
|
|
|
|
|
if ($entityId) { |
|
|
|
|
|
$adminUrlGenerator->setEntityId($entityId); |
|
|
|
|
|
} |
|
|
|
|
|
if($extraParam){ |
|
|
|
|
|
foreach ($extraParam as $key=>$value) { |
|
|
|
|
|
$adminUrlGenerator->set($key, $value); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
return $adminUrlGenerator->generateUrl(); |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
} |
|
|
} |