Render the menu.

@param bool $specialSidebar

@return string
162516
protected function renderMenu(bool $specialSidebar = false): string
    {
        $presenter = $this->getPresenter();
        $menu = $presenter->getOpenTagWrapper();

        foreach ($this->getOrderedItems() as $item) {
            if ($item->isHidden()) {
                continue;
            }

            if ($item->hasChilds()) {
                $menu .= $presenter->getMenuWithDropDownWrapper($item, $specialSidebar);
            } elseif ($item->isHeader()) {
                $menu .= $presenter->getHeaderWrapper($item);
            } elseif ($item->isDivider()) {
                $menu .= $presenter->getDividerWrapper();
            } else {
                $menu .= $presenter->getMenuWithoutDropdownWrapper($item);
            }
        }

        $menu .= $presenter->getCloseTagWrapper();

        return $menu;
    }
300046
public function render()
    {
        $output[] = $this->open();

        foreach ($this->bars as $bar) {
            $output[] = $bar->render();
        }

        $output[] = $this->close();

        return implode(PHP_EOL, $output);
    }
1318917
public function render($menu_level = 0)
    {
        static::activateIfItemIsActive($this);

        if (!$this->authorized) {
            return '';
        }

        if ($this->checkItemIsActive($this)
            && (($this->getHideIfNotActiveOption() && $this->getActive())
            || !$this->getHideIfNotActiveOption())) {

            // Available options for this item.
            $container_tag = array_get($this->option, 'container_tag', 'ul');
            $container_class = array_get($this->option, 'container_class', 'nav');
            $item_tag = array_get($this->option, 'item_tag', 'li');
            $text_only = array_get($this->option, 'text_only', false);
            $hide_children = array_get($this->option, 'hide_children', false);
            $force_inactive = array_get($this->option, 'force_inactive', false);
            $before_tag_html = array_get($this->option, 'before_tag', '');
            $after_tag_html = array_get($this->option, 'after_tag', '');

            $html = (!$text_only && $this->html != '') ? $this->html : $this->title;

            // Force the menu items to not show active.
            if ($force_inactive) {
                $this->setActive(false);
            }

            // Link is not empty.
            if ($this->link_type !== self::LINK_EMPTY) {
                // Create the link.
                $html_link = Html::a()->text($html)
                    ->openNew(!$this->getOpenNewWindowOption())
                    ->href($this->generateUrl())
                    ->title($this->title);

                if (!$text_only) {
                    $html_link->addAttributes($this->link_attribute);
                }

                $html = $html_link->s();
            } elseif (!empty($this->title)) {
                $html = Html::span($html)->title($this->title);

                if (!$text_only) {
                    $html->addAttributes($this->link_attribute);
                }
            }

            // Generate each of the children items.
            if (!$hide_children && $this->hasChildren()) {
                $child_html = '';

                $item_callback = array_get($this->option, 'item_callback', null);

                // Generate each child menu item (repeat this method)
                foreach ($this->children() as $item) {
                    $item->setItemTagOption($item_tag);

                    if (!is_null($item_callback) && is_callable($item_callback)) {
                        $item_callback($item);
                        $item->setItemCallbackOption($item_callback);
                    }

                    $child_html .= $item->render($menu_level + 1);
                }

                if ($child_html !== '') {
                    // Name the level
                    $number_as_word = (new NumberConverter())->ordinal($menu_level);

                    // Generate the list container
                    $html_container = Html::$container_tag($child_html)
                        ->addAttributes($this->container_attribute)
                        ->addClass($container_class)
                        ->addClass(sprintf('%s-%s-level', $container_class, $number_as_word));

                    $html .= $html_container->s();
                }
            }

            if ($this->generateUrl() == \Request::url()
                && !$this->hasChildren()) {
                $this->addItemAttribute('class', 'actual-link');
            }

            // Create the container and allocate the link.
            return Html::$item_tag($before_tag_html.$html.$after_tag_html)->addAttributes($this->item_attribute)->s();
        }

        return '';
    }
1173959
public function adminBar()
    {
        if (isset($_GET['id'])) {
            if (is_numeric($_GET['id']) && $_GET['id'] > 0) {
                $post = get_post($_GET['id']);

                if (!$post) {
                    return;
                }

                setup_postdata($post);

                add_action('admin_bar_menu', function () use ($post) {
                    global $wp_admin_bar;
                    $wp_admin_bar->add_node(array(
                        'id' => 'view_page',
                        'title' => __('View Page'),
                        'href' => get_permalink($post->ID),
                        'meta' => array(
                            'target' => '_blank'
                        )
                    ));
                }, 1050);

                self::$isEditing = array(
                    'id' => $post->ID,
                    'title' => $post->post_title
                );

                wp_reset_postdata();
            } else {
                global $archive;
                $archive = $_GET['id'];

                self::$isEditing = array(
                    'id' => null,
                    'title' => $archive
                );
            }

            self::$isEditing = apply_filters('Modularity/is_editing', self::$isEditing);

            add_action('Modularity/options_page_title_suffix', function () {
                echo ': ' . self::$isEditing['title'];
            });
        }
    }
830496
public function render()
    {
        parent::render();

        $oParentView = $this->getParent();

        // add content for main menu
        $oContentList = oxNew(\OxidEsales\Eshop\Application\Model\ContentList::class);
        $oContentList->loadMainMenulist();
        $oParentView->setMenueList($oContentList);

        return;
    }
224163
public function render() {
		$output = null;
		if ( $this->child_count() > 0 ) {
			$output .= '<div id="panel-' . esc_attr( $this->id() ) . '" class="uix-' . esc_attr( $this->type ) . '-inside ' . esc_attr( $this->wrapper_class_names() ) . '">';
			$output .= $this->label() . $this->description() . $this->navigation() . $this->panel_section();
			$output .= '</div>';
		} else {
			$output .= $this->panel_section();
		}
		$output .= $this->render_template();

		return $output;
	}
359073
public function renderTree($menuItems, $level = null)
    {
        $output = '';

        $depth = ($level !== null) ? $level : 1;

        foreach ($menuItems as $key => $menuItem) {
            $classes = ['menu-item'];
            $menuItemRow = $this->_View->element('../Menus/__menu-item-row', [
                'menuItem' => $menuItem,
                'level' => $level
            ]);

            if (!empty($menuItem['children'])) {
                $menuItemRow .= '<ul>' . $this->renderTree($menuItem['children'], $depth + 1) . '</ul>';
            } else {
                $classes[] = 'no-children';
            }
            $output .= '<li class="' . join(' ', $classes) . '" data-menu-item-id="' . $menuItem['id'] . '">' . $menuItemRow . '</li>';
        }

        return $output;
    }
273692
public function beforeRenderSidebarNavigation()
    {
        $controller = $this->_controller();
        $sidebarNavigation = $this->_getSidebarNavigation();
        $controller->set('disableSidebar', ($sidebarNavigation === false) ? true : false);
        $controller->set('sidebarNavigation', $sidebarNavigation);
    }
148741
private function render() : string
    {
        $styles = $this->styles();
        if (strlen($styles) > 0) {
            $styles = 'style="' . $this->view->escapeHtmlAttr(trim($styles)) . '"';
        }

        return '
            <div class="progress">
                <div class="progress-bar' . $this->classes() . '" role="progressbar" ' . $styles .
            ' aria-valuenow="' . $this->value . '" aria-valuemin="0" aria-valuemax="100">' .
            (($this->label !== null) ? $this->view->escapeHtml($this->label) : null) . '</div>
            </div>';
    }
765040
public function renderPk(): string
    {
        $output = '';

        if ($this->primaryKey->isComposite()) {
            $output .= "\n" . $this->primaryKey->render($this);
        }

        return $output;
    }
124717
protected function renderProgressbar()
    {
        /** @var \Tx_Phpunit_ViewHelpers_ProgressBarViewHelper $progressBarViewHelper */
        $progressBarViewHelper = GeneralUtility::makeInstance(\Tx_Phpunit_ViewHelpers_ProgressBarViewHelper::class);
        $progressBarViewHelper->injectOutputService($this->outputService);
        $progressBarViewHelper->render();
    }
711548
public function render()
    {
        $output[] = $this->open();
        $output[] = $this->toggle;

        if ($this->toggleButton instanceof Button) {
            $output[] = $this->toggleButton;
        }

        $output[] = $this->menu;
        $output[] = $this->close();

        return implode(PHP_EOL, $output);
    }
1132015
public function render()
    {
        $vars = [
            'menu'  => $this,
            'items' => $this->get('root')->getChildren()
        ];

        $rendered = $this->viewFactory->make($this->view)->with($vars)->render();

        return $rendered;
    }
981757
public function render()
    {
        parent::render();
        $this->_aViewData["menustructure"] = $this->getNavigation()->getDomXml()->documentElement->childNodes;

        return "list_user.tpl";
    }
810083
public function render() {

		// check authentication

		if(!$this->authenticateMenu($this->menu)) {
			return '';
		}

		$request = Request::createFromGlobals();
		
		// if menu has not been prepared yet, do it now (caching avoids re-parsing for submenus)

		if(!in_array($this->menu, self::$primedMenus, true)) {

			// clear selected menu entries (which remain in the session)

			$this->clearSelectedMenuEntries($this->menu);

			// walk entire menu and add dynamic entries where necessary
			
			$this->completeMenu($this->menu);
			
			// prepare path segments to identify active menu entries

			$this->pathSegments = explode('/', trim($request->getPathInfo(), '/'));

			// skip script name

			if($this->rewriteActive && basename($request->getScriptName()) != 'index.php') {
				array_shift($this->pathSegments);
			}

			// skip locale if one found

			if(count($this->pathSegments) && Application::getInstance()->hasLocale($this->pathSegments[0])) {
				array_shift($this->pathSegments);
			}

			// walk tree until an active entry is reached

			$this->walkMenuTree($this->menu, (!count($this->pathSegments) || $this->pathSegments[0] === '') ? explode('/', $this->route->getPath()) : $this->pathSegments);

			// cache menu for multiple renderings

			self::$primedMenus[] = $this->menu;
		}

		$htmlId = $this->id . 'menu';

		// drill down to required submenu (if only submenu needs to be rendered)

		$m = $this->menu;

		if($this->level !== false) {

			$htmlId .= '_level_' . $this->level;

			if($this->level > 0) {

				while($this->level-- > 0) {
					$e = $this->menu->getSelectedEntry();
					if(!$e || !$e->getSubMenu()) {
						break;
					}
					$m = $e->getSubMenu();
				}

				if($this->level >= 0) {
					return '';
				}

			}
		}

		// output

		// instantiate renderer class, defaults to SimpleListRenderer

		if(!empty($this->decorator)) {
			$rendererName = $this->decorator;
		}
		else {
			$rendererName = 'SimpleList';
		}

		$className = __NAMESPACE__ . '\\Menu\\Renderer\\' . $rendererName . 'Renderer';

		$renderer = new $className($m);
		$renderer->setParameters($this->renderArgs);

		// enable or disable display of submenus

		$m->setShowSubmenus($this->level === false);

		// enable or disable always active menu

		$m->setForceActive(self::$forceActiveMenu);

		// if no container tag was specified, use a DIV element

		if(!isset($this->renderArgs['containerTag'])) {
			$this->renderArgs['containerTag'] = 'div';
		}

		// omit wrapper, if a falsy container tag was specified

		if($this->renderArgs['containerTag']) {
			return sprintf(
				'<%1$s%2$s>%3$s</%1$s>',
				$this->renderArgs['containerTag'],
				(isset($this->renderArgs['omitId']) && $this->renderArgs['omitId']) ? '' : (' id="' . $htmlId . '"'),
				$renderer->render()
			);
		}

		return $renderer->render();

	}
999769
public function renderAction()
    {
        $params     = $this->params();
        $navigation = $this->getServiceLocator()
                           ->get( 'Grid\Menu\Model\Menu\Model' )
                           ->findNavigation( $params->fromRoute( 'id' ) );

        $view = new ViewModel( array(
            'navigation' => $navigation,
            'class'      => $params->fromRoute( 'class' ),
        ) );

        return $view->setTerminal( true );
    }
300139
public static function printMenu($menuSlug = "primary", $customView = '', $ulClass = '')
    {
        $menuLinks = self::getMenuLinks($menuSlug);
        if($menuLinks) {
            return new HtmlString(
                view()->make(
                    ($customView ? $customView : "vendor.menulinks.bootstrap-4"), [
                    'menuLinks' => $menuLinks,
                    'ulClass' => $ulClass,
                    'menuSlug'=> $menuSlug

                    ]
                )->render()
            );
        }
    }