{template "header.html"}
<div class="note note-danger">
    <p><a href="javascript:dr_update_cache('block', 'system');">{dr_lang('更改数据之后需要更新缓存之后才能生效')}</a></p>
</div>
<script type="application/javascript">
    $(function(){
        dr_set_value({intval($i)});
    });
    function dr_set_value(i) {
        $('#dr_row_value_0').hide();
        $('#dr_row_value_1').hide();
        $('#dr_row_value_2').hide();
        $('#dr_row_value_3').hide();
        $('#dr_row_value_4').hide();
        $('#dr_row_value_'+i).show();
    }
</script>
<form action="" class="form-horizontal" method="post" name="myform" id="myform">
    {$form}
    <div class="portlet bordered light myfbody">
        <div class="portlet-title">
            <div class="caption">
                <span class="caption-subject font-green-sharp">
                    {dr_lang('自定义资料')}
                </span>
            </div>
            <div class="actions">
                <div class="btn-group">
                    <a class="btn" href="{$reply_url}"> <i class="fa fa-mail-reply"></i> {dr_lang('返回')}</a>
                </div>
            </div>
        </div>
        <div class="portlet-body">
            <div class="form-body">

                {$myfield}
                <div class="form-group {if $id}dr_block_type_html{/if}">
                    <label class="col-md-2 control-label">{dr_lang('类别')}</label>
                    <div class="col-md-9">
                        <div class="mt-radio-inline">
                            {loop $type $ii $name}
                            <label class="mt-radio">
                                <input onclick="dr_set_value({$ii})" {if $ii==$i}checked{/if} name="type" type="radio" value="{$ii}"> {$name}
                                <span></span>
                            </label>
                            {/loop}
                        </div>
                    </div>
                </div>
                {$diyfield}

            </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()}', 'myform', '2000')" class="btn green"> <i class="fa fa-save"></i> {dr_lang('保存内容')}</button>
            <button type="button" onclick="dr_ajax_submit('{dr_now_url()}', 'myform', '2000', '{$post_url}')" class="btn blue"> <i class="fa fa-plus"></i> {dr_lang('保存再添加')}</button>
            <button type="button" onclick="dr_ajax_submit('{dr_now_url()}', 'myform', '2000', '{$reply_url}')" class="btn yellow"> <i class="fa fa-mail-reply-all"></i> {dr_lang('保存并返回')}</button>
        </div>
    </div>
</form>

{template "footer.html"}