{template nheader.html}
<script type="text/javascript">
$(function() {
	$(".select-cat").click(function(){
		var action = $(this).attr("action");
		var childs = $(this).attr("childs");
		var catid = $(this).attr("catid");
		var catids= new Array(); //定义一数组
		catids = childs.split(","); //字符分割
		if (action == 'close') {
			$.cookie('dr_{SITE_ID}_{APP_DIR}_{$this->ci->router->class}_'+catid, null,{path:"/",expires: -1});
			$(this).attr("action", "open");
			$(this).html("[-]");
			for (i=0;i<catids.length ;i++ ) {   
				if (catids[i] != catid) {
					$(".dr_catid_"+catids[i]).show();
				}
			}
		} else {
			// 关闭状态存储cookie
			$.cookie('dr_{SITE_ID}_{APP_DIR}_{$this->ci->router->class}_'+catid, 1);
			$(this).attr("action", "close");
			$(this).html("[+]");
			for (i=0;i<catids.length ;i++ ) {   
				if (catids[i] != catid) {
					$(".dr_catid_"+catids[i]).hide();
				}
			}
		}
	});
	$(".select-cat").each(function(){
		var childs = $(this).attr("childs");
		var catid = $(this).attr("catid");
		var cache = $.cookie('dr_{SITE_ID}_{APP_DIR}_{$this->ci->router->class}_'+catid);
		if (cache) {
			$(this).attr("action", "close");
			$(this).html("[+]");
			var catids= new Array(); //定义一数组
			catids = childs.split(","); //字符分割
			for (i=0;i<catids.length ;i++ ) {   
				if (catids[i] != catid) {
					$(".dr_catid_"+catids[i]).hide();
				}
			}
		} 
	});
});
</script>
<div class="page-bar">
	<ul class="page-breadcrumb mylink">
		{$menu.link}

	</ul>
	<ul class="page-breadcrumb myname">
		{$menu.name}
	</ul>
	<div class="page-toolbar">
		<div class="btn-group pull-right">
			<button type="button" class="btn green btn-sm btn-outline dropdown-toggle" data-toggle="dropdown" aria-expanded="false" data-hover="dropdown"> {fc_lang('操作菜单')}
				<i class="fa fa-angle-down"></i>
			</button>
			<ul class="dropdown-menu pull-right" role="menu">
				{loop $menu.quick $t}
				<li>
					<a href="{$t.url}">{$t.icon} {$t.name}</a>
				</li>
				{/loop}
				<li class="divider"> </li>
				<li>
					<a href="javascript:window.location.reload();">
						<i class="icon-refresh"></i> {fc_lang('刷新页面')}</a>
				</li>
			</ul>
		</div>
	</div>
</div>
<h3 class="page-title">
	<small>{fc_lang('自定义页面方便快捷创建单一的网页')}</small>
</h3>

<form action="" method="post" name="myform" id="myform">
	<input name="action" id="action" type="hidden" value="order" />
	<div class="portlet mylistbody">
		<div class="portlet-body">
			<div class="table-scrollable">

				<table class="mytable table table-striped table-bordered table-hover table-checkable dataTable">

		<thead>
        <tr>
			<th width="20"></th>
			<th width="45" style="text-align: center">{fc_lang('排序')}</th>
			<th width="60">Id</th>
            <th>{fc_lang('名称')}</th>
            <th>{fc_lang('目录')}</th>
            <th width="77" style="text-align: center">{fc_lang('静态缓存')}</th>
            <th width="77" style="text-align: center">{fc_lang('是否显示')}</th>
			<th class="dr_option">{fc_lang('操作')}</th>
        </tr>
        </thead>
		<tbody>
		{$list}
		<tr class="mtable_bottom">
			<th align="right"><input id="dr_select" class="toggle md-check" type="checkbox" onClick="dr_selected()" /></th>
			<td colspan="7" align="left"> 
            {if $this->ci->is_auth('page/del')}
				<button type="button" class="btn red btn-sm" name="option" onClick="$('#action').val('del');dr_confirm_set_all('{fc_lang('您确定要这样操作吗？')}')"><i class="fa fa-trash"></i> {fc_lang('删除')}</button>&nbsp;{/if}
			{if $this->ci->is_auth('page/edit')}
				<button type="button" class="btn green btn-sm" name="option" onClick="$('#action').val('order');dr_confirm_set_all('{fc_lang('您确定要这样操作吗？')}')"><i class="fa fa-edit"></i> {fc_lang('排序')}</button>
				&nbsp;<div class="onShow">{fc_lang('排序按从小到大排列，最大支持99')}</div>{/if}
			</td>
		</tr>
		</tbody>
		</table>
		</div>
	</div>
</div>
</form>
{template nfooter.html}