Builds backend sidebar menu.

@return \Knp\Menu\ItemInterface
183722
public function createSideMenu()
    {
        $this->pool->prepare();

        $menu = $this->factory->createItem('root', [
            'childrenAttributes' => [
                'id' => 'sidebar-menu'
            ]
        ]);

        $menu
            ->addChild('dashboard', [
                'route' => 'ekyna_admin_dashboard',
                'labelAttributes' => ['icon' => 'dashboard'],
            ])
            ->setLabel('ekyna_admin.dashboard')
        ;

        $this->appendChildren($menu);

        return $menu;
    }
1334671
public function createAdminMenu(array $options): ItemInterface
    {
        $menu = $this->factory->createItem('root');

        $event = new AdminMenuCollectionEvent($menu);
        $this->dispatcher->dispatch(AdminMenuCollectionEvent::NAME, $event);

        return $menu;
    }
1321825
protected function loadItems()
    {
        /*
         * Load module items
         */
        foreach ($this->callbacks as $callback) {
            $callback($this);
        }

        /*
         * Load plugin items
         */
        $plugins = $this->pluginManager->getPlugins();

        foreach ($plugins as $id => $plugin) {
            $items = $plugin->registerNavigation();
            if (!is_array($items)) {
                continue;
            }

            $this->registerMenuItems($id, $items);
        }

        /*
         * Extensibility
         */
        Event::fire('backend.menu.extendItems', [$this]);

        /*
         * Sort menu items
         */
        uasort($this->items, function ($a, $b) {
            return $a->order - $b->order;
        });

        /*
         * Filter items user lacks permission for
         */
        $user = BackendAuth::getUser();
        $this->items = $this->filterItemPermissions($user, $this->items);

        foreach ($this->items as $item) {
            if (!$item->sideMenu || !count($item->sideMenu)) {
                continue;
            }

            /*
             * Apply incremental default orders
             */
            $orderCount = 0;
            foreach ($item->sideMenu as $sideMenuItem) {
                if ($sideMenuItem->order !== -1) continue;
                $sideMenuItem->order = ($orderCount += 100);
            }

            /*
             * Sort side menu items
             */
            uasort($item->sideMenu, function ($a, $b) {
                return $a->order - $b->order;
            });

            /*
             * Filter items user lacks permission for
             */
            $item->sideMenu = $this->filterItemPermissions($user, $item->sideMenu);
        }
    }
335363
protected function initBackend()
    {
        $this->backendList = array();
        $this->balancedBackendList = array();

        foreach ($this->getConfigArrayOption('backend', array()) as $backendName => $option) {
            if (!isset($option['ip']) || !isset($option['port'])) {
                continue;
            }

            $this->backendList[$backendName] = array($option['ip'], $option['port']);
            if (!empty($option['balanced'])) {
                $this->balancedBackendList[] = $backendName;
            }

            if (!empty($option['admin'])) {
                $this->adminBackend = $backendName;
            }
        }

        if ($this->adminBackend === null) {
            $this->adminBackend = key($this->backendList);
        }

        return $this;
    }
187203
private function getMenusSection()
    {
        $builder = new TreeBuilder();
        $node = $builder->root('menus');

        $node
            ->useAttributeAsKey('name')
            ->prototype('array')
                ->children()
                    ->scalarNode('label')->isRequired()->cannotBeEmpty()->end()
                    ->scalarNode('icon')->isRequired()->cannotBeEmpty()->end()
                    ->integerNode('position')->defaultValue(0)->end()
                    ->scalarNode('domain')->defaultValue('messages')->end()
                    ->scalarNode('route')->defaultNull()->end()
                    ->arrayNode('entries')
                        ->useAttributeAsKey('name')
                        ->prototype('array')
                            ->children()
                                ->scalarNode('route')->isRequired()->cannotBeEmpty()->end()
                                ->scalarNode('label')->isRequired()->cannotBeEmpty()->end()
                                ->scalarNode('resource')->isRequired()->cannotBeEmpty()->end()
                                ->integerNode('position')->defaultValue(0)->end()
                                ->scalarNode('domain')->defaultValue('messages')->end()
                            ->end()
                        ->end()
                    ->end()
                ->end()
            ->end()
        ;

        return $node;
    }
474525
public function buildAdminMenu(MenuItem $menu, array $extras = [])
    {
        if ($this->hasAdmin()) {
            if (!isset($extras['beforeCode'])) {
                $extras['beforeCode'] = $this->adminMenuBeforeCode;
            }

            $menu->addChild($this->getShortName(), [
                'uri' => $this->container->get('router')->generate('cms_admin_index').$this->getShortName().'/',
            ])->setExtras($extras);
        }

        return $menu;
    }
725845
public function getMenu()
    {
        $url = $this->apiUrl.'/cgi-bin/menu/get?access_token='.$this->getAccessToken();
        $result = $this->curl($url);
        return $this->get($result);
    }
656424
protected function createComponentMenu(): Menu
	{
		$moduleMenu = $this->menuFactory->create();
		$moduleMenu->setTranslator($this->translator);
		$moduleMenu->setBaseUrl('cms.title', ":{$this->module}:Homepage:");
		return $moduleMenu;
	}
680064
public function build(array $options): ItemInterface
    {
        $menu = $this->createStructure($options);

        $menuBuilder = new ConfigureMenuEvent($this->factory, $menu);
        $this->dispatchMenuEvent(ConfigureMenuEvent::PROFILE_SIDEBAR_LEFT, $menuBuilder);

        return $menu;
    }
735372
public function build() {
    $build['content'] = [
      '#theme' => 'dashboard',
      '#items' => $this->dashboardManager->getDashboardItems(),
      '#menu' => $this->systemManager->getBlockContents(),
    ];
    $build['#attached']['library'][] = 'acm/dashboard';

    return $build;
  }
499601
public function make()
    {
        $menuClasses = ['dropdown-menu'];

        if ($this->right) {
            $menuClasses[] = 'dropdown-menu-right';
        }

        return new Div(['class' => 'dropdown'], [
            new Anchor(
                [
                    'id' => $this->hash,
                    'data-toggle' => 'dropdown',
                    'aria-haspopup' => 'true',
                    'aria-expanded' => 'false',
                ],
                new Italic(['class' => 'fa fa-ellipsis-h'])
            ),
            new Div(
                [
                    'class' => $menuClasses,
                    'aria-labelledby' => $this->hash,
                ],
                $this->options
            ),
        ]);
    }
1361144
public function Build() {
        $left_menu_output = "<ul class=\"content_left nav-sidebar\">";
        $main_menus = $this->_LoadXml();
        $left_menu_output .= $this->ProcessMainMenus($main_menus);
        $left_menu_output .= "</ul>";
        return $left_menu_output;
    }
1162080
public function resolve()
    {
        foreach ($this->sidebars as $name) {
            $sidebar = $this->resolver->resolve($name);

            $this->container->singleton($name, function () use ($sidebar) {
                return $sidebar;
            });
        }
    }
198617
public function getDocumentsMenu()
    {

        $yaml  = $this->files->get(Path::join($this->path, $this->ref, 'menu.yml'));
        $array = Yaml::parse($yaml);
        $this->factory->getMenus()->forget('project_sidebar_menu');

        $menu = $this->resolveDocumentsMenu($array[ 'menu' ]);
        $menu->setView('docit::menus/project-sidebar');
        $this->runHook('project:documents-menu', [ $this, $menu ]);

        return $menu;
    }
142125
public function build()
    {
        // Has this button an icon to add?
        if (isset($this->icon)) {
            $this->inner = $this->icon->build() . ' ' . $this->inner;
        }

        // Add button type css
        $this->css[] = 'btn-' . $this->option;

        // Do we have to add cs for a specific button size?
        if (isset($this->size)) {
            $this->css[] = 'btn-' . $this->size;
        }

        return parent::build();
    }
437634
public function build(SidebarItem $sidebar)
    {
        if (!$this->context->isGranted('ROLE_SUPER_ADMIN')) return;
        
        $security = $sidebar->addChild('olix_security', array(
            'label' => 'Droits & accès',
            'icon'  => 'fa fa-lock fa-fw',
            'route' => 'olix_security_manager',
        ));
        $security->addChild('olix_security_users', array(
            'label' => 'Gestion des utilisateurs',
            'icon'  => 'fa fa-user fa-fw',
            'route' => 'olix_security_manager_user_list',
        ));
        $security->addChild('olix_security_groups', array(
            'label' => 'Gestion des groupes',
            'icon'  => 'fa fa-group fa-fw',
            'route' => 'olix_security_manager_group_list',
        ));
    }
1077017
public function createMainMenu(array $options): ItemInterface
    {
        $menu = $this->factory->createItem('root');

        $event = new MainMenuCollectionEvent($menu);
        $this->dispatcher->dispatch(MainMenuCollectionEvent::NAME, $event);

        return $menu;
    }