Conditions | 2 |
Paths | 2 |
Total Lines | 14 |
Code Lines | 9 |
Lines | 0 |
Ratio | 0 % |
Changes | 2 | ||
Bugs | 0 | Features | 2 |
1 | <?php |
||
25 | public function onBlock(BlockEvent $event, $eventName) |
||
26 | { |
||
27 | $settings = $event->getSettings(); |
||
28 | if ($eventName == 'sonata.block.event.sonata.admin.show.top') { |
||
29 | $settings['locale_switcher_route'] = 'show'; |
||
30 | } |
||
31 | |||
32 | $block = new Block(); |
||
33 | $block->setSettings($settings); |
||
34 | $block->setName('sonata_translation.block.locale_switcher'); |
||
35 | $block->setType('sonata_translation.block.locale_switcher'); |
||
36 | |||
37 | $event->addBlock($block); |
||
38 | } |
||
39 | } |
||
40 |