<%@page contentType="text/html;charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>

<script type="text/javascript" src="<c:url value='/resources/js/admin/menu.js' />"></script>
<!-- 메뉴 관리 -->
<div class="main-wrapper">
	<div class="title-bar">
    	<span class="title">메뉴관리</span>
    </div>
	<div id="wrapper">
	    <div class="col-md-3">
	    	<div class="left-content">
	    		<div class="form-group text-center">
			    	<div class="btn-group" role="group" aria-label="...">
					  <button type="button" class="btn btn-default btn-sm" id="btnCreateNode" title="메뉴추가">
					  	<span class="glyphicon glyphicon-plus">&nbsp;추가</span>
					  </button>
					  <button type="button" class="btn btn-default btn-sm" id="btnRemoveNode" title="메뉴삭제">
					  	<span class="glyphicon glyphicon-minus">&nbsp;삭제</span>
					  </button>
					  <button type="button" class="btn btn-default btn-sm" id="btnDeselectNode" title="선택해제">
					  	<span class="glyphicon glyphicon-remove">&nbsp;해제</span>
					  </button>
					</div>
				</div>
		    	<div id="menuTreeView">
		    	</div>
	    	</div>
	    </div>
	    <div class="col-md-9">
	    	<div class="right-content row">
	    		<div id="menuDetailEmpty" style="display: none">
					<div class="form-group col-md-12">
					 * 메뉴를 선택해주세요.
					</div>
				</div>
				<div id="menuDetail">
		    		<div class="form-group col-md-12 text-right">
				    	<div class="btn-group" role="group" aria-label="...">
						  <button type="button" class="btn btn-default btn-sm" id="btnSaveNode" title="저장">
						  	<span class="glyphicon glyphicon-ok">&nbsp;저장</span>
						  </button>
						  <button type="button" class="btn btn-default btn-sm" id="btnCacheInit" title="캐시초기화">
						  	<span class="glyphicon glyphicon-refresh">&nbsp;초기화</span>
						  </button>
						</div>
					</div>
					<div class="col-md-12">
						<div class="panel panel-default">
							<div class="panel-body">
								<div class="col-md-12">
									<div class="form-group content-box-title">
										<label>정보</label>
									</div>
								</div>
								<div class="form-group col-md-12">
									<div class="col-md-2 content-title text-right">
										<label class="">아이디</label>
									</div>
									<div class="col-md-4">
										<input type="text" class="form-control input-sm" id="txtId" placeholder="">
									</div>
									<div class="col-md-2 content-title text-right">
										<label>메뉴명</label>
									</div>
									<div class="col-md-4">
										<input type="text" class="form-control input-sm" id="txtMenu" placeholder="">
									</div>
								</div>
								<div class="form-group col-md-12">
									<div class="col-md-2 content-title text-right">
										<label>순서</label>
									</div>
									<div class="col-md-2 pdr0">
										<input type="number" class="form-control input-sm" id="txtOrder" placeholder="">
									</div>
									<div class="col-md-2 content-title text-right">
										<label>메뉴타입</label>
									</div>
									<div class="col-md-2 pdr0">
										<select class="form-control input-sm" id="sltMenuType">
											<option value="">선택</option>
					    					<option value="SIDE">사이드</option>
		                             		<option value="NAVI">네비게이션</option>
		                             		<option value="CONT">콘텐츠</option>
					    				</select>
									</div>
									<div class="col-md-2 content-title text-right">
										<label>화면표시여부</label>
									</div>
									<div class="col-md-2">
										<select class="form-control input-sm" id="sltDisplay">
											<option value="Y">예</option>
					    					<option value="N">아니오</option>
					    				</select>
									</div>
									<!-- <div class="col-md-2 radio-padding-box">
										<label class="radio-inline">
										  <input type="radio" name="displayYN" id="radioDisplayY" value="Y"> 예
										</label>
										<label class="radio-inline">
										  <input type="radio" name="displayYN" id="radioDisplayN" value="N"> 아니오
										</label>
									</div> -->
								</div>
								<!-- <div class="form-group col-md-12">
									<div class="col-md-2 content-title text-right">
										<label>화면표시여부</label>
									</div>
									<div class="col-md-2 radio-padding-box">
										<label class="radio-inline">
										  <input type="radio" name="displayYN" id="radioDisplayY" value="Y"> 예
										</label>
										<label class="radio-inline">
										  <input type="radio" name="displayYN" id="radioDisplayN" value="N"> 아니오
										</label>
									</div>
									<div class="col-md-8 pd0">
										<div class="col-md-3 content-title text-right">
											<label>인증여부</label>
										</div>
										<div class="col-md-3 radio-padding-box">
											<label class="radio-inline">
											  <input type="radio" name="certifyYN" id="certifyY" value="Y"> 예
											</label>
											<label class="radio-inline">
											  <input type="radio" name="certifyYN" id="certifyN" value="N"> 아니오
											</label>
										</div>
										<div class="col-md-3 content-title text-right">
											<label>인증 후 표시여부</label>
										</div>
										<div class="col-md-3 radio-padding-box">
											<label class="radio-inline">
											  <input type="radio" name="certifyDisplayYN" id="certifyDisplayY" value="Y"> 예
											</label>
											<label class="radio-inline">
											  <input type="radio" name="certifyDisplayYN" id="certifyDisplayN" value="N"> 아니오
											</label>
										</div>
									</div>								
									
									<div class="col-md-2 content-title text-right">
										<label>통계여부</label>
									</div>
									<div class="col-md-4">
										<label class="radio-inline">
										  <input type="radio" name="statsYN" id="radioStatsY" value="Y"> 예
										</label>
										<label class="radio-inline">
										  <input type="radio" name="statsYN" id="radioStatsN" value="N"> 아니오
										</label>
									</div>
								</div> -->
								<!-- <div class="form-group col-md-12">
									<div class="col-md-2 content-title text-right">
										<label>인증여부</label>
									</div>
									<div class="col-md-4">
										<label class="radio-inline">
										  <input type="radio" name="certifyYN" id="certifyY" value="Y"> 예
										</label>
										<label class="radio-inline">
										  <input type="radio" name="certifyYN" id="certifyN" value="N"> 아니오
										</label>
									</div>
									<div class="col-md-2 content-title text-right">
										<label>인증 후 표시여부</label>
									</div>
									<div class="col-md-4">
										<label class="radio-inline">
										  <input type="radio" name="certifyDisplayYN" id="certifyDisplayY" value="Y"> 예
										</label>
										<label class="radio-inline">
										  <input type="radio" name="certifyDisplayYN" id="certifyDisplayN" value="N"> 아니오
										</label>
									</div>
								</div> -->
								<div class="form-group col-md-12">
									<div class="col-md-2 content-title text-right">
										<label>페이지 URL</label>
									</div>
									<div class="col-md-10">
										<input type="text" class="form-control input-sm" id="txtPageUrl" placeholder="">
									</div>
								</div>
								<div class="form-group col-md-12">
									<div class="col-md-2 content-title text-right">
										<label>이미지 URL</label>
									</div>
									<div class="col-md-10">
										<input type="text" class="form-control input-sm" id="txtImageUrl" placeholder="">
									</div>
								</div>
								<div class="form-group col-md-12">
									<div class="col-md-2 content-title text-right">
										<label>설명<br/>(<span id="descLength">0</span>/500bytes)</label>
									</div>
									<div class="col-md-10">
										<textarea class="form-control input-sm" id="txtMenuDesc" rows="3"></textarea>
									</div>
								</div>		
							</div>
						</div>
					</div>
					<div class="col-md-12">
						<div class="panel panel-default">
							<div class="panel-body">
								<div class="col-md-12">
									<div class="form-group content-box-title">
										<label>다국어 (메뉴명보다 우선적용됩니다.)</label>
									</div>
									<div class="form-group col-md-12 pd0">
										<div class="col-md-2 content-title text-right">
											<label></label>
										</div>
										<div class="col-md-10">
											<div class="text-right">
												<button type="button" class="btn btn-default btn-sm" id="btnCreateI18n" title="편집">
													<span class="glyphicon glyphicon-edit">&nbsp;편집</span>
												</button>
											</div>
						    				<div id="container_i18n">
												<table class="table table-bordered table-hover">
							    					<thead>
							    						<tr>
							    							<td class="table-header">다국어 코드</td>
							    							<td class="table-header">다국어 텍스트</td>
							    						</tr>
							    					</thead>
							    					<tbody id="table_i18n_view">
							    					</tbody>
							    				</table>
											</div>	
										</div>
									</div>
								</div>
							</div>
						</div>
					</div>
					<div class="col-md-12">
						<div class="panel panel-default">
							<div class="panel-body">
								<div class="col-md-12">
									<div class="form-group content-box-title">
										<label>파라미터</label>
									</div>
									<div class="form-group col-md-12 pd0">
										<div class="col-md-2 content-title text-right">
											<label></label>
										</div>
										<div class="col-md-10">
											<div class="text-right">
												<button type="button" class="btn btn-default btn-sm" id="btnCreateParam" title="편집">
													<span class="glyphicon glyphicon-edit">&nbsp;편집</span>
												</button>
											</div>
						    				<table class="table table-bordered table-hover">
						    					<thead>
						    						<tr>
						    							<td class="table-header">no</td>
						    							<td class="table-header">이름</td>
						    							<td class="table-header">타입</td>
						    							<td class="table-header">파라미터값</td>
						    							<td class="table-header">설명</td>
						    						</tr>
						    					</thead>
						    					<tbody id="table_param_view">
						    					</tbody>
						    				</table>
										</div>
									</div>
								</div>
							</div>
						</div>
					</div>
					<div class="col-md-12">
						<div class="panel panel-default">
							<div class="panel-body">
								<div class="col-md-12">
									<div class="form-group content-box-title">
										<label>권한</label>
									</div>
									<div class="form-group col-md-12 pd0">
										<div class="col-md-2 content-title text-right">
											<label></label>
										</div>
										<div class="col-md-10">
											<div class="text-right">
												<button type="button" class="btn btn-default btn-sm" id="btnCreateAuth" title="편집">
													<span class="glyphicon glyphicon-edit">&nbsp;편집</span>
												</button>
											</div>
						    				<table class="table table-bordered table-hover">
						    					<thead>
						    						<tr>
						    							<td class="table-header">권한이름</td>
						    						</tr>
						    					</thead>
						    					<tbody id="table_auth_view">
						    					</tbody>
						    				</table>
										</div>
									</div>
								</div>
							</div>
						</div>
					</div>
				</div>
	    	</div>
	    </div>
	</div>
</div>

<!-- Modal -->
<div class="modal fade" id="addItemModal_i18n" tabindex="-1" role="dialog">
  <div class="modal-dialog" role="document" style="width: 800px">
    <div class="modal-content">
      <div class="modal-header">
      	⊙ 다국어 정보
      </div>
      <div class="modal-body">
      		<div class="row">
	      		<div class="col-md-5 content-table">
		      		<table class="table table-bordered table-hover table-row-click">
						<thead>
							<tr>
								<td class="table-header">다국어 코드</td>
								<td class="table-header">다국어 텍스트</td>
								<td class="table-header">
									<button type="button" class="btn btn-primary btn-xs" id="btnNewItem_i18n">
										<span class="glyphicon glyphicon-plus">&nbsp;추가</span>
									</button>
								</td>
							</tr>
						</thead>
						<tbody id="table_i18n">
						</tbody>
					</table>
				</div>
				<div class="col-md-7">
					<div class="col-md-12 pd0">
						<div class="panel panel-default">
							<div class="panel-body">
								<div class="col-md-12" id="modalI18nDetailEmpty">
									<div class="form-group col-md-12 pd0">
										<div class="col-md-12 pd0">
											* 다국어 정보를 선택해주세요.
										</div>
									</div>
								</div>
								<div id="modalI18nDetail">
									<div class="col-md-12">
										<div class="row content-box-title">
											<div class="col-md-12 detail-content-title">
												<label>정보</label>
											</div>
										</div>
										<div class="form-group col-md-12 pd0">
											<div class="col-md-3 content-title pd0">
												<label>다국어코드</label>
											</div>
											<div class="col-md-9 pd0">
												<select class="form-control input-sm" id="sltI18n">
													<c:forEach var="item" items="${supportedLanguages}">
											            <option value="${item}">${item}</option>
											        </c:forEach>
												</select>
											</div>
										</div>
										<div class="form-group col-md-12 pd0">
											<div class="col-md-3 content-title pd0">
												<label>다국어 텍스트</label>
											</div>
											<div class="col-md-9 pd0">
												<input type="text" class="form-control input-sm" id="txtI18n" placeholder="">
											</div>
										</div>
										<div class="form-group col-md-12 pd0">
											<div class="col-md-12 pd0 text-center">
												<button type="button" class="btn btn-default btn-sm" id="saveItem_i18n">
													<span class="glyphicon glyphicon-ok">&nbsp;저장</span>
												</button>
											</div>
										</div>
									</div>
								</div>
							</div>
						</div>
					</div>
				</div>
			</div>
      </div>
      <div class="modal-footer text-center">
        <button type="button" class="btn btn-default btn-sm" id="btnConfirmItem_i18n">
        	<span class="glyphicon glyphicon-ok-circle">&nbsp;적용</span>     
        </button>
        <button type="button" class="btn btn-default btn-sm" data-dismiss="modal">
        	<span class="glyphicon glyphicon-remove-circle">&nbsp;취소</span>    
        </button>
      </div>
    </div>
  </div>
</div>

<!-- Modal -->
<div class="modal fade" id="addItemModal_param" tabindex="-1" role="dialog">
  <div class="modal-dialog" role="document" style="width: 800px;">
    <div class="modal-content">
      <div class="modal-header">
      	⊙ 파라미터 정보
      </div>
      <div class="modal-body" id="modalBody_param">
      	<div class="row">
   			<div class="col-md-5 content-table">
   				<table class="table table-bordered table-hover table-row-click">
					<thead>
						<tr>
							<td class="table-header">이름</td>
							<!-- <td class="table-header">타입</td> -->
							<td class="table-header">파라미터값</td>
							<!-- <td class="table-header">설명</td> -->
							<td class="table-header">
								<button type="button" class="btn btn-primary btn-xs" id="btnNewItem_param">
									<span class="glyphicon glyphicon-plus">&nbsp;추가</span>
								</button>
							</td>
						</tr>
					</thead>
					<tbody id="table_param">
					</tbody>
				</table>  			
     		</div>
      		<div class="col-md-7">
      			<div class="col-md-12 pd0">
					<div class="panel panel-default">
						<div class="panel-body">
							<div class="col-md-12" id="modalParamDetailEmpty">
								<div class="form-group col-md-12 pd0">
									<div class="col-md-12 pd0">
										* 파라미터 정보를 선택해주세요.
									</div>
								</div>
							</div>
							<div id="modalParamDetail">
								<div class="col-md-12">
									<div class="row content-box-title">
										<div class="col-md-12 detail-content-title">
											<label>정보</label>
										</div>
									</div>
									<div class="form-group col-md-12 pd0">
										<div class="col-md-3 content-title">
											<label>이름</label>
										</div>
										<div class="col-md-9 pd0">
											<input type="text" class="form-control input-sm" id="txtParamName" placeholder="">
										</div>
									</div>
									<div class="form-group col-md-12 pd0">
										<div class="col-md-3 content-title">
											<label>타입</label>
										</div>
										<div class="col-md-9 pd0">
											<select class="form-control input-sm" id="sltParamType">
												<c:forEach var="item" items="${reqParamTypes}">
										            <option value="${item}">${item}</option>
										        </c:forEach>
											</select>
										</div>
									</div>
									<div class="form-group col-md-12 pd0">
										<div class="col-md-3 content-title">
											<label>파라미터값</label>
										</div>
										<div class="col-md-9 pd0">
											<input type="text" class="form-control input-sm" id="txtParamValue" placeholder="">
										</div>
									</div>
									<div class="form-group col-md-12 pd0">
										<div class="col-md-3 content-title">
											<label>설명</label>
										</div>
										<div class="col-md-9 pd0">
											<textarea class="form-control input-sm" rows="5" id="txtParamDesc"></textarea>
										</div>
									</div>
									<div class="form-group col-md-12 pd0">
										<div class="col-md-12 pd0 text-center">
											<button type="button" class="btn btn-default btn-sm" id="saveItem_param">
												<span class="glyphicon glyphicon-ok">&nbsp;저장</span>
											</button>
										</div>
									</div>
								</div>
							</div>
						</div>
					</div>
				</div>		
      		</div>
      	</div>
      </div>
      <div class="modal-footer text-center">
        <button type="button" class="btn btn-default btn-sm" id="btnConfirmItem_param">
        	<span class="glyphicon glyphicon-ok-circle">&nbsp;적용</span>
        </button>
        <button type="button" class="btn btn-default btn-sm" data-dismiss="modal">
        	<span class="glyphicon glyphicon-remove-circle">&nbsp;취소</span>
        </button>
      </div>
    </div>
  </div>
</div>

<!-- Modal -->
<div class="modal fade" id="addItemModal_auth" tabindex="-1" role="dialog">
  <div class="modal-dialog" role="document" style="width: 800px">
    <div class="modal-content">
      <div class="modal-header">
      	⊙ 권한 정보
      </div>
      <div class="modal-body" id="modalBody_auth">
      	<div class="row">
   			<div class="col-md-5 content-table">
   				<table class="table table-bordered table-hover table-row-click">
					<thead>
						<tr>
							<td class="table-header">권한이름</td>
							<td class="table-header">
								<button type="button" class="btn btn-primary btn-xs" id="btnNewItem_auth">
									<span class="glyphicon glyphicon-plus">&nbsp;추가</span>
								</button>
							</td>
						</tr>
					</thead>
					<tbody id="table_auth">
					</tbody>
				</table>
   			</div>
   			<div class="col-md-7">
   				<div class="col-md-12 pd0">
					<div class="panel panel-default">
						<div class="panel-body">
							<div class="col-md-12" id="modalAuthDetailEmpty">
								<div class="form-group col-md-12 pd0">
									<div class="col-md-12 pd0">
										* 권한 정보를 선택해주세요.
									</div>
								</div>
							</div>
							<div class="col-md-12" id="modalAuthDetail">
								<div class="row content-box-title">
									<div class="col-md-12 detail-content-title">
										<label>정보</label>
									</div>
								</div>
								<div class="form-group col-md-12 pd0">
									<div class="col-md-3 content-title">
										<label>이름</label>
									</div>
									<div class="col-md-9 pd0">
										<select class="form-control input-sm" id="sltAuth">
											<option value="">선택</option>
								        </select>
									</div>
								</div>
								<div class="form-group col-md-12 pd0">
									<div class="col-md-12 pd0 text-center">
										<button type="button" class="btn btn-default btn-sm" id="saveItem_auth">
											<span class="glyphicon glyphicon-ok">&nbsp;저장</span>
										</button>
									</div>
								</div>
							</div>
						</div>
					</div>
				</div>
   			</div>
      	</div>
      </div>
      <div class="modal-footer text-center">
        <button type="button" class="btn btn-primary" id="btnConfirmItem_auth">
        	<span class="glyphicon glyphicon-ok-circle">&nbsp;적용</span>     
        </button>
        <button type="button" class="btn btn-default" data-dismiss="modal">
        	<span class="glyphicon glyphicon-remove-circle">&nbsp;취소</span>
        </button>
      </div>
    </div>
  </div>
</div>


<script type="text/javascript">
$(document).ready(function() { 
    var menu = new mplus_admin_menu( "${defaultLanguage}" );
    menu.init();
});
</script>
