Clickalicious\PhpMemAdmin\App::getMenuHtml PHP Method

getMenuHtml() public method

public getMenuHtml ( ) : string
return string
    public function getMenuHtml()
    {
        $html = '<ul class="nav navbar-nav">';
        $html .= '<li>&nbsp;</li>';
        $html .= $this->getHtmlNavigationEntry(self::ACTION_DASHBOARD, '&nbsp;&nbsp;Cluster', 'glyphicon glyphicon-cloud');
        $html .= $this->getHtmlNavigationEntry(self::ACTION_HOST_DETAILS, '&nbsp;&nbsp;Host', 'glyphicon glyphicon-stats');
        $html .= $this->getHtmlNavigationEntry(self::ACTION_DATA_MANAGEMENT, '&nbsp;&nbsp;Data', 'glyphicon glyphicon-tags');
        //$html .= $this->getHtmlNavigationEntry(self::ACTION_MEMORY_DETAILS,  '&nbsp;&nbsp;Memory',  'glyphicon glyphicon-tasks');
        $html .= '</ul><ul class="nav navbar-nav navbar-right">';
        // Check for additional controls required ...
        if ($this->getAction() !== 1 && ($this->getAction() === self::ACTION_HOST_DETAILS || $this->getAction() === self::ACTION_DATA_MANAGEMENT || $this->getAction() === self::ACTION_MEMORY_DETAILS)) {
            $activeHost = $this->getActiveHost();
            $hosts = $this->getHosts();
            $htmlHostDropdown = '';
            if (count($hosts) > 1) {
                foreach ($hosts as $host) {
                    $htmlHostDropdown .= '<li role="presentation"><a role="menuitem" tabindex="-1" href="' . $this->getLinkForAction($this->getAction(), array('host' => $host)) . '">' . $host . '</a></li>';
                }
                $html .= '<li>';
                $html .= '<div class="dropdown" style="margin-top: 8px;">
                    <button class="btn btn-default dropdown-toggle" type="button" id="dropdownMenu1" data-toggle="dropdown" aria-expanded="true">
                    ' . $activeHost . '
                    <span class="caret"></span>
                    </button>
                    <ul class="dropdown-menu" role="menu" aria-labelledby="dropdownMenu1">
                    ' . $htmlHostDropdown . '
                    </ul>
                    </div>';
                $html .= '</li>';
            } else {
                $html .= '<li><a href="#">' . $activeHost . '</a></li>';
            }
        }
        $html .= '<li>';
        $html .= '<p class="navbar-text pull-right">Signed in as <b>' . $this->getConfig()->username . '</b></p>';
        $html .= '</li>';
        $html .= '<li>';
        $html .= '<a href="' . $this->getUrl(array(self::ARGUMENT_ACTION => self::ACTION_LOGOUT), 'logout:logout@') . '"><span class="glyphicon glyphicon-log-out">&nbsp;</span>Logout</a></li>';
        $html .= '</li>';
        $html .= '</ul>';
        return $html;
    }