{template "header.html"}
<div class="note note-danger">
    <p><a href="javascript:dr_update_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')"> <i class="fa fa-cog"></i> {dr_lang('缓存设置')} </a>
                </li>
                <li class="{if $page==1}active{/if}">
                    <a href="#tab_1" data-toggle="tab" onclick="$('#dr_page').val('1')"> <i class="fa fa-share-alt"></i> {dr_lang('站点首页静态')} </a>
                </li>
                <li class="{if $page==2}active{/if}">
                    <a href="#tab_2" data-toggle="tab" onclick="$('#dr_page').val('2')"> <i class="fa fa-th-large"></i> {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">
                                <input type="checkbox" name="data[SYS_CACHE]" value="1" {if $data['SYS_CACHE']}checked{/if} data-on-text="{dr_lang('开启')}" data-off-text="{dr_lang('关闭')}" data-on-color="success" data-off-color="danger" class="make-switch" data-size="small">
                                <span class="help-block">{dr_lang('推荐开启缓存功能，可以大大提高系统运行效率')}</span>
                            </div>
                        </div>

                        {loop $cache_var $value $name}
                        <div class="form-group">
                            <label class="col-md-2 control-label">{dr_lang($name)}</label>
                            <div class="col-md-9">
                                <div class="input-inline input-medium">
                                    <div class="input-group">
                                        <input type="text" name="data[SYS_CACHE_{$value}]" value="{intval($data['SYS_CACHE_'.$value])}" class="form-control">
                                        <span class="input-group-addon">
                                            <i class="fa fa-clock-o"></i>
                                        </span>
                                    </div>
                                </div>
                                <span class="help-inline"> {dr_lang('单位小时，0表示不缓存')} </span>
                            </div>
                        </div>
                        {/loop}
                        <div class="form-group">
                            <label class="col-md-2 control-label">{dr_lang('页面缓存')}</label>
                            <div class="col-md-9">
                                <div class="input-inline input-medium">
                                    <div class="input-group">
                                        <input type="text" name="data[SYS_CACHE_PAGE]" value="{intval($data['SYS_CACHE_PAGE'])}" class="form-control">
                                        <span class="input-group-addon">
                                            <i class="fa fa-clock-o"></i>
                                        </span>
                                    </div>
                                </div>
                                <span class="help-inline"> {dr_lang('单位小时，0表示不启用缓存，开启后前端显示页面将会进行缓存加载')} </span>
                            </div>
                        </div>



                    </div>
                </div>

                <div class="tab-pane  {if $page==1}active{/if}" id="tab_1">
                    <div class="form-body">
                        {loop $ci->site_info $sid $t}
                        <?php $m = \Phpcmf\Service::M('Site')->config($sid);$t = $m['config'];?>
                        <div class="form-group">
                            <label class="col-md-2 control-label">{dr_strcut($t['SITE_NAME'], 10)}</label>
                            <div class="col-md-9">
                                <input type="checkbox" name="site[{$sid}][SITE_INDEX_HTML]" value="1" {if $t['SITE_INDEX_HTML']}checked{/if} data-on-text="{dr_lang('开启')}" data-off-text="{dr_lang('关闭')}" data-on-color="success" data-off-color="danger" class="make-switch" data-size="small">
                                <span class="help-block">{dr_lang('开启之后首页将会自动生成静态文件')}</span>
                            </div>
                        </div>
                        {/loop}
                    </div>
                </div>

                <div class="tab-pane  {if $page==2}active{/if}" id="tab_2">
                    <div class="form-body">
                        {loop $module $t}
                        {if !$t.share}
                        <?php $setting = dr_string2array($t['setting']);?>
                        <div class="form-group">
                            <label class="col-md-2 control-label">{$t.name}</label>
                            <div class="col-md-9">
                                <input type="checkbox" name="module[{$t.id}][module_index_html]" value="1" {if $setting['module_index_html']}checked{/if} data-on-text="{dr_lang('开启')}" data-off-text="{dr_lang('关闭')}" data-on-color="success" data-off-color="danger" class="make-switch" data-size="small">
                                <span class="help-block">{dr_lang('开启之后当前模块的首页将会自动生成静态文件')}</span>
                            </div>
                        </div>
                        {/if}
                        {/loop}
                    </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 green"> <i class="fa fa-save"></i> {dr_lang('保存')}</button>
        </div>
    </div>
</form>
<script type="text/javascript">
    function dr_to_key() {
        $.get("{dr_url('api/syskey')}", function(data){
            $("#sys_key").val(data);
        });
    }
</script>
{template "footer.html"}