Get WP or sub sidebar menu
@return string Markuo
516403
public function sidebarMenuWP()
    {
        if (get_field('nav_sub_type', 'option') == 'sub') {
            return wp_nav_menu(array(
                'theme_location' => 'main-menu',
                'container' => 'nav',
                'container_class' => 'sidebar-menu',
                'container_id' => 'sidebar-menu',
                'menu_class' => 'nav-aside hidden-xs hidden-sm',
                'menu_id' => '',
                'echo' => false,
                'before' => '',
                'after' => '',
                'link_before' => '',
                'link_after' => '',
                'items_wrap' => '<ul id="%1$s" class="%2$s">%3$s</ul>',
                'fallback_cb' => '__return_false',
                'walker' => new \Municipio\Walker\SidebarMenu(),
                'child_menu' => true
            ));
        }

        return wp_nav_menu(array(
            'theme_location' => 'sidebar-menu',
            'container' => 'nav',
            'container_class' => 'sidebar-menu',
            'container_id' => 'sidebar-menu',
            'menu_class' => 'nav-aside hidden-xs hidden-sm',
            'menu_id' => '',
            'echo' => false,
            'before' => '',
            'after' => '',
            'link_before' => '',
            'link_after' => '',
            'items_wrap' => '<ul id="%1$s" class="%2$s">%3$s</ul>',
            'fallback_cb' => '__return_false'
        ));
    }
1314347
public function createSidebarMenu()
    {
        $menu = $this->factory->createItem('root');

        foreach ($this->pool->getAdminGroups() as $name => $group) {
            $extras = [
                'icon' => $group['icon'],
                'label_catalogue' => $group['label_catalogue'],
                'roles' => $group['roles'],
                'sonata_admin' => true,
            ];

            $menuProvider = $group['provider'] ?? 'sonata_group_menu';
            $subMenu = $this->provider->get(
                $menuProvider,
                [
                    'name' => $name,
                    'group' => $group,
                ]
            );

            $subMenu = $menu->addChild($subMenu);
            $subMenu->setExtras(array_merge($subMenu->getExtras(), $extras));
        }

        $event = new ConfigureMenuEvent($this->factory, $menu);
        $this->eventDispatcher->dispatch(ConfigureMenuEvent::SIDEBAR, $event);

        return $event->getMenu();
    }
689764
public function getBreadCrumb()
    {
        $paths = [];
        $pathData = [];
        $language = \OxidEsales\Eshop\Core\Registry::getLang();
        $baseLanguageId = $language->getBaseLanguage();
        if ($user = $this->getUser()) {
            $username = $user->oxuser__oxusername->value;
            $pathData['title'] = $language->translateString('MY_ACCOUNT', $baseLanguageId, false) . " - " . $username;
        } else {
            $pathData['title'] = $language->translateString('LOGIN', $baseLanguageId, false);
        }
        $pathData['link'] = $this->getLink();
        $paths[] = $pathData;

        return $paths;
    }
1256358
private function createLeftMenu(): string
    {
        $argsCount = 0;
        $arrayKey = $this->getArrayKey($this->menuData);
        $output = '<ul class="navbar navbar-nav mr-auto">';
        foreach ($arrayKey as $menuItem) {
            list($url, $text, $place, $id, $class) = $this->getLinkInformation([$menuItem]);
            if ($place == 'left') {
                $arguments[$argsCount] = $menuItem;
                $arraySubKey = $this->getArrayKey($this->menuData[$menuItem]);
                if (count($arraySubKey) === 0) {
                    $output .= '<li class="nav-item">';
                    $output .= $this->createNavLinkUrl($arguments);
                    $output .= '</li>';
                } else {
                    $output .= '<li class="nav-item dropdown">';
                    $output .= $this->createSubmenu($arguments, $this->menuData[$menuItem]);
                    $output .= '</li>';
                }
            }
        }
        $output .= '</ul>';
        return $output;
    }
925367
public function sidebarMenuAuto()
    {
        $menu = false;

        if (!$menu || (isset($_GET['menu_cache']) && $_GET['menu_cache'] == 'false')) {
            $menu = new \Municipio\Helper\NavigationTree(array(
                'include_top_level' => !empty(get_field('nav_sub_include_top_level', 'option')) ? get_field('nav_sub_include_top_level', 'option') : false,
                'render' => get_field('nav_sub_render', 'option'),
                'depth' => get_field('nav_sub_depth', 'option') ? get_field('nav_sub_depth', 'option') : -1,
                'start_depth' => get_field('nav_primariy_second_level', 'option') ? 3 : 1,
                'classes' => 'nav-aside hidden-xs hidden-sm',
                'sidebar' => true
            ));
        }

        if ($menu->itemCount === 0) {
            return '';
        }

        return '<nav id="sidebar-menu">
                    ' . $menu->render(false) . '
                </nav>';
    }
1347530
public String getHtmlMenudesc()
    {
        Record recMenu = this.getMainRecord();
        if (recMenu.getField(MenusModel.COMMENT).getLength() > 0)
            return recMenu.getField(MenusModel.COMMENT).toString();
        else
            return super.getHtmlMenudesc();
    }
1196012
public function getSidebar($sidebar_name)
    {
        global $wp_registered_sidebars;

        $sidebar_id = null;

        foreach ($wp_registered_sidebars as $registered_sidebar_id => $registered_sidebar) {
            if ($sidebar_name === $registered_sidebar['name']) {
                $sidebar_id = $registered_sidebar_id;
                break;
            }
        }

        if ($sidebar_id === null) {
            throw new UnexpectedValueException(sprintf('[W614] Sidebar "%s" does not exist', $sidebar_name));
        }

        return $sidebar_id;
    }
11741
protected function menu()
    {

        $this->Benchmark->start('getMenu');
        try {
            $menu = $this->CMSNavItemService->getMenu();
        } catch (Exception $e) {
            return '';
        }
        $this->Benchmark->end('getMenu');

        $this->Benchmark->start('buildMenu');
        $dom_id    = $this->getParameter('id');
        $dom_class = $this->getParameter('class');

        $this->matchedCurrentURI = false;

        $root_options = array();
        if (!empty($dom_id))
            $root_options[] = "id='{$dom_id}'";
        if (!empty($dom_class))
            $root_options[] = "class='{$dom_class}'";

        $family_tree = "<ul " . join(' ', $root_options). ">\n";

        $this->requestURI = ltrim($this->Request->getAdjustedRequestURI(), '/');

        foreach ( $menu as $parent ) {
            $family_tree .= $this->_buildMenuTree($parent, "parent", "<span>%s</span>", true);
        }

        $family_tree .= "</ul>\n";
        $this->Benchmark->end('buildMenu');

        return $family_tree;
    }
236670
public function menuLanguages(): ?Menu
    {
        $menu = new Menu(I18N::translate('Language'), '#', 'menu-language');

        foreach (I18N::activeLocales() as $locale) {
            $language_tag = $locale->languageTag();
            $class        = 'menu-language-' . $language_tag . (WT_LOCALE === $language_tag ? ' active' : '');
            $menu->addSubmenu(new Menu($locale->endonym(), '#', $class, [
                'onclick'       => 'return false;',
                'data-language' => $language_tag,
            ]));
        }

        if (count($menu->getSubmenus()) > 1) {
            return $menu;
        }

        return null;
    }
730275
public function mobileMenu()
    {
        if (get_field('nav_mobile_enable', 'option') === false) {
            return '';
        }

        if (get_field('nav_primary_enable', 'option') === false && get_field('nav_sub_enable', 'option') === false) {
            return '';
        }

        if (get_field('nav_primary_type', 'option') == 'wp' && (!get_field('nav_sub_type', 'option') || in_array(get_field('nav_sub_type', 'option'), array('sub', 'wp')))) {
            return $this->mobileMenuWP();
        } else {
            return $this->mobileMenuAuto();
        }
    }
970394
public function getMenuImgs() {
    $re = ['menu'=>'', 'imgs'=>''];
    try{
      $obdr = new DirectoryIterator($_SERVER['DOCUMENT_ROOT'] .'/'. $this->root . $this->imgdr);         // object of the dir
    }
    catch(Exception $e) {
      return '<h2>ERROR from PHP:</h2><h3>'. $e->getMessage() .'</h3><h4>Check the $root value in imgbrowse.php to see if it is the correct path to the image folder; RELATIVE TO ROOT OF YOUR WEBSITE ON SERVER</h4>';
    }

    // get protocol and host name to add absolute path in <img src>
    $protocol = !empty($_SERVER['HTTPS']) ? 'https://' : 'http://';
    $site = $protocol. $_SERVER['SERVER_NAME'] .'/';

    // traverse the $obdr
    foreach($obdr as $fileobj) {
      $name = $fileobj->getFilename();

      // if image file, else, directory (but not . or ..), add data in $re
      if($fileobj->isFile() && in_array($fileobj->getExtension(), $this->imgext)) $re['imgs'] .= '<span><img src="'. $site . $this->root . $this->imgdr . $name .'" alt="'. $name .'" height="50" />'. $name .'</span>';
      else if($fileobj->isDir() && !$fileobj->isDot()) $re['menu'] .= '<li><span title="'. $this->imgdr . $name .'">'. $name .'</span></li>';
    }
    if($re['menu'] != '') $re['menu'] = '<ul>'. $re['menu'] .'</ul>';
    if($re['imgs'] == '') $re['imgs'] = '<h1>No Images</h1>';
    return $re;
  }
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'));
    }
959816
public static function outputDropdownLinksMenu()
    {
        if (!\Municipio\Helper\Navigation::getMenuNameByLocation('dropdown-links-menu')) {
            return;
        }

        $args = array(
            'menu' => \Municipio\Helper\Navigation::getMenuNameByLocation('dropdown-links-menu'),
            'container' =>  false,
            'menu_class' => 'o-dropdown-links',
            'echo' => false
        );

        return wp_nav_menu($args);
    }
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;
    }
221066
public function sideMenu()
    {
        $menu = $this->factory->createItem('root');

        $this->dispatcher->dispatch(
            ConfigureMenuEvent::CONFIGURE,
            new ConfigureMenuEvent($this->factory, $menu)
        );

        return $menu;
    }
772957
public function getMenus()
    {
        if ($this->_normalizeMenus === null) {
            $mid = '/' . $this->getUniqueId() . '/';
            // resolve core menus
            $this->_normalizeMenus = [];

            $config = components\Configs::instance();
            $conditions = [
                'user' => $config->db && $config->db->schema->getTableSchema($config->userTable),
                'assignment' => ($userClass = Yii::$app->getUser()->identityClass) && is_subclass_of($userClass, 'yii\db\BaseActiveRecord'),
                'menu' => $config->db && $config->db->schema->getTableSchema($config->menuTable),
            ];
            foreach ($this->_coreItems as $id => $lable) {
                if (!isset($conditions[$id]) || $conditions[$id]) {
                    $this->_normalizeMenus[$id] = ['label' => Yii::t('rbac-admin', $lable), 'url' => [$mid . $id]];
                }
            }
            foreach (array_keys($this->controllerMap) as $id) {
                $this->_normalizeMenus[$id] = ['label' => Yii::t('rbac-admin', Inflector::humanize($id)), 'url' => [$mid . $id]];
            }

            // user configure menus
            foreach ($this->_menus as $id => $value) {
                if (empty($value)) {
                    unset($this->_normalizeMenus[$id]);
                    continue;
                }
                if (is_string($value)) {
                    $value = ['label' => $value];
                }
                $this->_normalizeMenus[$id] = isset($this->_normalizeMenus[$id]) ? array_merge($this->_normalizeMenus[$id], $value)
                : $value;
                if (!isset($this->_normalizeMenus[$id]['url'])) {
                    $this->_normalizeMenus[$id]['url'] = [$mid . $id];
                }
            }
        }
        return $this->_normalizeMenus;
    }
331894
public function icon() {
		if ( ! $this->icon ) {
			return '';
		}

		if ( 0 === strpos( $this->icon, 'dashicons-' ) ) {
			$icon_html = '<span class="wplibs-menu-icon dashicons ' . esc_attr( $this->icon ) . '"></span>';
		} elseif ( 0 === strpos( $this->icon, 'suru-icon-' ) ) {
			$icon_html = '<span class="wplibs-menu-icon suru-icon ' . esc_attr( $this->icon ) . '"></span>';
		} elseif ( preg_match( '/^(http.*\.)(jpe?g|png|[tg]iff?|svg)$/', $this->icon ) ) {
			$icon_html = '<span class="wplibs-menu-icon" style="background-image:url(\'' . esc_attr( $this->icon ) . '\'"></span>';
		} else {
			$icon_html = '<span class="wplibs-menu-icon ' . esc_attr( $this->icon ) . '"></span>';
		}

		return $icon_html;
	}