<!-- #include file="../../themes/admin/~css.php" -->
<form style="width:600px;height:450px" action="<?=url(RPGM.'menunew/?ajax')?>" method="post" id="form" onsubmit="return yun_submit(this.id)">

<h3 class="title">新建菜单</h3>

<div class="in">
<?php $i=0; foreach($conf['sys_elangs'] as $k=>$v){?>
<div class="fieldwrapper">
	<label for="" class="styled"><?=$i<1?'菜单名称':''?><img style="width:20px;height:18px" src="<?=THEMEPATH?>img/flags/<?=$k?>.png" /></label>
	<div class="thefield">
    <input name="name[<?=$k?>]" type="text" value="" id="name_<?=$k?>" />
    </div>
</div>
<?php $i++;}?>
<?php $i=0; foreach($conf['sys_elangs'] as $k=>$v){?>
<div class="fieldwrapper">
	<label for="" class="styled"><?=$i<1?'菜单简介':''?><img style="width:20px;height:18px" src="<?=THEMEPATH?>img/flags/<?=$k?>.png" /></label>
	<div class="thefield">
      <textarea style="height:50px" name="doc[<?=$k?>]" id="doc_<?=$k?>"></textarea>
    </div>
</div>
<?php $i++;}?>
<div class="fieldwrapper">
	<label for="" class="styled">排序号</label>
	<div class="thefield">
   <input name="order" id="order" value="<?=$arg_0?>"  /> 
    </div>
</div>
<div class="fieldwrapper">
	<label for="" class="styled">属性</label>
	<div class="thefield">
    <select name="menumod" onchange="if(this.value=='home_'){$('#hhmo').hide();}else{$('#hhmo').show();};$('#menu').html(eval('menu_'+this.value));">
<option value="home_">网站首页</option>
<option value="fun_">系统功能</option>
<option value="link_">自定义链接</option>
<option value="page_">自定义页面</option>

<?=do_apply('menu_option','string')?>

</select>
    </div>
</div>
<?=do_apply('menu_option_val','string')?>
<div id="hhmo" style="display:none">
<div class="fieldwrapper">
	<label for="" class="styled">打开方式</label>
	<div class="thefield">
    <input name="blank" type="checkbox" value="1" /> 新窗口
    </div>
</div>
<div class="fieldwrapper">
	<label for="" class="styled">父级</label>
	<div class="thefield">
    <select name="pid">
<option value="0">无</option>
<?php 
 foreach($conf['sys_pmenus'] as $k=>$v){
    if($v['mod']=='home_') continue;
 ?>
        <option value="<?=$k?>"><?=htmlxlang($v['name'])?></option>
         <?php }?>
</select>
    </div>
</div> 
<div id="menu"></div> 
</div>

<div class="buttonsdiv" >
	<input value="提交" type="submit" class="button"> 
    <input value="重置" type="reset" class="button">
</div>

</div>
</form>

<script type="text/javascript">
	yun_onfocus("name_<?=LANG?>");
    var menu_home_='';
  var menu_link_='<div class="fieldwrapper"><label for="" class="styled">链接地址</label>	<div class="thefield"><input name="link_" value=""  /></div></div><div class="fieldwrapper"><label for="" class="styled">当前页判断</label><div class="thefield">模块id <input name="current_mod" value=""  /> + <input name="current_mid" type="checkbox" value="1" /> 菜单id </div></div>';
  var menu_fun_='<div class="fieldwrapper"><label for="" class="styled">页面功能</label><div class="thefield"><?php
  foreach($conf['sys_funs'] as $k=>$v){   
    echo '<input name="fun_" type="radio" value="'.$k.'" />',htmlspecialchars($v);
  } 
    ?></div></div><div class="fieldwrapper"><label for="" class="styled">指定模板</label><div class="thefield">content_<input value="" name="tplpf_c" /></div></div>';
  var menu_page_='<div class="fieldwrapper"><label for="" class="styled">页面标识</label><div class="thefield"><input name="page_" value=""  /></div></div><div class="fieldwrapper"><label for="" class="styled">内容页模板</label><div class="thefield">page_<input value="" name="tplpf_c" type="text"></div></div>';
 </script>
 
 
 
 
