<!-- Sidebar -->
<!--
    Sidebar Mini Mode - Display Helper classes

    Adding 'smini-hide' class to an element will make it invisible (opacity: 0) when the sidebar is in mini mode
    Adding 'smini-show' class to an element will make it visible (opacity: 1) when the sidebar is in mini mode
        If you would like to disable the transition animation, make sure to also add the 'no-transition' class to your element

    Adding 'smini-hidden' to an element will hide it when the sidebar is in mini mode
    Adding 'smini-visible' to an element will show it (display: inline-block) only when the sidebar is in mini mode
    Adding 'smini-visible-block' to an element will show it (display: block) only when the sidebar is in mini mode
-->
<nav id="sidebar" aria-label="Main Navigation">
    <!-- Side Header -->
    <div class="content-header bg-white-5">
        <!-- Logo -->
        <a class="font-w600 text-dual" href="<?php echo iPHP_SELF; ?>">
            <span class="smini-visible"><i class="fa fa-info-circle font-size-h4 text-light"></i></span>
            <img class="smini-hidden logo " src="./assets/logo.png">
        </a>
        <!-- END Logo -->

        <!-- Extra -->
        <div>
            <!-- Options -->
            <div class="dropdown d-inline-block ml-2">
                <a class="btn btn-sm btn-dual" id="sidebar-themes-dropdown" data-toggle="dropdown" aria-haspopup="true" aria-expanded="false" href="#">
                    <i class="si si-drop"></i>
                </a>
                <div class="dropdown-menu dropdown-menu-right font-size-sm smini-hide border-0" aria-labelledby="sidebar-themes-dropdown">
                    <!-- Color Themes -->
                    <!-- Layout API, functionality initialized in Template._uiHandleTheme() -->
                    <a class="dropdown-item d-flex align-items-center justify-content-between" data-toggle="theme" data-theme="default" href="#">
                        <span>默认</span>
                        <i class="fa fa-circle text-default"></i>
                    </a>
                    <a class="dropdown-item d-flex align-items-center justify-content-between" data-toggle="theme" data-theme="assets/css/themes/amethyst.min.css" href="#">
                        <span>紫色水晶</span>
                        <i class="fa fa-circle text-amethyst"></i>
                    </a>
                    <a class="dropdown-item d-flex align-items-center justify-content-between" data-toggle="theme" data-theme="assets/css/themes/city.min.css" href="#">
                        <span>城市晚霞</span>
                        <i class="fa fa-circle text-city"></i>
                    </a>
                    <a class="dropdown-item d-flex align-items-center justify-content-between" data-toggle="theme" data-theme="assets/css/themes/flat.min.css" href="#">
                        <span>绿色平原</span>
                        <i class="fa fa-circle text-flat"></i>
                    </a>
                    <a class="dropdown-item d-flex align-items-center justify-content-between" data-toggle="theme" data-theme="assets/css/themes/modern.min.css" href="#">
                        <span>现代青年</span>
                        <i class="fa fa-circle text-modern"></i>
                    </a>
                    <a class="dropdown-item d-flex align-items-center justify-content-between" data-toggle="theme" data-theme="assets/css/themes/smooth.min.css" href="#">
                        <span>粉色顺滑</span>
                        <i class="fa fa-circle text-smooth"></i>
                    </a>
                    <!-- END Color Themes -->

                    <div class="dropdown-divider"></div>

                    <!-- Sidebar Styles -->
                    <!-- Layout API, functionality initialized in Template._uiApiLayout() -->
                    <a class="dropdown-item" data-toggle="layout" data-action="sidebar_style_light" href="#">
                        <span>高亮侧栏</span>
                    </a>
                    <a class="dropdown-item" data-toggle="layout" data-action="sidebar_style_dark" href="#">
                        <span>暗黑侧栏</span>
                    </a>
                    <!-- Sidebar Styles -->

                    <div class="dropdown-divider"></div>

                    <!-- Header Styles -->
                    <!-- Layout API, functionality initialized in Template._uiApiLayout() -->
                    <a class="dropdown-item" data-toggle="layout" data-action="header_style_light" href="#">
                        <span>高亮顶栏</span>
                    </a>
                    <a class="dropdown-item" data-toggle="layout" data-action="header_style_dark" href="#">
                        <span>暗黑顶栏</span>
                    </a>
                    <!-- Header Styles -->
                </div>
            </div>
            <!-- END Options -->

            <!-- Close Sidebar, Visible only on mobile screens -->
            <!-- Layout API, functionality initialized in Template._uiApiLayout() -->
            <a class="d-lg-none btn btn-sm btn-dual ml-1" data-toggle="layout" data-action="sidebar_close" href="javascript:void(0)">
                <i class="fa fa-fw fa-times"></i>
            </a>
            <!-- END Close Sidebar -->
        </div>
        <!-- END Extra -->
    </div>
    <!-- END Side Header -->
    <!-- Sidebar Scrolling -->
    <div class="js-sidebar-scroll">
        <!-- Side Navigation -->
        <div class="content-side">
            <ul class="nav-main">
                <?php Menu::buildNav($_GET['menu']); ?>
                <li class="nav-main-heading"></li>
                <li class="nav-main-item open">
                    <a class="nav-main-link nav-main-link-submenu" data-toggle="submenu" aria-haspopup="true" aria-expanded="true" href="javascript:;">
                        <i class="nav-main-link-icon fa fa-link"></i><span class="nav-main-link-name">相关链接</span>
                    </a>
                    <ul class="nav-main-submenu">
                        <li class="nav-main-item open">
                            <a class="nav-main-link" href="<?php echo ADMINCP_URL; ?>=patch&do=check_release&force=1" target="iPHP_FRAME">
                                <i class="nav-main-link-icon fa fa-sync"></i><span class="nav-main-link-name">检查更新</span>
                            </a>
                        </li>
                        <li class="nav-main-item open">
                            <a class="nav-main-link" target="_blank" href="http://www.icmsdev.com">
                                <i class="nav-main-link-icon fa fa-star"></i><span class="nav-main-link-name">官方网站</span>
                            </a>
                        </li>
                        <li class="nav-main-item open">
                            <a class="nav-main-link" target="_blank" href="http://www.icmsdev.com/docs/">
                                <i class="nav-main-link-icon fa fa-question-circle"></i><span class="nav-main-link-name">帮助文档</span>
                            </a>
                        </li>
                        <li class="nav-main-item open">
                            <a class="nav-main-link" target="_blank" href="http://www.icmsdev.com/tech-group.html">
                                <i class="nav-main-link-icon fa fa-comments"></i><span class="nav-main-link-name">技术交流群</span>
                            </a>
                        </li>
                    </ul>
                </li>
            </ul>
        </div>
        <!-- END Side Navigation -->
    </div>
    <!-- END Sidebar Scrolling -->
</nav>
<script>
    var $navapp = '<?php echo Menu::$SET['nav.app'] ?: Admincp::$APP_NAME; ?>';
    var $navlink = '<?php echo Menu::$SET['nav.active'] ?: $navData[2]; ?>';
    $("li.nav-main-item", 'ul.nav-main').removeClass('open');
    if ($navlink != "javascript:;") {
        var a = $('a.nav-main-link[href="' + $navlink + '"]', 'ul.nav-main');
        a.addClass('active');
        navClass(a);
    }
    function navClass(a) {
        var p = a.parent().parent();
        if(p.hasClass('nav-main-submenu')){
            p.addClass('open');
            var root = p.attr('root');
            $("#Menu-" + root).addClass('open');
            navClass(p);
        }
    }
</script>
<!-- END Sidebar -->