
<%@ page import="com.icomsys.main_vm.common.code.MenuVo" %>
<%@ page import="com.google.gson.Gson" %>
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>

<style>
    header + article {
        z-index: 0;
    }
</style>

<article>
    <div class="lnb_menu_btn_area open">
        <a href="#" class="lnb_menu_menu">
            <p>메뉴닫기</p>
            <span></span>
            <span></span>
            <span></span>
            <span></span>
        </a>
    </div>
    <nav>
        <ul class="lnb">
            <c:choose>
            <c:when test="${empty list_menulist }">
            <li>Refresh</li>
        </ul>
        </c:when>
        <c:otherwise>
            <c:forEach var="result" items="${list_menulist}" varStatus="status">
                <c:choose>
                    <c:when test="${result.level eq '2'}">
                        <li>
                        <a href="#"><c:out value="${result.menuName}"/></a>
                        <ul class="depth<c:out value="${result.level}"/>">
                    </c:when>
                    <c:when test="${result.level eq '3'}">
                        <c:choose>
                            <c:when test="${result.level >= result.nextLevel}">
                                <li>
                                    <a href="${pageContext.request.contextPath}<c:out value="${result.url}" />"><span><c:out
                                            value="${result.menuName}"/></span></a>
                                </li>
                            </c:when>
                            <c:when test="${result.nextLevel eq '4'}">
                                <li>
                                <a href="#"><c:out value="${result.menuName}"/></a>
                                <ul class="depth<c:out value="${result.level}"/>">
                            </c:when>
                        </c:choose>
                        <c:if test="${result.nextLevel eq '2'}">
                            </ul>
                            </li>
                        </c:if>
                    </c:when>
                    <c:when test="${result.level eq '4'}">
                        <li>
                            <a href="${pageContext.request.contextPath}<c:out value="${result.url}" />"><span><c:out
                                    value="${result.menuName}"/></span></a>
                        </li>
                        <c:if test="${empty result.nextLevel or result.nextLevel eq '2'}">
                            </ul>
                            </li>
                            </ul>
                            </li>
                        </c:if>
                        <c:if test="${result.nextLevel eq '3'}">
                            </ul>
                            </li>
                        </c:if>
                    </c:when>
                </c:choose>
            </c:forEach>
        </c:otherwise>
        </c:choose>
        </ul>
    </nav>
</article>
