{template 'header.html'}

<div class="index-bg">
    <div class="container">
        <div class="section2">

            <div class="index-title">
                <h4>{lang('edits')}</h4>
            </div>


            <div class="user-content">

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


<script>

    function checkform() {
        if(!document.form1.title.value) {
            alert('{lang('pinput_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();">


    



    <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="clearfix form-group">
                    <label>{lang('addcategory')}</label>
                    {form::getform('catid',$form,$field,$data)}
                </div>

                <div class="clearfix form-group">
                    <label>{lang('addtype')}</label>
                    {form::getform('typeid',$form,$field,$data)}
                </div>

                <div class="clearfix form-group">
                    <label>{lang('title')}</label>
                    {form::getform('title',$form,$field,$data)}
                </div>

                <div class="clearfix form-group">
                    <label>{lang('addcategory')}</label>
                    {form::getform('catid',$form,$field,$data)}
                </div>

                <div class="clearfix form-group">
                    <label>{lang('addcategory')}</label>
                    {form::getform('catid',$form,$field,$data)}
                </div>



                <div class="clearfix form-group">
                    <label>{lang('content')}</label>


        <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 class="blank30"></div>
    <input type="submit" name="submit" value="{lang('submit_on')}" class="btn btn-primary"/>

</form>
<div class="blank10"></div>
        </div>
    </div>
</div>
</div>
<div class="blank30"></div>
    {template 'footer.html'}