{include "header.inc.html"}
<div class="content_box">
  <div class="crumbs none"> <span class="png_bg">当前位置：<a href="list.html" class="png_bg">系统设置</a><font>工作日设置</font></span> </div>
  <div class="toolbar_box">
    <div class="toolbar"> <span> <strong>导航设置</strong><br />
      <span class="english">Navigation set</span> </span> </div>
  </div>
  {if $smarty.get.act=="add" || $smarty.get.act=="edit"}
<form class="form" action="" method="post" id="fm-form"><input type="hidden" name="inajax" value="1" /><input type="hidden" name="act" value="{$smarty.get.act}" />
	{if $smarty.get.id}<input type="hidden" name="id" value="{$smarty.get.id}" />{/if}
		<ul class="from_box">
		<li> <span class="left">链接名称：</span> <span class="inputs">
		<input name="name" type="text" size="50" value="{$navInfo.name}" />
		</span> </li>
		<li> <span class="left">链接地址：</span> <span class="inputs">
		<input name="url" type="text" size="50" value="{$navInfo.url}" />
		</span> </li>
		<li> <span class="left">CSS样式类名：</span> <span class="inputs">
		<input name="class" type="text" size="50" value="{$navInfo.class}" />
		</span> </li>
		<li> <span class="left">打开方式：</span> <span class="inputs"><select name="target"><option value="">当前页面</option><option value="_blank"{if $navInfo.target=="_blank"} selected{/if}>新开页面</option></select></span></li>
		<li> <span class="left">导航位置：</span> <span class="inputs"><select name="positionId"><option value="1">导航菜单</option><option value="2"{if $navInfo.positionId=="2"} selected{/if}>底部导航</option></select></span></li>
		<li> <span class="left">排序：</span> <span class="inputs">
		<input name="sortId" type="text" size="10" value="{$navInfo.sortId}" />
		</span> </li>
		</ul>
		<div class="correct_btn_box"><input type="submit" class="btn_sub" value="提交" /></div>
	</form>
  {else}
  <table class="table-ca table-list">
    <tr>
      <th>ID</th>
      <th>链接文字</th>
      <th>链接地址</th>
      <th>CSS样式类名</th>
      <th>打开方式</th>
      <th>排序</th>
      <th>添加时间</th>
      <th class="no_border">操作</th>
    </tr>
	{nav limit="false"}
    <tr>
      <td>{$item.id}</td>
      <td>{$item.name}</td>
      <td>{$item.url}</td>
      <td>{$item.class}</td>
      <td>{if $item.target=="_blank"}新页面{else}当前页面{/if}</td>
      <td>{$item.sortId}</td>
      <td>{$item.posttime|date_format:"Y-m-d H:i:s"}</td>
      <td class="no_border"><a href="javascript:void(0)" title="删除" class="delBtn"></a><a href="{$item.url}" target="_blank" title="点击打开"><img src="{$baseUrl}admin/images/zoom_icon.gif" width="15" height="15" alt="详细" class="margin_05" /></a><a href="{$baseUrl}{$adminPath}nav/act/edit/id/{$item.id}" title="修改"><img src="{$baseUrl}admin/images/modify_icon.gif" width="16" height="16" alt="修改" class="margin_05" /></a></td>
    </tr>
	{/nav}
  </table>
  {/if}
</div>
<!--[if !IE]>end system content<![endif]-->
<script type="text/javascript">
$(function(){
	$(".delBtn").click(function(){
		if(!confirm("确认删除？")){ return false; }
		var tr = $(this).parent("td").parent("tr");
		var id = tr.find("td").eq(0).text();
		if(id){ $.ajax({ type:"POST",data:"inajax=1&act=del&id="+id,cache:false,dataType:"json",success:function(data){ if(data.success){ tr.remove(); }else{ alert("删除失败："+data.message); } } }); }
	});
$(function(){
	$("#fm-form").ajaxForm({ dataType:'json',success:function(json){ COL.dialog.mini({ type:(json.success?'success':'error'),content:json.message }); },error:function(){ alert('系统错误，请联系技术人员'); } })
});
});
</script>
{include "footer.inc.html"}