<?php if(!defined('IN_SDCMS')) exit;?><!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="renderer" content="webkit">
<title>编辑帖子</title>
<link rel="stylesheet" href="{WEB_ROOT}public/css/ui.css">
<link rel="stylesheet" href="{WEB_ROOT}public/admin/css/layout.css">
<script>var ue_url="{U('upload/imagelist','type=0&multiple=1&iseditor=1')}",web_root="{WEB_ROOT}";</script>
<script src="{WEB_ROOT}public/js/jquery.js"></script>
<script src="{WEB_ROOT}public/js/ui.js"></script>
<script src="{WEB_ROOT}public/admin/js/base.js"></script>
<script src="{WEB_ROOT}public/ueditor/ueditor.config.js"></script>
<script src="{WEB_ROOT}public/ueditor/ueditor.all.min.js"></script>
</head>

<body>
    <div class="position">当前位置：论坛管理 > <a href="{U('index')}">帖子管理</a> > <a href="{THIS_LOCAL}">编辑帖子</a></div>
    <div class="borders">
        <!---->
        
        <div class="tabs tabs-white" data-href="1">
            <ul class="tabs-nav">
              <li class="active"><a href="{THIS_LOCAL}">编辑帖子</a></li>
            </ul>
            <div class="tabs-content">
                <div class="tabs-pane active">
                    <!--loop-->
                    <form class="ui-form" method="post">
                        <div class="form-group row">
                            <label class="col-left col-form-label">内容：</label>
                            <div class="col-right col-right-full">
                                <script id="t0" name="t0" type="text/plain" style="height:260px;">{$content}</script>
                                <script>UE.getEditor('t0',{serverUrl:"{U('upload/index')}"});</script>
                            </div>
                        </div>
                        <div class="form-group row">
                            <label class="col-left col-form-label">回复：</label>
                            <div class="col-right col-right-full">
                                <script id="t2" name="t2" type="text/plain" style="height:160px;">{$reply}</script>
                                <script>UE.getEditor('t2',{serverUrl:"{U('upload/index')}",toolbars:editorOption});</script>
                            </div>
                        </div>
                        <div class="form-group row">
                            <label class="col-left col-form-label">状态：</label>
                            <div class="col-right col-form-label">
                                <label class="radio"><input type="radio" name="t1" id="t1_1" value="1"{if $islock==1} checked{/if}><i></i>启用</label>
                                <label class="radio"><input type="radio" name="t1" id="t1_2" value="0"{if $islock==0} checked{/if}><i></i>锁定</label>
                            </div>
                        </div>
                        <div class="form-group row">
                            <label class="col-left col-form-label"></label>
                            <div class="col-right">
                                <button type="submit" class="btn btn-info mr">保存</button>
                                <button type="button" class="btn ui-back">返回</button>
                            </div>
                        </div>
                    </form>
                    <!--loop-->
                </div>
            </div>
        </div>
        
        <!---->
    </div>


<script>
$(function()
{
	$(".ui-form").form(
	{
		type:2,
		result:function(form)
		{
			$.ajax(
			{
                type:'post',
                cache:false,
                dataType:'json',
                url:'{THIS_LOCAL}',
                data:$(form).serialize(),
                error:function(e){alert(e.responseText);},
                success:function(d)
                {
                    if(d.state=='success')
                    {
                        sdcms.success(d.msg);
                        setTimeout(function(){location.href='{U("index","")}';},1500);
                    }
                    else
                    {
                        sdcms.error(d.msg);
                    }
                }
            });
		}
	});
})
</script>
</body>
</html>