{m:include "member","header"}
<link rel="stylesheet" type="text/css" href="{STATIC_URL}plugin/Hui-iconfont/iconfont.min.css" />
<script type="text/javascript" src="{STATIC_URL}js/yzm_common.js"></script>
<script type="text/javascript" charset="utf-8" src="<?php echo STATIC_URL;?>plugin/ueditor/ueditor.config.js"></script>
<script type="text/javascript" charset="utf-8" src="<?php echo STATIC_URL;?>plugin/ueditor/ueditor.all.min.js"> </script>
<script type="text/javascript" charset="utf-8" src="<?php echo STATIC_URL;?>plugin/ueditor/lang/zh-cn/zh-cn.js"></script>
<div class="yzm_member_container main">
    {m:include "member","left"}
    <div class="main_right">
        <div class="tit">
            <h3>稿件编辑</h3>
        </div>
        <div class="main_cont">
            <form method="post" action="" onsubmit="return chcekall()">
                <table>
                    <tr>
                        <td width="70">栏目：</td>
                        <td>{get_catname($data['catid'])}<input type="hidden" name="catid" value="{$data['catid']}"></td>
                    </tr>
                    <tr>
                        <td>标题：</td>
                        <td><input type="text" name="title" value="{$data['title']}" required class="input w370"><span class="red">*</span></td>
                    </tr>
                    <tr>
                        <td>关键字：</td>
                        <td><input type="text" name="keywords" value="{$data['keywords']}" class="input w370"></td>
                    </tr>
                    <tr>
                        <td>缩略图：</td>
                        <td>{php echo form::image('thumb',$data['thumb'])}
                    </tr>
                    <tr>
                        <td>摘要：</td>
                        <td><textarea name="description" class="textarea" style="width:690px;">{$data['description']}</textarea></td>
                    </tr>
                    {loop $fieldstr $val}
                    <tr>
                        <td>{$val[field]}：</td>
                        <td>{$val[form]}</td>
                    </tr>
                    {/loop}
                    <tr style="height:20px;">
                        <td></td>
                        <td></td>
                    </tr>
                    <tr>
                        <td>内容：</td>
                        <td>{php echo form::editor_mini('content',$data['content'])}</td>
                    </tr>
                    <tr>
                        <td></td>
                        <td><input type="submit" name="dosubmit" class="submit" value="提交"></td>
                    </tr>
                </table>
            </form>
        </div>
    </div>
</div>
<script type="text/javascript">
	  function chcekall(){
	  	  if($("input[name='title']").val()==''){
				layer.msg("标题不能为空!", {icon:2});
				return false;
		  }
			
			//form必填字段的验证
			{loop $field_check $k=>$v}
				{if ($v['isrequired'] && in_array($v['fieldtype'], array('input', 'textarea')))}
				if($("{$v[fieldtype]}[name='{$k}']").val()==''){
					layer.msg("{$v[errortips]}", {icon:2});
					return false;
				}
				{/if}		
			{/loop}

		  if(UE.getEditor('content').getContent()==''){
				layer.msg("内容不能为空!", {icon:2});
				return false;
		  }
	  }
</script>
{m:include "member","footer"}