<?php 


/** 
***************************************************
*欢迎使用免费版SiteTeam企业建站软件！
*这是一个专业为搜索引擎营销而设计的，极稳定、极易维护的建站软件！
*官方客服：help@php.net.cn
*官方下载网址：http://www.SiteTeam.cn 
***************************************************
**/



 if(!defined('IN_SITETEAM')) {exit('Access Denied');}?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>SiteTeam Administrator's Control Panel</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">

<link rel="stylesheet" href="admin/images/admincp.css" type="text/css" media="all" />
<link rel="stylesheet" href="admin/images/form.css" type="text/css" media="all" />
<script src="admin/js/common.js" type="text/javascript"></script>
<script type="text/javascript" src="skin/jq/jquery.js"></script>
<script type="text/javascript" src="tool/ckeditor/ckeditor.js"></script>
<script type="text/javascript" src="tool/ckfinder/ckfinder.js"></script>
</head>

<body>
<script type="text/JavaScript">if(parent.$('admincpnav')) parent.$('admincpnav').innerHTML='开始&nbsp;&raquo;&nbsp;<?=$site_product_name?><?php if(!empty($category)){?>&nbsp;&raquo;&nbsp;<?=$product_category[$category]['name']?><?php }?><?php if(empty($_GET['key'])){?>&nbsp;&raquo;&nbsp;添加<?=$site_product_name?><?php }else{?>&nbsp;&raquo;&nbsp;编辑<?=$site_product_name?><?php }?>';</script>

<div class="container" id="cpcontainer">
  <form name="form1" method="post" enctype="multipart/form-data" action="admin.php?action=product&operation=edit&category=<?=$category?>&page=<?=$page?>">

	<h3>产品内容设置</h3>
	<ul id="postform"><?=dynamic_form($content)?></ul>
	
	<h3>上传产品相关图片</h3>
	<ul id="postform">
	<?php for($i = 1; $i <= 8 ; $i++){?>
	<li id='form_product_pic_<?=$i?>'><span>上传第<?=$i?>张产品图片：</span><label><input name='product_pic_<?=$i?>' class='uploadbtn marginbot' type='file' id='product_pic_<?=$i?>' value='' /></label><input name='data[product_pic][pic_<?=$i?>]' id='hidden_product_pic_<?=$i?>' type='hidden' value='<?php if(!empty($product_info['product_pic']["pic_{$i}"])){ echo $product_info['product_pic']["pic_{$i}"];}?>' /><?php if(!empty($product_info['product_pic']["pic_{$i}"])){?><span><b><a target='_blank' class="thickbox" href='http://<?=$site_url?><?=SITE_PATH?>/<?=$product_info['product_pic']["pic_{$i}"]?>'>查看旧文件</a></b></span> <span class='style2'> <?php echo "<a target='_blank' href='" . (ADMIN_IS_LOCAL ? "http://ps.net.cn" : (!empty($product_info['product_pic']["pic_{$i}"])?"http://ps.net.cn?locktarget=true&title=" . basename($product_info['product_pic']["pic_{$i}"]) . "&referrer=siteteam&image=http://{$site_url}" . SITE_PATH . "/" . $product_info['product_pic']["pic_{$i}"]:"http://ps.net.cn")) . "'>在线编辑此文件</a>"; ?> </span> <?php }?></li>
	<?php }?>
	</ul>
	
	<h3>SEO设置</h3>
	<ul id="postform"><?=dynamic_form($seo)?></ul>
	
  <ul id="postform">
  <li>
    <input name="dosubmit" style="width:50px" class="btn" type="submit" id="dosubmit" value="提交">
  </li>
  </ul>
  </form>
</div>

<script type="text/javascript">
//<![CDATA[

var editor_status = 0;

var editor = null;

function close_editor() {
	if (editor_status != 1) {
		return false;
	}
	
	editor.destroy();
	editor_status = 0;
}

function create_editor(div){
	
	if (editor_status != 0) {
		return false;
	}
	
	window.editor = CKEDITOR.replace( div,
	{
		height:'400px',
		width:'780px',
		
		toolbar:
		[
			['Source','-','NewPage','Preview','-','Templates'],
			['Cut','Copy','Paste','PasteText','PasteFromWord'],
			['Undo','Redo','-','Find','Replace','-','SelectAll','RemoveFormat'],
			['Form', 'Checkbox', 'Radio', 'TextField', 'Textarea', 'Select', 'Button', 'ImageButton', 'HiddenField'],
			'/',
			['Bold','Italic','Underline','Strike','-','Subscript','Superscript'],
			['NumberedList','BulletedList','-','Outdent','Indent','Blockquote'],
			['JustifyLeft','JustifyCenter','JustifyRight','JustifyBlock'],
			['Link','Unlink','Anchor'],
			['Image','Flash','Table','HorizontalRule','Smiley','SpecialChar','PageBreak'],
			'/',
			['Styles','Format','Font','FontSize'],
			['TextColor','BGColor']
		]
	});
	CKFinder.setupCKEditor( editor, { basePath : '<?=SITE_PATH?>/tool/ckfinder/', rememberLastFolder : false });
	
	editor_status = 1;
}

<?php if(isset($auto_start_editor) && $auto_start_editor != 4){?>
create_editor('content');
<?php }?>


//]]>
</script>

</body>
</html>
