-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
extract menu section & change translations
- Loading branch information
Showing
3 changed files
with
20 additions
and
20 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,60 +3,59 @@ | |
/* | ||
* This file has been created by developers from BitBag. | ||
* Feel free to contact us once you face any issues or want to start | ||
* You can find more information about us on https://bitbag.io and write us | ||
* an email on [email protected]. | ||
* another great project. | ||
* You can find more information about us on https://bitbag.shop and write us | ||
* an email on [email protected]. | ||
*/ | ||
|
||
declare(strict_types=1); | ||
|
||
namespace BitBag\SyliusBlacklistPlugin\Menu; | ||
|
||
use Knp\Menu\ItemInterface; | ||
use Sylius\Bundle\UiBundle\Menu\Event\MenuBuilderEvent; | ||
|
||
final class AdminMenuListener | ||
final class FraudPreventionMenuBuilder | ||
{ | ||
public const AUTOMATIC_BLACKLISTING_CONFIGURATION_TYPE_MENU_KEY = 'automatic_blacklisting_configuration'; | ||
|
||
public const BLACKLISTING_RULE_TYPE_MENU_KEY = 'blacklisting_rule'; | ||
|
||
public const FRAUD_SUSPICION_TYPE_MENU_KEY = 'fraud_suspicion'; | ||
|
||
public function addAdminMenuItems(MenuBuilderEvent $event): void | ||
public function buildMenu(MenuBuilderEvent $menuBuilderEvent): void | ||
{ | ||
$menu = $event->getMenu(); | ||
$this->addToCatalogMenu($menu); | ||
} | ||
$menu = $menuBuilderEvent->getMenu(); | ||
|
||
private function addToCatalogMenu(ItemInterface $menu): void | ||
{ | ||
$salesMenu = $menu->getChild('sales'); | ||
$rootMenuItem = $menu | ||
->addChild('bitbag_fraud_prevention') | ||
->setLabel('bitbag_sylius_blacklist_plugin.ui.fraud_prevention') | ||
; | ||
|
||
$salesMenu | ||
$rootMenuItem | ||
->addChild(self::BLACKLISTING_RULE_TYPE_MENU_KEY, [ | ||
'route' => 'bitbag_sylius_blacklist_plugin_admin_blacklisting_rule_index', | ||
]) | ||
->setLabel('bitbag_sylius_blacklist_plugin.ui.blacklisting_rules') | ||
->setLabelAttribute('icon', 'hand paper') | ||
; | ||
|
||
$salesMenu | ||
$rootMenuItem | ||
->addChild(self::AUTOMATIC_BLACKLISTING_CONFIGURATION_TYPE_MENU_KEY, [ | ||
'route' => 'bitbag_sylius_blacklist_plugin_admin_automatic_blacklisting_configuration_index', | ||
]) | ||
->setLabel('bitbag_sylius_blacklist_plugin.ui.automatic_blacklisting_configurations') | ||
->setLabelAttribute('icon', 'microchip') | ||
; | ||
|
||
$salesMenu | ||
$rootMenuItem | ||
->addChild(self::FRAUD_SUSPICION_TYPE_MENU_KEY, [ | ||
'route' => 'bitbag_sylius_blacklist_plugin_admin_fraud_suspicion_index', | ||
]) | ||
->setLabel('bitbag_sylius_blacklist_plugin.ui.fraud_suspicions') | ||
->setLabelAttribute('icon', 'exclamation triangle') | ||
; | ||
|
||
$salesMenu | ||
$rootMenuItem | ||
->addChild(self::AUTOMATIC_BLACKLISTING_CONFIGURATION_TYPE_MENU_KEY, [ | ||
'route' => 'bitbag_sylius_blacklist_plugin_admin_automatic_blacklisting_configuration_index', | ||
]) | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters