Creates the user menu.

@return \Knp\Menu\ItemInterface
776024
public function createUserMenu()
    {
        $menu = $this->factory->createItem('root');

        if ($this->accountEnabled) {
            if (null !== $token = $this->tokenStorage->getToken()) {
                if ($this->authorization->isGranted('IS_AUTHENTICATED_FULLY') || $this->authorization->isGranted('IS_AUTHENTICATED_REMEMBERED')) {
                    /** @var \Ekyna\Bundle\UserBundle\Model\UserInterface $user */
                    $user = $token->getUser();
                    $item = $menu->addChild($user->getEmail(), ['uri' => '#']);
                    $item->addChild('ekyna_user.account.menu.my_profile', ['route' => 'fos_user_profile_show']);
                    if ($this->authorization->isGranted('ROLE_ADMIN')) {
                        $item->addChild('ekyna_user.account.menu.backend', ['route' => 'ekyna_admin']);
                    }
                    $item->addChild('ekyna_user.account.menu.logout', ['route' => 'fos_user_security_logout']);
                    return $menu;
                }
            }
            $menu->addChild('ekyna_user.account.menu.login', ['route' => 'fos_user_security_login']);
        }

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

        $menuItems = [
            self::ITEM__SEARCH => $this->createMenuItem(
                self::ITEM__SEARCH,
                [
                    'route' => 'ezplatform.search',
                    'extras' => ['icon' => 'search'],
                ]
            ),
            self::ITEM__BROWSE => $this->createMenuItem(
                self::ITEM__BROWSE,
                [
                    'extras' => ['icon' => 'browse'],
                    'attributes' => [
                        'type' => 'button',
                        'class' => 'btn--udw-browse',
                        'data-udw-config' => $this->udwExtension->renderUniversalDiscoveryWidgetConfig('single', [
                            'type' => 'content_create',
                        ]),
                        'data-starting-location-id' => $this->configResolver->getParameter(
                            'universal_discovery_widget_module.default_location_id'
                        ),
                    ],
                ]
            ),
            self::ITEM__TREE => $this->createMenuItem(
                self::ITEM__TREE,
                [
                    'extras' => ['icon' => 'content-tree'],
                    'attributes' => [
                        'type' => 'button',
                        'class' => 'ez-btn ez-btn--toggle-content-tree',
                    ],
                ]
            ),
            self::ITEM__BOOKMARK => $this->createMenuItem(
                self::ITEM__BOOKMARK,
                [
                    'route' => 'ezplatform.bookmark.list',
                    'extras' => ['icon' => 'bookmark-manager'],
                ]
            ),
        ];

        if ($this->permissionResolver->hasAccess('content', 'restore')) {
            $menuItems[self::ITEM__TRASH] = $this->createMenuItem(
                self::ITEM__TRASH,
                [
                    'route' => 'ezplatform.trash.list',
                    'extras' => ['icon' => 'trash'],
                ]
            );
        }

        $menu->setChildren($menuItems);

        return $menu;
    }
522471
public function getSelectedUser()
    {
        static $user = null;

        if ($user !== null) {
            return $user;
        }

        $staffId = $this->_getIdParam();
        if ($staffId) {
            $user   = $this->loader->getUserLoader()->getUserByStaffId($staffId);
            $source = $this->menu->getParameterSource();
            $user->applyToMenuSource($source);
        } else {
            $user = false;
        }

        return $user;
    }
589907
protected function generateMenuItem(ItemInterface $menuItem): Menu
    {
        return new Menu($menuItem, $this->dispatcher, $this->renderer);
    }
1144897
public function createStructure(array $options): ItemInterface
    {
        $menu = $this->factory->createItem('root');

        $menu->setChildren([
            self::ITEM__ACCOUNT => $this->createMenuItem(
                self::ITEM__ACCOUNT,
                [
                    'route' => 'edgar.ezuiprofile.account',
                    'extras' => ['icon' => 'author'],
                ]
            ),
            self::ITEM__SECURITY => $this->createMenuItem(
                self::ITEM__SECURITY,
                [
                    'route' => 'edgar.ezuiprofile.security',
                    'extras' => ['icon' => 'lock'],
                ]
            ),
            self::ITEM__CONTENT => $this->createMenuItem(
                self::ITEM__CONTENT,
                [
                    'route' => 'edgar.ezuiprofile.content',
                    'extras' => ['icon' => 'personalize-content'],
                ]
            ),
        ]);

        return $menu;
    }
1251123
public function actionCreateFromPage()
    {
        $this->menuFlush();
        $model = new Nav();
        $response = $model->createItemLanguageCopy($this->postArg('id'), $this->postArg('toLangId'), $this->postArg('title'), $this->postArg('alias'));
        
        if (is_array($response)) {
            return $this->sendArrayError($response);
        }
        
        return $response;
    }
925384
public function create()
    {
        $user = $this->users->getEmptyUser();

        $userPermissions = array();
        $genericPermissions = $this->permissions->generic();
        $modulePermissions = $this->permissions->module();


        //Get Groups
        $groups = $this->groups->findAll();

        return View::make(Config::get('cpanel::views.users_create'))
            ->with('user',$user)
            ->with('userPermissions',$userPermissions)
            ->with('genericPermissions',$genericPermissions)
            ->with('modulePermissions',$modulePermissions)
            ->with('groups',$groups);
    }
1196457
public function crumbMenu()
    {
        $nb = $this->spawn('crumbMenu', new Collection());

        $item = $this->active();
        $items = [$item];
        while ($item->hasParent()) {
            $item = $item->parent();
            array_unshift($items, $item);
        }

        foreach ($items as $item) {
            $nb->add($item->title, $item->url());
        }

        return $nb;
    }
1069333
public static function create(UserInterface $user): UserMetaInterface
    {
        /** @var AbstractUser $user */
        $user_meta = static::findOne(['user_id' => $user->id]);
        if ($user_meta instanceof UserMetaInterface) {
            return $user_meta;
        }
        $user_meta = new static([
            'user_id' => $user->id,
            'notification_email' => $user->email,
            'display_name' => $user->username,
        ]);
        (new UserMetaHandler($user_meta))->create();
        $user_meta->refresh();
        return $user_meta;
    }
177964
public function newAction()
    {
        $entity = new Menu();
        $form   = $this->createForm('menu', $entity);

        return array(
            'entity' => $entity,
            'form'   => $form->createView(),
        );
    }
57868
public function create()
    {
        $menu = $this->handler->add($this->name, $this->getAttribute('position'))
                    ->title($this->getAttribute('title'))
                    ->link($this->getAttribute('link'))
                    ->handles($this->menu['link'] ?? null);

        $this->attachIcon($menu);
        $this->handleNestedMenu();

        return $this;
    }
42634
protected function makeSidebar()
    {
        $this->navigation->create(Navigable::MENU_SIDEBAR, function (MenuBuilder $sidebar) {
            $sidebar->header('Main Menu');

            // Dashboard
            $sidebar->route('scaffold.dashboard', trans('administrator::module.dashboard'), [], 1, [
                'id' => 'dashboard',
                'icon' => 'fa fa-dashboard',
                'active' => str_is(request()->route()->getName(), 'scaffold.dashboard'),
            ]);

            // Create new users group
            $sidebar->dropdown(trans('administrator::module.groups.users'), function (MenuItem $sub) {
                $sub->route('scaffold.create', trans('administrator::buttons.create_item', ['resource' => 'User']), ['module' => 'users'], 1, []);
            }, 2, ['id' => 'groups', 'icon' => 'fa fa-group']);
        });
    }
88686
public function create()
    {
        $roles = Role::select('id', 'name', 'label')->get();
        $roles = $roles->pluck('label', 'name');

        return view('admin.users.create', compact('roles'));
    }
1068545
public function options() {
        $options = array();
        foreach ($this->items as $userid => $user) {
            $options[$userid] = fullname($user);
        }

        return $options;
    }
972487
public function createStructure(array $options): ItemInterface
    {
        /** @var ItemInterface|ItemInterface[] $menu */
        $menu = $this->factory->createItem('root');

        $contentMenuItems = $this->getContentMenuItems();
        $menu->addChild($this->factory->createItem(self::ITEM_CONTENT, []));
        $menu[self::ITEM_CONTENT]->setChildren($contentMenuItems);

        $adminMenuItems = $this->getAdminMenuItems();
        $menu->addChild($this->factory->createItem(self::ITEM_ADMIN, []));
        $menu[self::ITEM_ADMIN]->setChildren($adminMenuItems);

        return $menu;
    }
23641
public function createAccountMenu()
    {
        $menu = $this->factory->createItem('root');

        uasort($this->accountEntries, function($a, $b) {
            if ($a['position'] == $b['position']) {
                return 0;
            }
            return $a['position'] < $b['position'] ? -1 : 1;
        });

        foreach($this->accountEntries as $name => $options) {
            $menu->addChild($name, $options);
        }

        return $menu;
    }
286378
private function createUsers()
    {
        if($this->option('users')
            || $this->option('users_per_role')
            || $this->option('all')
        ) {

            $this->comment('Creating dummy users...');
            $output = (new \UserSeeder())
                ->setCommand($this)
                ->run(
                    $this->getDefaultOption('users'),
                    $this->getDefaultOption('users_per_role'),
                    $this->getDefaultOption('role_id')
                );
            $this->info($output);
        }
        return $this;
    }