<form class="layui-form ct-form" table="translate">
    <fieldset class="layui-elem-field layui-field-title"><legend>伪原创翻译</legend></fieldset>
    <p style="margin-left: 10px;"><code>PS：启用翻译功能将过滤所有HTML标签只包含纯文本内容</code></p>
    <br>
    <div class="layui-form-item">
        <label class="layui-form-label">翻译状态</label>
        <div class="layui-input-inline">
            <input type="checkbox" value="<?php echo CTspider_html('ctspider_task', 'translate', 'translate_state', 0) ?>" name="translate_state" lay-filter="translate_state" lay-skin="switch" lay-text="开启|关闭" <?php checked( 1, CTspider_html('ctspider_task', 'translate', 'translate_state') ) ?>>
        </div>
        <div class="layui-form-mid layui-word-aux">开启百度翻译需要到系统配置填写APPID 和 SECKEY</div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">标题翻译</label>
        <div class="layui-input-inline">
            <input type="checkbox" value="<?php echo CTspider_html('ctspider_task', 'translate', 'translate_title', 0) ?>" name="translate_title" lay-filter="translate_title" lay-skin="switch" lay-text="开启|关闭" <?php checked( 1, CTspider_html('ctspider_task', 'translate', 'translate_title') ) ?>>
        </div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">翻译选项</label>
        <div class="layui-input-inline">
            <select name="translate_select">
                <option <?php selected( '1',CTspider_html('ctspider_task','translate','translate_select') ); ?> value="baidu">百度翻译</option>
            </select>
        </div>
        <div class="layui-form-mid layui-word-aux">目前仅支持百度翻译 (后期会不断增加)</div>
    </div>

    <div class="layui-form-item">
        <label class="layui-form-label">原文语言</label>
        <div class="layui-input-inline">
            <select name="baidu_translate_from">
                <?php
                $language = CTbaidu_translate::language();
                foreach ($language as $key => $value) {
                    echo '<option '.selected( $key,CTspider_html('ctspider_task','translate','baidu_translate_from') ).' value="'.$key.'">'.$value.'</option>';
                }
                ?>
            </select>
        </div>
    </div>


    <div class="layui-form-item">
        <label class="layui-form-label">翻译语言</label>
        <div class="layui-input-inline">
            <select name="baidu_translate_to">
                <?php
                $language = CTbaidu_translate::language();
                foreach ($language as $key => $value) {
                    if ($key != 'auto') {
                        echo '<option '.selected( $key,CTspider_html('ctspider_task','translate','baidu_translate_to') ).' value="'.$key.'">'.$value.'</option>';
                    }
                }
                ?>
            </select>
        </div>
    </div>


    <div class="layui-form-item">
        <label class="layui-form-label">发布模式</label>
        <div class="layui-input-inline">
            <select name="translate_pattern">
                <option <?php selected( '1',CTspider_html('ctspider_task','translate','translate_pattern') ); ?> value="1">只发布译文 (模式1)</option>
                <option <?php selected( '2',CTspider_html('ctspider_task','translate','translate_pattern') ); ?> value="2">上面译文，下面原文 (模式2)</option>
                <option <?php selected( '3',CTspider_html('ctspider_task','translate','translate_pattern') ); ?> value="3">上面原文，下面译文 (模式3)</option>
                <option <?php selected( '4',CTspider_html('ctspider_task','translate','translate_pattern') ); ?> value="4">一行原文，一行译文 (模式4)</option>
            </select>
        </div>
    </div>

    <button type="button" class="layui-btn" lay-submit lay-filter="translate" >保存更改</button>
</form>