{template "header.html"}
<div class="note note-danger">
    <p><a href="javascript:dr_update_cache('member', '');">{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==4}active{/if}">
                    <a href="#tab_4" data-toggle="tab" onclick="$('#dr_page').val('4')"> <i class="fa fa-user"></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-user-plus"></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-qq"></i> {dr_lang('快捷登录')} </a>
                </li>
                <li class="{if $page==3}active{/if}">
                    <a href="#tab_3" data-toggle="tab" onclick="$('#dr_page').val('3')"> <i class="fa fa-code"></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[config][edit_mobile]" value="1" {if $data['config']['edit_mobile']}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">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-md-2 control-label">{dr_lang('允许多个用户组')}</label>
                            <div class="col-md-9">
                                <input type="checkbox" name="data[config][groups]" value="1" {if $data['config']['groups']}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>
                        <div class="form-group">
                            <label class="col-md-2 control-label">{dr_lang('登录超时时间')}</label>
                            <div class="col-md-9">
                                <label><input class="form-control" type="text" name="data[config][logintime]" value="{$data['config']['logintime']}" ></label>
                                <span class="help-block">{dr_lang('单位秒，默认为86400秒，超时之后自动退出账号')}</span>
                            </div>
                        </div>
                        <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:150px; width:100%;" name="data[config][verify_msg]">{$data['config']['verify_msg']}</textarea>
                                <span class="help-block">{dr_lang('申请用户组时常用的拒绝审核理由，一行一个')}</span>
                            </div>
                        </div>
                    </div>
                </div>

                <div class="tab-pane {if $page==4}active{/if}" id="tab_4">
                    <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[login][code]" value="1" {if $data['login']['code']}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">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-md-2 control-label">{dr_lang('登录主字段')}</label>
                            <div class="col-md-9">
                                <div class="mt-checkbox-inline">
                                    <label class="mt-checkbox mt-checkbox-outline"><input type="checkbox" checked disabled /> {dr_lang('账号')} <span></span></label>
                                    <label class="mt-checkbox mt-checkbox-outline"><input type="checkbox" name="data[login][field][]" value="phone" {if @in_array('phone', (array)$data.login.field)} checked{/if} /> {dr_lang('手机号')} <span></span></label>
                                    <label class="mt-checkbox mt-checkbox-outline"><input type="checkbox" name="data[login][field][]" value="email" {if @in_array('email', (array)$data.login.field)} checked{/if} /> {dr_lang('邮箱')} <span></span></label>
                                </div>
                                <span class="help-block">{dr_lang('可同时选择多个字段作为登录主字段')}</span>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-md-2 control-label">{dr_lang('短信验证码登录')}</label>
                            <div class="col-md-9">
                                <input type="checkbox" name="data[login][sms]" value="1" {if $data['login']['sms']}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"><a href="javascript:dr_help(501);">{dr_lang('登录字段必须包含手机号码才能使用此功能')}</a></span>
                            </div>
                        </div>

                    </div>
                </div>

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

                        <div class="form-group">
                            <label class="col-md-2 control-label">{dr_lang('电脑列表分页数量')}</label>
                            <div class="col-md-9">
                                <label><input class="form-control" type="text" name="data[config][pagesize]" value="{$data['config']['pagesize']}" ></label>
                                <span class="help-block">{dr_lang('用户中心数据列表在电脑网页每页显示数量')}</span>
                            </div>
                        </div>


                        <div class="form-group">
                            <label class="col-md-2 control-label">{dr_lang('手机列表分页数量')}</label>
                            <div class="col-md-9">
                                <label><input class="form-control" type="text" name="data[config][pagesize_mobile]" value="{$data['config']['pagesize_mobile']}" ></label>
                                <span class="help-block">{dr_lang('用户中心数据列表在手机网页每页显示数量')}</span>
                            </div>
                        </div>


                        <div class="form-group">
                            <label class="col-md-2 control-label">{dr_lang('API接口列表分页数量')}</label>
                            <div class="col-md-9">
                                <label><input class="form-control" type="text" name="data[config][pagesize_api]" value="{$data['config']['pagesize_api']}" ></label>
                                <span class="help-block">{dr_lang('用户中心数据列表在API数据请求时每页返回的数量')}</span>
                            </div>
                        </div>

                    </div>
                </div>

                <div class="tab-pane {if $page==1}active{/if}" id="tab_1">
                    <div class="form-body">
                        <div class="form-group">
                            <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-checkbox-outline"><input type="radio" name="data[register][close]" value="0" {if !$data['register']['close']}checked{/if} /> {dr_lang('开启注册')} <span></span></label>
                                    <label class="mt-radio mt-checkbox-outline"><input type="radio" name="data[register][close]" value="1" {if $data['register']['close']}checked{/if} /> {dr_lang('关闭注册')} <span></span></label>
                                </div>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-md-2 control-label">{dr_lang('默认注册组')}</label>
                            <div class="col-md-9">
                                <label>
                                    <select class="form-control" name="data[register][groupid]">
                                        {loop $group $t}
                                        {if $t.register}
                                        <option value="{$t.id}" {if $t.id==$data['register']['groupid']} selected{/if}>{$t.name}</option>
                                        {/if}
                                        {/loop}
                                    </select>
                                </label>
                                <span class="help-block"><a href="{dr_url('member_group/index')}">{dr_lang('必须选择一个默认注册的用户组')}</a></span>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-md-2 control-label">{dr_lang('注册字段选择')}</label>
                            <div class="col-md-9">
                                <div class="mt-checkbox-inline">
                                    <label class="mt-checkbox mt-checkbox-outline"><input type="checkbox" name="data[register][field][]" value="username" {if @in_array('username', (array)$data.register.field)} checked{/if} /> {dr_lang('账号')} <span></span></label>
                                    <label class="mt-checkbox mt-checkbox-outline"><input type="checkbox" name="data[register][field][]" value="phone" {if @in_array('phone', (array)$data.register.field)} checked{/if} /> {dr_lang('手机号')} <span></span></label>
                                    <label class="mt-checkbox mt-checkbox-outline"><input type="checkbox" name="data[register][field][]" value="email" {if @in_array('email', (array)$data.register.field)} checked{/if} /> {dr_lang('邮箱')} <span></span></label>
                                </div>
                                <span class="help-block">{dr_lang('至少选择一个字段或多个字段组合')}</span>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-md-2 control-label">{dr_lang('随机用户名前缀')}</label>
                            <div class="col-md-9">
                                <label><input class="form-control" type="text" name="data[register][unprefix]" value="{$data['register']['unprefix']}" ></label>
                                <span class="help-block">{dr_lang('当注册字段没有选择"账号"时，系统会随机注册一个账号，格式为：前缀+用户id')}</span>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-md-2 control-label">{dr_lang('注册验证码')}</label>
                            <div class="col-md-9">
                                <input type="checkbox" name="data[register][code]" value="1" {if $data['register']['code']}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">
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-md-2 control-label">{dr_lang('注册短信验证')}</label>
                            <div class="col-md-9">
                                <input type="checkbox" name="data[register][sms]" value="1" {if $data['register']['sms']}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>
                        <div class="form-group">
                            <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[register][verify]" value="" {if empty($data['register']['verify'])}checked{/if} /> {dr_lang('关闭')} <span></span></label>
                                    <label class="mt-radio mt-radio-outline"><input type="radio" name="data[register][verify]" value="email" {if $data['register']['verify']=='email'}checked{/if} /> {dr_lang('邮件审核')} <span></span></label>
                                    <label class="mt-radio mt-radio-outline"><input type="radio" name="data[register][verify]" value="phone" {if $data['register']['verify']=='phone'}checked{/if} /> {dr_lang('短信审核')} <span></span></label>
                                    <label class="mt-radio mt-radio-outline"><input type="radio" name="data[register][verify]" value="admin" {if $data['register']['verify']=='admin'}checked{/if} /> {dr_lang('人工审核')} <span></span></label>
                                </div>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-md-2 control-label">{dr_lang('用户名规则（正则）')}</label>
                            <div class="col-md-9">
                                <label><input class="form-control input-large" type="text" name="data[register][preg]" id="dr_regnamerule" value="{$data.register.preg}"/></label>
                                <label><select class="form-control" onchange="javascript:$('#dr_regnamerule').val(this.value)" name="pattern_select">
                                    <option value="">{dr_lang('正则验证')}</option>
                                    <option value="/^[0-9.-]+$/">{dr_lang('数字')}</option>
                                    <option value="/^[0-9-]+$/">{dr_lang('整数')}</option>
                                    <option value="/^[a-z]+$/i">{dr_lang('字母')}</option>
                                    <option value="/^[0-9a-z]+$/i">{dr_lang('数字+字母')}</option>
                                    <option value="/^[\w\-\.]+@[\w\-\.]+(\.\w+)+$/">Email</option>
                                </select></label>
                            </div>
                        </div>
                        <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:150px; width:100%;" name="data[register][notallow]">{$data['register']['notallow']}</textarea>
                                <span class="help-block">{dr_lang('多个用户名以分号“,”分隔')}</span>
                            </div>
                        </div>
                    </div>
                </div>

                <div class="tab-pane {if $page==2}active{/if}" id="tab_2">
                    <div class="form-body">
                        <div class="form-group">
                            <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[oauth][login]" value="0" {if empty($data['oauth']['login'])}checked{/if} /> {dr_lang('绑定账号')} <span></span></label>
                                    <label class="mt-radio mt-radio-outline"><input type="radio" name="data[oauth][login]" value="1" {if $data['oauth']['login']}checked{/if} /> {dr_lang('直接登录')} <span></span></label>
                                </div>
                            </div>
                        </div>
                        <div class="form-group">
                            <label class="col-md-2 control-label">{dr_lang('账号设置')}</label>
                            <div class="col-md-9">
                                <table class="table table-striped table-bordered table-hover table-checkable dataTable">
                                    <thead>
                                    <tr class="heading">
                                        <th width="90"> {dr_lang('接入商')} </th>
                                        <th width="210"> {dr_lang('ID')} </th>
                                        <th> {dr_lang('密钥')} </th>
                                        <th width="90">  </th>
                                    </tr>
                                    </thead>
                                    <tbody>
                                    <tr class="odd gradeX">
                                        <td>QQ</td>
                                        <td><input class="form-control" name="data[oauth][qq][id]" type="text" value="{$data['oauth']['qq']['id']}"></td>
                                        <td><input class="form-control" name="data[oauth][qq][value]" type="text" value="{$data['oauth']['qq']['value']}"></td>
                                        <td style="text-align: center"><a href="javascript:dr_help(586);">{dr_lang('申请接口')}</a></td>
                                    </tr>
                                    <tr class="odd gradeX">
                                        <td>微信</td>
                                        <td><input class="form-control" name="data[oauth][weixin][id]" type="text" value="{$data['oauth']['weixin']['id']}"></td>
                                        <td><input class="form-control" name="data[oauth][weixin][value]" type="text" value="{$data['oauth']['weixin']['value']}"></td>
                                        <td style="text-align: center"><a href="javascript:dr_help(587);">{dr_lang('申请接口')}</a></td>
                                    </tr>
                                    <tr class="odd gradeX">
                                        <td>微博</td>
                                        <td><input class="form-control" name="data[oauth][weibo][id]" type="text" value="{$data['oauth']['weibo']['id']}"></td>
                                        <td><input class="form-control" name="data[oauth][weibo][value]" type="text" value="{$data['oauth']['weibo']['value']}"></td>
                                        <td style="text-align: center"><a href="javascript:dr_help(588);">{dr_lang('申请接口')}</a></td>
                                    </tr>
                                    </tbody>
                                </table>
                            </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 green"> <i class="fa fa-save"></i> {dr_lang('保存')}</button>
        </div>
    </div>
</form>

{template "footer.html"}