<!doctype html>
<html dir="{-:*_LD_-}">
<head>
<meta charset="utf-8" />
<title>{-:@MANAGE-}</title>
{-include:../meta-}
<script>
var GV = {
	_LD_ : '{-:*_LD_-}',
	LANG_NAME : '{-:*LANG_NAME-}',
	URL : {
		SORT_MENU : '{-url:admin@menu/_sort_menu_do?timeKey={$_TK['timeKey']}&token={$_TK['token']}-}'
	}
};
</script>
</head>

<body>
<div class="container margin">

<form id="formSearch" action="" method="post">
<div class="alert">
	{-foreach:$_MSL,$ms-}
		<a class="btn{-if:$ms['ms_alias'] == ARequest::get('ms_alias')-} active{-:/if-}" href="{-url:admin@menu/list_menu?ms_alias={$ms['ms_alias']}-}">{-:$ms['ms_name']-} [{-:$ms['ms_alias']-}]</a>
	{-:/foreach-}
</div>
</form>

<form id="formList" action="" method="post">
<ul class="subnav subnav-tab">
	<li class="active"><a href="#">{-:@MENU_LIST-}</a></li>
</ul>
<div id="tabContent">
	{-if:empty($_ML)-}
		<div class="placeholder text-center margin">{-:@MENU_LIST_EMPTY_TIP-}</div>
	{-else:-}
		<div id="tree-menu" class="margin">
			<span class="btn btn-sm" data-tree-nestable-action="expand-all">{-:@EXPAND_ALL-}</span>
			<span class="btn btn-sm" data-tree-nestable-action="collapse-all">{-:@COLLAPSE_ALL-}</span>
		</div>
		<div class="tree">
			<ul class="tree-list">
			{-foreach:$_ML,$m-}
				<li class="tree-item" data-id="{-:$m['menu_id']-}" data-ms-alias="{-:$m['ms_alias']-}">
					<input name="menu_id[{-:$m['menu_id']-}]" type="checkbox" value="{-:$m['menu_id']-}" class="select_sub">
					<span class="tree-sortable-handle icon-bars"></span>
					<input type="text" name="m_name[{-:$m['menu_id']-}]" validate="/\S+/" value="{-:$m['m_name']-}" class="control-input input-inline input-sm" size="12" maxlength="32" placeholder="{-:@NAME-}" />
					<input type="text" name="m_alias[{-:$m['menu_id']-}]" value="{-:$m['m_alias']-}" class="control-input input-inline input-sm" size="12" maxlength="32" placeholder="{-:@ALIAS-}" />
					<input type="text" name="m_tip[{-:$m['menu_id']-}]" value="{-:$m['m_tip']-}" class="control-input input-inline input-sm" size="24" maxlength="96" placeholder="{-:@TIP-}" />
					<span class="badge{-if:1==$m['m_type']-} badge-success{-else:-} badge-info{-:/if-}" title="{-:$m['m_url']-}">{-if:1==$m['m_type']-}{-:@DIRECT-}{-else:-}{-:@COMPOSE-}{-:/if-}</span>
					{-if:!empty($m['m_target'])-}<span class="badge" title="{-:$m['m_target']-}">{-:$m['m_target']|strtoupper|substr~0,2-}</span>{-:/if-}
					<span class="text-muted text-sm">
						<a href="{-:$m['m_url']|get_url~false,$m['m_type']-}" target="_blank">{-:@VIEW-}</a>
						| <a href="{-url:admin@menu/edit_menu?menu_id={$m['menu_id']}-}">{-:@EDIT-}</a>
						| <a href="{-url:admin@menu/delete_menu_do?menu_id={$m['menu_id']}&ms_alias={$m['ms_alias']}&timeKey={$_TK['timeKey']}&token={$_TK['token']}-}" class="delete_confirm">{-:@DELETE-}</a>
					</span>
					{-if:isset($m['m_sub'])-}
					<ul class="tree-list">
					{-foreach:$m['m_sub'],$sm-}
						<li class="tree-item" data-id="{-:$sm['menu_id']-}" data-ms-alias="{-:$sm['ms_alias']-}">
							<input name="menu_id[{-:$sm['menu_id']-}]" type="checkbox" value="{-:$sm['menu_id']-}">
							<span class="tree-sortable-handle icon-bars"></span>
							<input type="text" name="m_name[{-:$sm['menu_id']-}]" validate="/\S+/" value="{-:$sm['m_name']-}" class="control-input input-inline input-sm" size="12" maxlength="32" placeholder="{-:@NAME-}" />
							<input type="text" name="m_alias[{-:$sm['menu_id']-}]" value="{-:$sm['m_alias']-}" class="control-input input-inline input-sm" size="12" maxlength="32" placeholder="{-:@ALIAS-}" />
							<input type="text" name="m_tip[{-:$sm['menu_id']-}]" value="{-:$sm['m_tip']-}" class="control-input input-inline input-sm" size="24" maxlength="96" placeholder="{-:@TIP-}" />
							<span class="badge{-if:1==$sm['m_type']-} badge-success{-else:-} badge-info{-:/if-}" title="{-:$sm['m_url']-}">{-if:1==$sm['m_type']-}{-:@DIRECT-}{-else:-}{-:@COMPOSE-}{-:/if-}</span>
							{-if:!empty($sm['m_target'])-}<span class="badge" title="{-:$sm['m_target']-}">{-:$sm['m_target']|strtoupper|substr~0,2-}</span>{-:/if-}
							<span class="text-muted text-sm">
								<a href="{-:$sm['m_url']|get_url~false,$sm['m_type']-}" target="_blank">{-:@VIEW-}</a>
								| <a href="{-url:admin@menu/edit_menu?menu_id={$sm['menu_id']}-}">{-:@EDIT-}</a>
								| <a href="{-url:admin@menu/delete_menu_do?menu_id={$sm['menu_id']}&ms_alias={$sm['ms_alias']}&timeKey={$_TK['timeKey']}&token={$_TK['token']}-}" class="delete_confirm">{-:@DELETE-}</a>
							</span>
						</li>
					{-:/foreach-}
					</ul>
					{-:/if-}
				</li>
			{-:/foreach-}
			</ul>
		</div>
	{-:/if-}
</div>
<div id="operation" class="margin">
	<input name="timeKey" type="hidden" value="{-:$_TK['timeKey']-}">
	<input name="token" type="hidden" value="{-:$_TK['token']-}">
	<input name="ms_alias" type="hidden" value="{-:%ms_alias-}">
	<label class="text-mi"><input type="checkbox" class="select_all" to="menu_id"> {-:@SELECT_ALL-}</label>
	<a class="btn" href="{-url:admin@menu/add_menu-}">{-:@ADD_MENU-}</a>
	<span class="btn submit" action="{-url:admin@menu/update_menu_do-}" to="#formList">{-:@UPDATE_SELECTED-}</span>
	<span class="btn submit" action="{-url:admin@menu/delete_menu_do-}" to="#formList">{-:@DELETE_SELECTED-}</span>
	<input class="btn" type="reset" value="{-:@RESET-}">
	<a class="btn" href="{-url:admin@menu_space/list_space-}">{-:@MENU_SPACE_LIST-}</a>
</div><!--/#operation-->
</form>

</div>
<script src="{-:*__RES__-}js/loga.js"></script>
<script src="{-:*__RES__-}js/jquery.js"></script>
<script src="{-:*__RES__-}fea/js/fea.min.js"></script>
<script src="{-:*__STYLE__-}js/common.js"></script>
<script src="{-:*__STYLE__-}js/admin.js"></script>
<script src="{-:*__STYLE__-}js/list_menu.js"></script>
</body>
</html>