|
1
|
|
|
<?php |
|
2
|
|
|
|
|
3
|
|
|
/* |
|
4
|
|
|
* This file is part of the Zikula package. |
|
5
|
|
|
* |
|
6
|
|
|
* Copyright Zikula Foundation - http://zikula.org/ |
|
7
|
|
|
* |
|
8
|
|
|
* For the full copyright and license information, please view the LICENSE |
|
9
|
|
|
* file that was distributed with this source code. |
|
10
|
|
|
*/ |
|
11
|
|
|
|
|
12
|
|
|
namespace Zikula\MenuModule\Menu; |
|
13
|
|
|
|
|
14
|
|
|
use Knp\Menu\FactoryInterface; |
|
15
|
|
|
use Symfony\Component\DependencyInjection\ContainerAwareInterface; |
|
16
|
|
|
use Symfony\Component\DependencyInjection\ContainerAwareTrait; |
|
17
|
|
|
use Zikula\Common\Translator\TranslatorTrait; |
|
18
|
|
|
|
|
19
|
|
|
class AdminActionsMenu implements ContainerAwareInterface |
|
20
|
|
|
{ |
|
21
|
|
|
use ContainerAwareTrait; |
|
22
|
|
|
use TranslatorTrait; |
|
23
|
|
|
|
|
24
|
|
|
public function setTranslator($translator) |
|
25
|
|
|
{ |
|
26
|
|
|
$this->translator = $translator; |
|
27
|
|
|
} |
|
28
|
|
|
|
|
29
|
|
|
public function menu(FactoryInterface $factory, array $options) |
|
30
|
|
|
{ |
|
31
|
|
|
$this->setTranslator($this->container->get('translator')); |
|
32
|
|
|
$menu = $factory->createItem('adminActions'); |
|
33
|
|
|
$menu->setChildrenAttribute('class', 'list-inline'); |
|
34
|
|
|
$menu->addChild($this->__('Edit Children'), [ |
|
35
|
|
|
'route' => 'zikulamenumodule_menu_view', |
|
36
|
|
|
'routeParameters' => $options, |
|
37
|
|
|
])->setAttribute('icon', 'fa fa-child'); |
|
38
|
|
|
$menu->addChild($this->__('Edit Menu Root'), [ |
|
39
|
|
|
'route' => 'zikulamenumodule_menu_edit', |
|
40
|
|
|
'routeParameters' => $options, |
|
41
|
|
|
])->setAttribute('icon', 'fa fa-tree'); |
|
42
|
|
|
$menu->addChild($this->__('Delete'), [ |
|
43
|
|
|
'route' => 'zikulamenumodule_menu_delete', |
|
44
|
|
|
'routeParameters' => $options, |
|
45
|
|
|
])->setAttribute('icon', 'fa fa-trash-o'); |
|
46
|
|
|
|
|
47
|
|
|
return $menu; |
|
48
|
|
|
} |
|
49
|
|
|
} |
|
50
|
|
|
|