Add right positioned menu.

@return Menu
334136
public function addMenuRight()
    {
        $menu = $this->add([new self(), 'ui' => false], 'RightMenu');
        $menu->removeClass('item')->addClass('right menu');

        return $menu;
    }
134176
public static function getMenu()
    {
        return (new \Mmi\Navigation\NavigationConfigElement)
            ->setLabel('menu.text.container')
            ->setIcon('fa-align-left')
            ->setUri('#')
            ->addChild((new \Mmi\Navigation\NavigationConfigElement)
                ->setLabel('menu.text.index')
                ->setIcon('fa-table')
                ->setModule('cmsAdmin')
                ->setController('text'))
            ->addChild((new \Mmi\Navigation\NavigationConfigElement)
                ->setLabel('menu.text.edit')
                ->setIcon('fa-plus')
                ->setModule('cmsAdmin')
                ->setController('text')
                ->setAction('edit'));
    }
729630
public static function getMenu()
    {
        return (new \Mmi\Navigation\NavigationConfigElement)
            ->setLabel('menu.system.container')
            ->setIcon('fa-cogs')
            ->setUri('#')
            ->addChild((new \Mmi\Navigation\NavigationConfigElement)
                ->setLabel('menu.attribute.container')
                ->setIcon('fa-book')
                ->setUri('#')
                ->addChild((new \Mmi\Navigation\NavigationConfigElement)
                    ->setLabel('menu.attribute.index')
                    ->setIcon('fa-table')
                    ->setModule('cmsAdmin')
                    ->setController('attribute'))
                ->addChild((new \Mmi\Navigation\NavigationConfigElement)
                    ->setLabel('menu.attribute.edit')
                    ->setIcon('fa-plus')
                    ->setModule('cmsAdmin')
                    ->setController('attribute')
                    ->setAction('edit')))
            //szablony
            ->addChild(
                (new \Mmi\Navigation\NavigationConfigElement)
                    ->setLabel('menu.categoryType.container')
                    ->setIcon('fa-clone')
                    ->setUri('#')
                    ->addChild((new \Mmi\Navigation\NavigationConfigElement)
                        ->setLabel('menu.categoryType.index')
                        ->setIcon('fa-table')
                        ->setModule('cmsAdmin')
                        ->setController('categoryType'))
                    ->addChild((new \Mmi\Navigation\NavigationConfigElement)
                        ->setLabel('menu.categoryType.edit')
                        ->setIcon('fa-plus')
                        ->setModule('cmsAdmin')
                        ->setController('categoryType')
                        ->setAction('edit'))
            )
            //widgety
            ->addChild((new \Mmi\Navigation\NavigationConfigElement)
                ->setLabel('menu.categoryWidget.container')
                ->setIcon('fa-bars')
                ->setUri('#')
                ->addChild(
                    (new \Mmi\Navigation\NavigationConfigElement)
                        ->setLabel('menu.categoryWidget.index')
                        ->setIcon('fa-table')
                        ->setModule('cmsAdmin')
                        ->setController('categoryWidget')
                )
                ->addChild((new \Mmi\Navigation\NavigationConfigElement)
                    ->setLabel('menu.categoryWidget.edit')
                    ->setIcon('fa-plus')
                    ->setModule('cmsAdmin')
                    ->setController('categoryWidget')
                    ->setAction('edit')))
            ->addChild((new \Mmi\Navigation\NavigationConfigElement)
                ->setLabel('menu.tag.container')
                ->setIcon('fa-tags')
                ->setUri('#')
                ->addChild((new \Mmi\Navigation\NavigationConfigElement)
                    ->setLabel('menu.tag.index')
                    ->setIcon('fa-table')
                    ->setModule('cmsAdmin')
                    ->setController('tag'))
                ->addChild((new \Mmi\Navigation\NavigationConfigElement)
                    ->setLabel('menu.tagRelation.index')
                    ->setIcon('fa-tag')
                    ->setModule('cmsAdmin')
                    ->setController('tagRelation'))
                ->addChild((new \Mmi\Navigation\NavigationConfigElement)
                    ->setLabel('menu.tagRelation.edit')
                    ->setIcon('fa-plus')
                    ->setModule('cmsAdmin')
                    ->setController('tag')
                    ->setAction('edit')))
            ->addChild(
                (new \Mmi\Navigation\NavigationConfigElement)
                    ->setLabel('menu.cron.container')
                    ->setIcon('fa-calendar')
                    ->setUri('#')
                    ->addChild((new \Mmi\Navigation\NavigationConfigElement)
                        ->setLabel('menu.cron.index')
                        ->setIcon('fa-table')
                        ->setModule('cmsAdmin')
                        ->setController('cron'))
                    ->addChild(
                        (new \Mmi\Navigation\NavigationConfigElement)
                            ->setLabel('menu.cron.edit')
                            ->setIcon('fa-plus')
                            ->setModule('cmsAdmin')
                            ->setController('cron')
                            ->setAction('edit')
                    )
            )
            ->addChild((new \Mmi\Navigation\NavigationConfigElement)
                ->setLabel('menu.file.index')
                ->setIcon('fa-file')
                ->setModule('cmsAdmin')
                ->setController('file'))
            ->addChild((new \Mmi\Navigation\NavigationConfigElement)
                ->setLabel('menu.connector.index')
                ->setIcon('fa-cloud-download')
                ->setModule('cmsAdmin')
                ->setController('connector')
                ->addChild(
                    (new \Mmi\Navigation\NavigationConfigElement)
                        ->setLabel('menu.connector.files')
                        ->setModule('cmsAdmin')
                        ->setController('connector')
                        ->setAction('files')
                        ->setDisabled()
                ))
            ->addChild((new \Mmi\Navigation\NavigationConfigElement)
                ->setLabel('menu.config')
                ->setIcon('fa-list')
                ->setModule('cmsAdmin')
                ->setController('config'))
            ->addChild((new \Mmi\Navigation\NavigationConfigElement)
                ->setLabel('menu.cache')
                ->setModule('cmsAdmin')
                ->setIcon('fa-trash')
                ->setController('cache'));
    }
656424
protected function createComponentMenu(): Menu
	{
		$moduleMenu = $this->menuFactory->create();
		$moduleMenu->setTranslator($this->translator);
		$moduleMenu->setBaseUrl('cms.title', ":{$this->module}:Homepage:");
		return $moduleMenu;
	}
40858
protected function renderRightToolbar()
    {
        if (empty($this->rightToolbar) || (!is_string($this->rightToolbar) && !is_array($this->rightToolbar))) {
            return '';
        }
        if (is_string($this->rightToolbar)) {
            return $this->rightToolbar;
        }
        $rightToolbar = '';
        foreach ($this->rightToolbar as $item) {
            if (is_array($item)) {
                $content = ArrayHelper::getValue($item, 'content', '');
                $options = ArrayHelper::getValue($item, 'options', []);
                Html::addCssClass($options, 'btn-group');
                $rightToolbar .= Html::tag('div', $content, $options);
            } else {
                $rightToolbar .= "\n{$item}";
            }
        }

        return $rightToolbar;
    }
152133
public function prepare()
    {
        $id = $this->getAttribute('id');
        $menus = $this->menu['with'] ?? [];
        $parent = $this->getAttribute('position');
        $position = Str::startsWith($parent, '^:') ? $parent.'.' : '^:';

        foreach ((array) $menus as $class) {
            $menu = $this->container->make($class)
                            ->setAttribute('position', "{$position}{$id}")
                            ->prepare();

            if ($menu->passes()) {
                $this->childs[] = $menu;
            }
        }

        $this->name = $id;
        $this->showToUser = $this->passesAuthorization();

        return $this;
    }
1185979
public function menu($name = 'default')
    {
        if (!isset($this->menus[$name])) {
            $this->menus[$name] = new Menu($this);
        }

        return $this->menus[$name];
    }
1218376
public function enaThumbView()
    {
        $properties = $this->getProperties();
        $properties['thumbView'] = self::BOOLEAN_TRUE;
        $this->setProperties($properties);
        return $this;
    }
437795
public function enaThumbDload()
    {
        $properties = $this->getProperties();
        $properties['thumbDload'] = self::BOOLEAN_TRUE;
        $this->setProperties($properties);
        return $this;
    }
164903
public Menu getContextMenu() {
		if (menu == null) {
			menu = new Menu();
			menu.addItem(new AttributesAction(mapWidget));
			menu.addItem(new MenuItemSeparator());
			menu.addItem(new UndoOperationAction(mapWidget, this));
			menu.addItem(new CancelEditingAction(mapWidget, (ParentEditController) parent));
			menu.addItem(new SaveEditingAction(mapWidget, (ParentEditController) parent));
			menu.addItem(new ToggleEditModeAction((ParentEditController) parent));
			menu.addItem(new MenuItemSeparator());
			menu.addItem(new InsertPointAction(mapWidget));
			menu.addItem(new RemovePointAction(mapWidget));
			menu.addItem(new MenuItemSeparator());
			menu.addItem(new InsertRingAction(mapWidget, (ParentEditController) parent));
			menu.addItem(new RemoveRingAction(mapWidget));
			menu.addItem(new MenuItemSeparator());
			menu.addItem(new ToggleGeometricInfoAction(this));
			menu.addItem(new ToggleSnappingAction(getFeatureTransaction().getLayer(), this));
		}
		return menu;
	}
905842
public function add($id)
    {
        if ($this->has($id)) {
            return $this->get($id);
        }

        $menu = $this->container->make(Menu::class, [
            'menuFactory' => $this
        ]);
        $this->runHook('menu-factory:add', [$this, $menu]);
        $this->menus->put($id, $menu);
        return $menu;
    }
633143
public function menu()
    {
        $tree = (new Menu())->toTree();
        if ($this->isAdmin()) {
            return $tree;
        }

        ///
        $permissions = array_get($this->allPermissions(), 'GET');
        return $this->permissionsToMenu($permissions, $tree);
    }
1007506
public function addChild(Menu $child)
    {
        $this->children[$child->getOrder() . '--' . $child->getLabel()] = $child;

        return $this;
    }
1087802
public static function getMenu()
    {
        return (new \Mmi\Navigation\NavigationConfigElement)
            ->setLabel('menu.mail.container')
            ->setIcon('fa-envelope-o')
            ->setUri('#')
            ->addChild((new \Mmi\Navigation\NavigationConfigElement)
                ->setLabel('menu.mail.index')
                ->setIcon('fa-table')
                ->setModule('cmsAdmin')
                ->setController('mail'))
            ->addChild((new \Mmi\Navigation\NavigationConfigElement)
                ->setLabel('menu.mail.preview')
                ->setDisabled()
                ->setModule('cmsAdmin')
                ->setController('mail')
                ->setAction('preview'))
            ->addChild((new \Mmi\Navigation\NavigationConfigElement)
                ->setLabel('menu.mail.send')
                ->setIcon('fa-paper-plane')
                ->setModule('cmsAdmin')
                ->setController('mail')
                ->setAction('send'))
            ->addChild(
                (new \Mmi\Navigation\NavigationConfigElement)
                    ->setLabel('menu.mailDefinition.container')
                    ->setIcon('fa-clone')
                    ->setUri('#')
                    ->addChild((new \Mmi\Navigation\NavigationConfigElement)
                        ->setLabel('menu.mailDefinition.index')
                        ->setIcon('fa-table')
                        ->setModule('cmsAdmin')
                        ->setController('mailDefinition'))
                    ->addChild((new \Mmi\Navigation\NavigationConfigElement)
                        ->setLabel('menu.mailDefinition.edit')
                        ->setIcon('fa-plus')
                        ->setModule('cmsAdmin')
                        ->setController('mailDefinition')
                        ->setAction('edit'))
            )
            ->addChild(
                (new \Mmi\Navigation\NavigationConfigElement)
                    ->setLabel('menu.mailServer.container')
                    ->setIcon('fa-server')
                    ->setUri('#')
                    ->addChild((new \Mmi\Navigation\NavigationConfigElement)
                        ->setLabel('menu.mailServer.index')
                        ->setIcon('fa-table')
                        ->setModule('cmsAdmin')
                        ->setController('mailServer'))
                    ->addChild((new \Mmi\Navigation\NavigationConfigElement)
                        ->setLabel('menu.mailServer.edit')
                        ->setIcon('fa-plus')
                        ->setModule('cmsAdmin')
                        ->setController('mailServer')
                        ->setAction('edit'))
            );
    }
896400
public function add()
    {
        $this->request->allowMethod(['get', 'post']);

        $menu = $this->Menus->newEntity();
        if ($this->request->is('post') && !empty($this->request->data)) {
            $this->Menus->patchEntity($menu, $this->request->data);
            if ($this->Menus->save($menu)) {
                $this->Flash->success(__d('wasabi_core', 'The menu <strong>{0}</strong> has been created.', $this->request->data['name']));
                $this->redirect(['action' => 'index']);
                return;
            } else {
                $this->Flash->error($this->formErrorMessage);
            }
        }
        $this->set('menu', $menu);
    }
1253057
public function add(Menu $menu)
    {
        foreach ($menu->getGroups() as $group) {
            if ($this->groups->has($group->getName())) {
                $existingGroup = $this->groups->get($group->getName());

                $group->hideHeading(!$group->shouldShowHeading());

                foreach ($group->getItems() as $item) {
                    $existingGroup->addItem($item);
                }
            } else {
                $this->addGroup($group);
            }
        }

        return $this;
    }
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;
    }