{template "header.html"}

<script>
    function dr_update_category_cache() {
        var index = layer.load(2, {
            shade: [0.3,'#fff'], //0.1透明度的白色背景
            time: 10000000
        });
        $.ajax({type: "GET",dataType:"json", url: admin_file+"?s=module&c=api&m=update_category_cache&mid={APP_DIR}",
            success: function(json) {
                layer.close(index);
                dr_cmf_tips(json.code, json.msg);
            },
            error: function(HttpRequest, ajaxOptions, thrownError) {
                layer.closeAll('loading');
                dr_tips(0, "{dr_lang('更新失败，请检查错误日志')}");
            }
        });
    }
</script>

<div class="note note-danger">
    <p><a href="javascript:dr_update_category_cache();">{dr_lang('变更栏目属性之后，需要一键更新栏目配置信息')}</a></p>
</div>

<form action="" class="form-horizontal" method="post" name="myform" id="myform">
    {$form}
    <div class="portlet bordered light myfbody">
        <div class="portlet-title tabbable-line">
            <ul class="nav nav-tabs" style="float:left;">
                <li class="{if $page==0}active{/if}">
                    <a href="#tab_0" data-toggle="tab" onclick="$('#dr_page').val('0')"> {dr_lang('批量添加')} </a>
                </li>
            </ul>
        </div>
        <div class="portlet-body">
            <div class="tab-content">

                <div class="tab-pane {if $page==0}active{/if}" id="tab_0">
                    <div class="form-body">

                        <div class="form-group">
                            <label class="col-md-2 control-label">{dr_lang('所属栏目')}</label>
                            <div class="col-md-9">
                                <label>{$select}</label>
                            </div>
                        </div>
                        {if $module.share}
                        <div class="form-group r1">
                            <label class="col-md-2 control-label">{dr_lang('栏目类型')}</label>
                            <div class="col-md-9">
                                <div class="mt-radio-inline">
                                    <label class="mt-radio mt-radio-outline"><input type="radio" name="data[tid]" value="0" /> {dr_lang('单网页')} <span></span></label>
                                    <label class="mt-radio mt-radio-outline"><input type="radio" name="data[tid]" value="1" /> {dr_lang('内容模块')} <span></span></label>
                                </div>
                            </div>
                        </div>
                        <div class="form-group dr_tid_1">
                            <label class="col-md-2 control-label">{dr_lang('共享模块')}</label>
                            <div class="col-md-9">
                                <label>
                                    <select class="form-control" name="data[mid]">
                                        <option value=""> -- </option>
                                        {loop $module_share $t}
                                        {if $t.share}
                                        <option value="{$t.dirname}" > {dr_lang($t.name)} </option>
                                        {/if}
                                        {/loop}
                                    </select>
                                </label>
                            </div>
                        </div>
                        {/if}
                        <div class="form-group">
                            <label class="col-md-2 control-label">{dr_lang('批量录入')}</label>
                            <div class="col-md-9">

                                <textarea class="form-control " style="height:190px" name="data[list]"></textarea>
                                <span class="help-block">{dr_lang('格式: 栏目名称|栏目目录 [回车换行]，如果不填写栏目目录时，会自动用拼音代替')}</span>

                            </div>
                        </div>

                    </div>
                </div>
            </div>
        </div>
    </div>

    <div class="portlet-body form myfooter">
        <div class="form-actions text-center">
            <button type="button" onclick="dr_ajax_submit('{dr_now_url()}&page='+$('#dr_page').val(), 'myform', '2000')" class="btn blue"> <i class="fa fa-save"></i> {dr_lang('保存')}</button>
        </div>
    </div>
</form>

{template "footer.html"}