{template 'user/head.html'}

<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();">

    <script type="text/javascript" src="{$base_url}/js/jquery-1.3.2.min.js"></script>
    <script type="text/javascript" src="{$base_url}/common/js/ajaxfileupload.js"></script>
    <script type="text/javascript" src="{$base_url}/common/js/ThumbAjaxFileUpload.js"></script>
    <link rel="stylesheet" href="{$base_url}/common/js/jquery/ui/ui.datepicker.css" type="text/css" media="screen" title="core css file" charset="utf-8" />
    <script language="javascript" src="{$base_url}/common/js/jquery/ui/ui.datepicker.js"></script>
<script type="text/javascript" src="{$base_url}/js/upimg/dialog.js"></script>
	<link href="{$base_url}/images/dialog.css" rel="stylesheet" type="text/css" />

    <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="hid_box">
        <strong>{lang(addcategory)}</strong>
        <div class="hbox" style="background:none;">
            <?php
//var_dump($data);
            ?>
            {form::getform('catid',$form,$field,$data)}
        </div>
    </div>

    <div class="hid_box">
        <strong>{lang(addtype)}</strong>
        <div class="hbox" style="background:none;">
            <?php
//var_dump($data);
            ?>
            {form::getform('typeid',$form,$field,$data)}
        </div>
    </div>


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



    <div class="hid_box">
        <strong>{lang(content)}</strong>
        <div class="hbox" style="background:none;">
            <div style="width:100%;">
                {form::getform('content',$form,$field,$data)}
            </div>
            <div style="width: 100%;margin-top: 10px;">
                <div class="fieldset flash" id="fsUploadProgress">
                    <span class="legend"></span>
                </div>
                <div id="divStatus"></div>
                <div>
                     <span id="spanButtonPlaceHolder"></span>
                    <input id="btnCancel" type="button" value="取消" disabled="disabled" style="display:none;" />
                </div>
            </div>
        </div>
    </div>



    <div class="hid_box">
        <strong>{lang(tag)}</strong>
        <div class="hbox" style="background:none;">
            <div style="width:99%;">
                {form::getform('tag',$form,$field,$data)}
            </div>
        </div>
    </div>

    
    <div class="blank10"></div>
    <div class="blank10"></div>
    <input type="submit" name="submit" value="{lang(submit_on)}" class="btn"/>

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

{template 'user/foot.html'}