{template 'head.html'}
    <?php $root = config::get('base_url').'/ueditor';?>
    <script type="text/javascript" charset="utf-8" src="{$root}/ueditor.config.js"></script>
    <script type="text/javascript" charset="utf-8" src="{$root}/ueditor.all.js"> </script>
    <script type="text/javascript" charset="utf-8" src="{$root}/lang/zh-cn/zh-cn.js"></script>
    <script type="text/javascript" charset="utf-8" src="{$root}/addCustomizeButton.js"></script>


<div class="t_1 wow bounceIn">
<div>
<h3>{lang('edits')}</h3>
<p>Edit Content</p>
</div>
</div>

<div class="p10">

<div class="blank10"></div>

<script>

    function checkform() {
        if(!document.form1.title.value) {
            alert('{lang('pinput')}{lang('title')}');
            return false;
        }
        if(!document.form1.catid.value) {
            alert('{lang('pselectcat')}');
            return false;
        }
        return true;
    }
	function getEditor(name) {
	return FCKeditorAPI.GetInstance(name);
}
</script>



<form method="post" name="form1" action="<?php if(front::$act=='edit') $id="/id/".$data[$primary_key]; else $id=''; echo modify("/act/".front::$act."/manage/".$manage.$id);?>" enctype="multipart/form-data" onsubmit="return checkform();">


    

    <style type="text/css">
        .progressName {
            margin-top: 5px;
        }
    </style>


    <script>
        $(document).ready(function(){
            $("#catid").change( function(){
                get_field($("#catid").val());
            });
        });
        function attachment_delect(id) {
            $.ajax({
                url: '{url('tool/deleteattachment',false)}&id='+id,
                type: 'GET',
                dataType: 'text',
                timeout: 1000,
                error: function(){
                    //	alert('Error loading XML document');
                },
                success: function(data){
                    document.form1.attachment_id.value=0;
                    get('attachment_path').innerHTML='';
                    get('file_info').innerHTML='';
                }
            });
        }

        function get_field(catid) {
            $.ajax({
                url: '{url('table/getfield/table/archive/',true)}&aid={$data['aid']}&catid='+catid,
                type: 'GET',
                dataType: 'text',
                timeout: 1000,
                error: function(){
                    alert('Error loading XML document');
                },
                success: function(data){
                    $("#lm7").html(data);
                }
            });
        }
    </script>


    <div class="clearBoth">
        <strong>{lang('addcategory')}</strong>
        <div class="clearBoth" style="background:none;">

            {form::getform('catid',$form,$field,$data)}
        </div>
    </div>

    <div class="clearBoth">
        <strong>{lang('addtype')}</strong>
        <div class="clearBoth" style="background:none;">

            {form::getform('typeid',$form,$field,$data)}
        </div>
    </div>


    <div class="clearBoth">
        <strong>{lang('title')}</strong>
        <div class="clearBoth" style="background:none;">
            {form::getform('title',$form,$field,$data)}
        </div>
    </div>



    <div class="clearBoth" style="height:750px;">
        <strong>{lang('content')}</strong>
        <div class="clearBoth" style="background:none;">
            {form::getform('content',$form,$field,$data)}
			<div style="width: 100%;margin-top: 0px;">
				<div class="fieldset flash" id="fsUploadProgress">
					<span class="legend"></span>
				</div>
				<div id="divStatus"></div>
			</div>
			<div class="blank30"></div>
		</div>
	</div>


	<style type="text/css">
		#content {height:300px;}
	</style>

	<div class="blank5"></div>
    <div class="clearBoth">
        <strong>{lang('tag')}</strong>
        <div class="clearBoth" style="background:none;">
            <div style="width:99%;">
                {form::getform('tag',$form,$field,$data)}
            </div>
        </div>
    </div>
    </div>
    
    <div class="blank10"></div>
    <div class="blank10"></div>
    <input type="submit" name="submit" value="{lang('submit_on')}" class="btn btn-primary btn-lg disabled"/>

</form>
<div class="blank10"></div>

{template 'foot.html'}