<!--{include file="<!--{$oetplpath}-->block_head.tpl"}-->
<!--{if $a == "run"}-->
<div class="oemarry_layout">
  <div class="oe_top_nav"><i></i>系统设置->前台自定义导航</div>
  <div class="oe_content">
	
    <div class="oe_tools_bar clearfix">
      <a class="icon-checkbox-unchecked" href="javascript:;" id="selAll" onclick="oemarrySelectAll(this, 'selall');">选择</a>
      <a class="icon-remove-2" onclick="oemarryDialogFormDel('myform');">删除</a>
      <span class="fr"><a class="icon-plus" href="<!--{$oefile}-->&c=<!--{$c}-->&a=add">添加</a></span>
    </div>
    
	<div class="oe_txtwrap">
	  <b>温馨提示：</b><br />
	  设置导航状态为关闭或者删除，前台将不显示自定义导航
	</div>

	<form id="myform" action="<!--{$oefile}-->&c=<!--{$c}-->&a=del" method="post">
    <table class="oe_table_list table_cs">
	  <tr>
	    <th width="8%">ID</th>
		<th width="13%">导航名称</th>
		<th width="28%">链接</th>
		<th width="6%">排序</th>
		<th width="8%">打开方式</th>
		<th width="6%">状态</th>
		<th width="13%">添加时间</th>
		<th>操作</th>
	  </tr>
	  <!--{if empty($indexmenu)}-->
	  <tr>
	    <td class="text_center" colspan="8">No data!</td>
	  </tr>
	  <!--{else}-->
	  <!--{foreach $indexmenu as $volist}-->
	  <tr>
	    <td class="text_center"><input type="checkbox" name="id[]" id="id[]" class="selall" value="<!--{$volist.menuid}-->" /><!--{$volist.menuid}--></td>
		<td><b><!--{$volist.menuname}--></b></td>
		<td><!--{$volist.url}--></td>
		<td class="text_center"><!--{$volist.orders}--></td>
		<td class="text_center">
		<!--{if $volist.target == '1'}-->
		本页
		<!--{else}-->
		新页面
		<!--{/if}-->
		</td>
		<td class="text_center">
		<!--{if $volist.flag=='0'}-->
			<input type="hidden" id="attr_flag<!--{$volist.menuid}-->" value="flagopen" />
			<img id="flag<!--{$volist.menuid}-->" src="<!--{$urlpath}-->tpl/static/images/img_close.gif" onClick="oemarryUpdateFlag('flag', '<!--{$volist.menuid}-->');" style="cursor:pointer;">
		<!--{else}-->
			<input type="hidden" id="attr_flag<!--{$volist.menuid}-->" value="flagclose" />
			<img id="flag<!--{$volist.menuid}-->" src="<!--{$urlpath}-->tpl/static/images/img_open.gif" onClick="oemarryUpdateFlag('flag', '<!--{$volist.menuid}-->');" style="cursor:pointer;">	
		<!--{/if}-->
		</td>
		<td><!--{$volist.addtime|date_format:"%Y-%m-%d %H:%M:%S"}--></td>
		<td>
		 <a href="<!--{$oefile}-->&c=<!--{$c}-->&a=add&parentid=<!--{$volist.menuid}-->" class="oe_ico_green">添加二级导航</a>
		 <a href="<!--{$oefile}-->&c=<!--{$c}-->&a=edit&id=<!--{$volist.menuid}-->" class="oe_ico_blue">编辑</a>
		 <a href="javascript:;" onclick="oemarryDialogUrlDel('<!--{$oefile}-->&c=<!--{$c}-->&a=del&id[]=<!--{$volist.menuid}-->');" class="oe_ico_red">删除</a>
		</td>
	  </tr>

	  <!--{if !empty($volist.childlist)}-->
	  <!--{foreach $volist.childlist as $val}-->
	  <tr>
	    <td class="text_center"><input type="checkbox" name="id[]" id="id[]" class="selall" value="<!--{$val.menuid}-->" /><font color="blue"><!--{$val.menuid}--></font></td>
		<td><font color="blue">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;|-- <!--{$val.menuname}--></font></td>
		<td><font color="blue"><!--{$val.url}--></font></td>
		<td class="text_center"><font color="blue"><!--{$val.orders}--></font></td>
		<td class="text_center">
		<font color="blue">
		<!--{if $val.target == '1'}-->
		本页
		<!--{else}-->
		新页面
		<!--{/if}-->
		</font>
		</td>
		<td class="text_center">
		<!--{if $val.flag=='0'}-->
			<input type="hidden" id="attr_flag<!--{$val.menuid}-->" value="flagopen" />
			<img id="flag<!--{$val.menuid}-->" src="<!--{$urlpath}-->tpl/static/images/img_close.gif" onClick="oemarryUpdateFlag('flag', '<!--{$val.menuid}-->');" style="cursor:pointer;">
		<!--{else}-->
			<input type="hidden" id="attr_flag<!--{$val.menuid}-->" value="flagclose" />
			<img id="flag<!--{$val.menuid}-->" src="<!--{$urlpath}-->tpl/static/images/img_open.gif" onClick="oemarryUpdateFlag('flag', '<!--{$val.menuid}-->');" style="cursor:pointer;">	
		<!--{/if}-->
		</td>
		<td>
		<font color="blue"><!--{$val.addtime|date_format:"%Y-%m-%d %H:%M:%S"}--></font>
		</td>
		<td>
		 <a href="<!--{$oefile}-->&c=<!--{$c}-->&a=edit&id=<!--{$val.menuid}-->" class="oe_ico_blue">编辑</a>
		 <a href="javascript:;" onclick="oemarryDialogUrlDel('<!--{$oefile}-->&c=<!--{$c}-->&a=del&id[]=<!--{$val.menuid}-->');" class="oe_ico_red">删除</a>
		</td>
	  </tr>
	  <!--{/foreach}-->
	  <!--{/if}-->

	  <!--{/foreach}-->
	  <!--{/if}-->
	</table>
	</form>

	<div class="oe_page_box">记录：<!--{$total}--></div>

  </div>
</div>
<!--{/if}-->

<!--{if $a == 'add'}-->
<div class="oemarry_layout">
  <div class="oe_top_nav">
	<i></i>系统设置->前台自定义导航->添加
	<span><a href="<!--{$oefile}-->&c=<!--{$c}-->">&lt;&lt;返回列表</a></span>
  </div>
  <div class="oe_content">
    <h6>添加前台自定义导航</h6>
	<form id="myform" action="<!--{$oefile}-->&c=<!--{$c}-->" method="post" />
	<input type="hidden" name="a" id="a" value="saveadd" />
    <table class="oe_table_wrap">
	  <tr>
	    <th width="15%">导航名称：<span class="f_red">*</span></th>
		<td width="85%">
		  <input type="text" name="menuname" id="menuname" class="input-b" />
		  <span class="oe_trap">（20个字以内）</span>
		</td>
	  </tr>
	  <tr>
		<th>导航位置：</th>
		<td>
		<!--{hook mod="rootindexmenu" type="select" name="parentid" text="=主导航=" value=$parentid}-->
		<span>（设置此导航的位于哪个主导航下面）</span>
		</td>
	  </tr>
	  <tr>
		<th>导航说明：</th>
		<td>
		<input type="text" name="text" id="text" class="input-b" />
		<span>（导航的说明会在鼠标移动到其上面时显示）</span>
		</td>
	  </tr>
	  <tr>
		<th>导航链接：</th>
		<td>
		<textarea name="url" id="url" style="width:70%;height:60px;"></textarea><br />
		<span>（设置导航的链接，可填写站内、站外的链接地址，可用{siteurl},{urlpath}标签）</span>
		</td>
	  </tr>
	  <tr>
		<th>导航打开方式：</th>
		<td>
		  <input type="radio" name="target" id="target" value="1" checked />在本窗口打开，
		  <input type="radio" name="target" id="target" value="2" />在新窗口打开
		</td>
	  </tr>
	  <tr>
		<th>排序：</th>
		<td><input type="text" name="orders" id="orders" class="input-s" value="<!--{$orders}-->" /></td>
	  </tr>
	  <tr>
		<th>状态：</th>
		<td>
		  <input type="radio" name="flag" id="flag" value="1" checked />启用，
		  <input type="radio" name="flag" id="flag" value="0" />关闭
		</td>
	  </tr>
	  <tr>
	    <td></td>
		<td>
		<input type="button" id="btn_save" class="button_2" value="添加保存" /> 
	    <span id="submit_tips" class="error"></span>
		</td>
	  </tr>
	</table>
	</form>
  </div>
</div>
<script type="text/javascript">
$(function(){

	$("#btn_save").bind("click", function(){
		if ($("#menuname").val().length == 0) {
			ToastShow("请填写导航名称", "menuname");
			return false;
		}
		$("#myform").submit();
	});

});
</script>

<!--{/if}-->


<!--{if $a == 'edit'}-->
<div class="oemarry_layout">
  <div class="oe_top_nav">
	<i></i>系统设置->前台自定义导航->编辑
	<span><a href="<!--{$oefile}-->&c=<!--{$c}-->&<!--{$comeurl}-->">&lt;&lt;返回列表</a></span>
  </div>
  <div class="oe_content">
    <h6>编辑前台自定义导航</h6>
	<form id="myform" action="<!--{$oefile}-->&c=<!--{$c}-->&<!--{$comeurl}-->" method="post" />
	<input type="hidden" name="a" id="a" value="saveedit" />
	<input type="hidden" name="id" id="id" value="<!--{$id}-->" />
    <table class="oe_table_wrap">
	  <tr>
	    <th width="15%">导航名称：<span class="f_red">*</span></th>
		<td width="85%">
		  <input type="text" name="menuname" id="menuname" class="input-b" value="<!--{$indexmenu.menuname}-->" />
		  <span class="oe_trap">（20个字以内）</span>
		</td>
	  </tr>
	  <tr>
		<th>导航位置：</th>
		<td>
		<!--{hook mod="rootindexmenu" type="select" name="parentid" text="=主导航=" value=$indexmenu.parentid}-->
		<span>（设置此导航的位于哪个主导航下面）</span>
		</td>
	  </tr>
	  <tr>
		<th>导航说明：</th>
		<td>
		<input type="text" name="text" id="text" class="input-b" value="<!--{$indexmenu.text}-->" />
		<span>（导航的说明会在鼠标移动到其上面时显示）</span>
		</td>
	  </tr>
	  <tr>
		<th>导航链接：</th>
		<td>
		<textarea name="url" id="url" style="width:70%;height:60px;"><!--{$indexmenu.url}--></textarea><br />
		<span>（设置导航的链接，可填写站内、站外的链接地址，可用{siteurl},{urlpath}标签）</span>
		</td>
	  </tr>
	  <tr>
		<th>导航打开方式：</th>
		<td>
		  <input type="radio" name="target" id="target" value="1"<!--{if $indexmenu.target == '1'}--> checked<!--{/if}--> />在本窗口打开，
		  <input type="radio" name="target" id="target" value="2"<!--{if $indexmenu.target == '2'}--> checked<!--{/if}--> />在新窗口打开
		</td>
	  </tr>
	  <tr>
		<th>排序：</th>
		<td><input type="text" name="orders" id="orders" class="input-s" value="<!--{$indexmenu.orders}-->" /></td>
	  </tr>
	  <tr>
		<th>状态：</th>
		<td>
		  <input type="radio" name="flag" id="flag" value="1"<!--{if $indexmenu.flag == '1'}--> checked<!--{/if}--> />启用，
		  <input type="radio" name="flag" id="flag" value="0"<!--{if $indexmenu.flag == '0'}--> checked<!--{/if}--> />关闭
		</td>
	  </tr>
	  <tr>
	    <td></td>
		<td>
		<input type="button" id="btn_save" class="button_2" value="编辑保存" /> 
	    <span id="submit_tips" class="error"></span>
		</td>
	  </tr>
	</table>
	</form>
  </div>
</div>
<script type="text/javascript">
$(function(){

	$("#btn_save").bind("click", function(){
		if ($("#menuname").val().length == 0) {
			ToastShow("请填写导航名称", "menuname");
			return false;
		}
		$("#myform").submit();
	});

});
</script>

<!--{/if}-->
</body>
</html>