<? defined('ROOT_PHPLEFT') or exit(require '../../../404.php');?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
        "http://www.w3.org/TR/html4/loose.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
    <meta http-equiv="X-UA-Compatible" content="IE=8">
<link href="css/main.css" type="text/css" rel="stylesheet">
<style>
input,textarea {border:#CCC 1px solid;}
</style>
<script type="text/javascript" src="<?=PL_URL?>js/common.js"></script>
<script src="<?=PL_URL?>js/win/artDialog.js?skin=default"></script>
<script src="<?=PL_URL?>js/win/plugins/iframeTools.js"></script>
<link rel="stylesheet" href="<?=PL_URL?>file/editornews/themes/default/default.css" />
<link rel="stylesheet" href="<?=PL_URL?>file/editornews/plugins/code/prettify.css" />
	<script charset="utf-8" src="<?=PL_URL?>file/editornews/kindeditor.js"></script>
	<script charset="utf-8" src="<?=PL_URL?>file/editornews/lang/zh_CN.js"></script>
	<script charset="utf-8" src="<?=PL_URL?>file/editornews/plugins/code/prettify.js"></script>
	<script>
		KindEditor.ready(function(K) {
			var editor1 = K.create('textarea[id="content"]', {
				cssPath : '<?=PL_URL?>file/editornews/plugins/code/prettify.css',
				uploadJson : 'phpleft.php?file=editors&in=upload_json',
				fileManagerJson : 'phpleft.php?file=editors&in=file_manager_json',
				allowFileManager : true,
				afterCreate : function() {
					var self = this;
					K.ctrl(document, 13, function() {
						self.sync();
						K('form[name=example]')[0].submit();
					});
					K.ctrl(self.edit.doc, 13, function() {
						self.sync();
						K('form[name=example]')[0].submit();
					});
				}
			});
			prettyPrint();
		});
	</script>
</head>
<body>
 
<form id="form" action="phpleft.php?file=post&menuid=<?=$menuid?><? if ($id<>'') echo'&b=1&id='.$id;?>" method="post" onSubmit="return check();" >
    <table class="usertableborder input" cellspacing="1" cellpadding="3" width="100%" align="center"
        border="0">
        <tr>
            <th colspan="3">
               <? if ($id<>''){ echo ' 编辑信息' ;}else{ echo ' 添加信息';}?></th>
        </tr>
         <?php foreach($table_cache as $i=>$m) { ?>
         <? if ($m['is_or']==1 and $m['type']<>'hidden'){?>
        <tr>
            <td width="131" height="30" class="text" style="padding-right:10px; text-align:right"><strong><?=$m['name']?></strong></td>
            <td width="562" height="30"><?=input($m['type'],$m['thiskeys'],$menuid,$m['typevalue'],$catid,$m['default_value'],$m['add_js'],$m['note'],$list[$m['thiskeys']],$set['images_size'],$menuid)?><span id="c<?=$m['thiskeys']?>"><? if ($m['note']<>'') echo '<br>';?><?=$m['note']?></span>
            </td>
            <td width="298" height="30"></td>
        </tr>
       <? } }?>
        <tr>
          <td height="30" class="text" style="padding-right:10px; text-align:right"></td>
            <td height="30" class="usertablerow1"><input type="submit" name="button" id="button" class="ok" value=" 确 认 "></td>
            <td height="30" class="usertablerow1">&nbsp;</td>
        </tr>
       
    </table>
   <?php foreach($table_cache as $i=>$m) { ?>
   <? if ($m['type']=='hidden'){?>
     <input name="add[<?=$m['thiskeys']?>]" type="hidden" id="<?=$m['thiskeys']?>" value="<? if ($id<>''){?><?=$list[$m['thiskeys']]?><? }else{?><?=$m['default_value']?><? }?>" size="23">
     <?  }}?>

    <input name="menuid" type="hidden" id="menuid" value="<?=$menuid?>" size="23">
    </form>

   <script type="text/javascript">
   	function check() {
	<?php foreach($table_cache as $i=>$m) { ?>
	<? if ($m['geton'] == "不能为空") {?>
	if($('<?=$m['thiskeys']?>').value == '') {
    msg('请输入<?=$m['name']?>','c<?=$m['thiskeys']?>','right_r');
	return false;
	}<? }?><? } ?>
	}
   
	

</script>           
 
</body>
</html>
