{include file="head.html"}
<div id="maincontent">
  <div class="wrap">
    <form action="__URL__/add" id="form" method="post">
      <div class="infobox">
        <h3>{lang='添加栏目'}</h3>
        <table class="form-table table_style">
          <tr>
            <td width="100">{lang='栏目类型'}：</td>
            <td><select name="mid" id="mid" >
              <?php if(!empty($model_list)) { foreach($model_list as $vo){ ?>
              <option value="{$vo['id']}"><?php echo module('common')->getlang($vo['name']) ?></option>
              <?php } } ?>
            </select>
            <select name="pid" id="pid" >
              <?php if($pid==0){ ?>
              <option value="0"  selected="selected">{lang='无（作为一级栏目）'}</option>
              <?php }?>
              <?php if(!empty($cat)) { foreach($cat as $vo){ ?>
              <?php if($vo['id']==$pid){ ?>
              <option value="{$vo['id']}" selected="selected">{$vo['cname']}</option>
              <?php }else{ ?>
              <option value="{$vo['id']}">{$vo['cname']}</option>
              <?php } ?>
              <?php } } ?>
            </select>
            </td>
          </tr>
          <tr>
          <td>{lang='栏目名称'}：</td>
          <td><input class="regular-text" type='text'  name="name" id="name" /></td>
        </tr>
        <tr>
          <td>{lang='栏目URL名'}：</td>
          <td><input name="pinyin" type='text' class="regular-text" id="pinyin" value="" maxlength="100" /></td>
        </tr>
          <tr>
            <td>{lang='分页条数'}：</td>
            <td><input name="size" type="text" class="regular-text" style="width:50px;" id="size" value="10" /> {lang='条'}
            <select name="type" id="type" >
              <option value="0">{lang='栏目页'}</option>
              <option value="1" selected="selected">{lang='列表页'}</option>
            </select>
            </td>
          </tr>
          <tr>
            <td width="100">{lang='栏目模板'}：</td>
            <td><input name="tpl_list" type='text' id="tpl_list" class="regular-text" value="list" style="width:160px" />
            <select id="classselect" onchange="$('#tpl_list').val($(this).val())">
              <option value="">{lang='选择栏目模板'}</option>
              <?php if(!empty($tpl_dir['files'])) foreach($tpl_dir['files'] as $vo){?>
              <option value="<?php echo current(explode('.', $vo)) ?>">{$vo}</option>
              <?php } ?>
            </select>
            </td>
          </tr>
          <tr>
            <td width="100">{lang='内容模板'}：</td>
            <td><input name="tpl_content" type='text' id="tpl_content" class="regular-text" value="content" style="width:160px" />
            <select id="classselect" onchange="$('#tpl_content').val($(this).val())">
              <option value="">{lang='选择内容模板'}</option>
              <?php if(!empty($tpl_dir['files'])) foreach($tpl_dir['files'] as $vo){?>
              <option value="<?php echo current(explode('.', $vo)) ?>">{$vo}</option>
              <?php } ?> 
            </select>
            </td>
          </tr>
        </table>
      </div>
      <div class="submit_body">
        <input name="psot_do" id="psot_do" type="hidden" value="yes" />      
        <button class="regular-button" type="button" onclick="post()">{lang='添加'}</button>
   </div>
    </form>
  </div>
</div>

</body></html>