Completed
Push — master ( a7cf71...06c6ea )
by Craig
06:43
created

AdminActionsMenu::menu()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 20
Code Lines 17

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 17
nc 1
nop 2
dl 0
loc 20
rs 9.4285
c 0
b 0
f 0
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