{template "header.html"}
<div class="note note-danger">
    <p><a href="javascript:dr_update_cache('member', '');">{dr_lang('更改数据之后需要更新缓存之后才能生效')}</a></p>
</div>


<link href="{THEME_PATH}assets/global/plugins/bootstrap-touchspin/bootstrap.touchspin.css" rel="stylesheet" type="text/css" />
<script src="{THEME_PATH}assets/global/plugins/fuelux/js/spinner.min.js" type="text/javascript"></script>
<script src="{THEME_PATH}assets/global/plugins/bootstrap-touchspin/bootstrap.touchspin.js" type="text/javascript"></script>

<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==5}active{/if}">
                    <a href="#tab_5" data-toggle="tab" onclick="$('#dr_page').val('5')"> <i class="fa fa-user-md"></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==5}active{/if}" id="tab_5">
                    <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][cname]" value="{htmlspecialchars($data['config']['cname'])}" ></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">
                                <input type="checkbox" name="data[config][edit_name]" value="1" {if $data['config']['edit_name']}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="input-small"><input class="form-control" id="dr_cutname" type="text" name="data[register][cutname]" value="{intval($data['register']['cutname'])}" >
                                <script type="text/javascript">
                                    $(function(){
                                        $("#dr_cutname").TouchSpin({
                                            buttondown_class: "btn default",
                                            buttonup_class: "btn default",
                                            verticalbuttons: false,
                                            step: 1,
                                            min: 0,
                                            max: 100
                                        });
                                    });
                                </script></div>
                                <span class="help-block">{dr_lang('用户姓名的最大长度，设置0表示不限制，最大设置100，超出会被切取')}</span>
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-md-2 control-label">{dr_lang('账号最小长度')}</label>
                            <div class="col-md-9">
                                <div class="input-small"><input class="form-control" id="dr_username" type="text" name="data[config][userlen]" value="{intval($data['config']['userlen'])}" >
                                    <script type="text/javascript">
                                        $(function(){
                                            $("#dr_username").TouchSpin({
                                                buttondown_class: "btn default",
                                                buttonup_class: "btn default",
                                                verticalbuttons: false,
                                                step: 1,
                                                min: 1,
                                                max: 50
                                            });
                                        });
                                    </script></div>
                                <span class="help-block">{dr_lang('账号名的最小长度控制，最大设置50位数')}</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[config][user2pwd]" value="1" {if $data['config']['user2pwd']}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="input-small"><input class="form-control" id="dr_password" type="text" name="data[config][pwdlen]" value="{intval($data['config']['pwdlen'])}" >
                                    <script type="text/javascript">
                                        $(function(){
                                            $("#dr_password").TouchSpin({
                                                buttondown_class: "btn default",
                                                buttonup_class: "btn default",
                                                verticalbuttons: false,
                                                step: 1,
                                                min: 1,
                                                max: 50
                                            });
                                        });
                                    </script></div>
                                <span class="help-block">{dr_lang('密码的最小长度控制，最大设置50位数')}</span>
                            </div>
                        </div>


                        <div class="form-group">
                            <label class="col-md-2 control-label">{dr_lang('密码强度（正则）')}</label>
                            <div class="col-md-9">
                                <div class="input-group ">
                                    <input class="form-control" type="text" name="data[config][pwdpreg]" value="{$data.config.pwdpreg}" >
                                    <span class="input-group-btn">
                                            <button class="btn blue" onclick="dr_iframe_show('{dr_lang('正则表达式')}', '{dr_url('api/test_pattern')}')" type="button">{dr_lang('测试')}</button>
                                        </span>
                                </div>
                                <span class="help-block">{dr_lang('针对前端注册或修改密码时的强度验证，可以设置自定义正则表达式，例如数字正则表达式格式：/^[0-9]+$/')}</span>
                            </div>
                        </div>

                        <div class="form-group">
                            <label class="col-md-2 control-label">{dr_lang('账号规则（正则）')}</label>
                            <div class="col-md-9">
                                <div class="input-group ">
                                    <input class="form-control" type="text" name="data[register][preg]" value="{$data.register.preg}" >
                                    <span class="input-group-btn">
                                            <button class="btn blue" onclick="dr_iframe_show('{dr_lang('正则表达式')}', '{dr_url('api/test_pattern')}')" type="button">{dr_lang('测试')}</button>
                                        </span>
                                </div>
                                <span class="help-block">{dr_lang('针对前端注册时的账号格式验证，可以设置自定义正则表达式，例如数字正则表达式格式：/^[0-9]+$/')}</span>
                            </div>
                        </div>

                    </div>
                </div>

                <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">

                                <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[config][edit_email]" value="1" {if $data['config']['edit_email']}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">
                                <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="{intval($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 dr_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 dr_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="{intval($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="{intval($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="{intval($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}>{dr_lang($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 dr_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 dr_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 dr_in_array('email', (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="name" {if dr_in_array('name', (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="{htmlspecialchars($data['register']['unprefix'])}" ></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">
                                <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>
						 {if $data['register']['sms']}
                        <div class="form-group">
                            <label class="col-md-2 control-label">{dr_lang('注册图片验证码')}</label>
                            <div class="col-md-9">
                                <input type="checkbox" readonly name="data[register][code]" value="1" checked 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>
						 {else}
                        <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">
                                <span class="help-block">{dr_lang('网页中的图片验证码')}</span>
                            </div>
                        </div>
						 {/if}
                        <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">
                                <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>
                                <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[oauth][field]" value="0" {if empty($data['oauth']['field'])}checked{/if} /> {dr_lang('注册后填写')} <span></span></label>
                                <label class="mt-radio mt-radio-outline"><input type="radio" name="data[oauth][field]" value="1" {if $data['oauth']['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">
                                <table class="table table-striped table-bordered table-hover table-checkable dataTable">
                                    <thead>
                                    <tr class="heading">
                                        <th width="90"> {dr_lang('接入商')} </th>
                                        <th width="280"> {dr_lang('ID')} </th>
                                        <th> {dr_lang('密钥')} </th>
                                        <th width="90">  </th>
                                    </tr>
                                    </thead>
                                    <tbody>
                                    {loop $oauth $dir $t}
                                    <tr class="odd gradeX">
                                        <td>{$t.name}</td>
                                        <td><input class="form-control" name="data[oauth][{$dir}][id]" type="text" value="{htmlspecialchars($data['oauth'][$dir]['id'])}"></td>
                                        <td><input class="form-control" name="data[oauth][{$dir}][value]" type="text" value="{htmlspecialchars($data['oauth'][$dir]['value'])}"></td>
                                        <td style="text-align: center"><a href="javascript:dr_help({$t.help});">{dr_lang('申请接口')}</a></td>
                                    </tr>
                                    {/loop}
                                    {if dr_is_app('weixin')}
                                    <tr class="odd gradeX">
                                        <td>{dr_lang('微信公众号')}</td>
                                        <td colspan="3">
										    <input type="checkbox" name="data[oauth][wechat][id]" value="1" {if $data['oauth']['wechat']['id']}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">
											&nbsp;{dr_lang('用于关注微信公众号绑定账号使用')}
                                        </td>
                                    </tr>
                                    {/if}
                                    </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"}