<?php
require '../../../zb_system/function/c_system_base.php';
require '../../../zb_system/function/c_system_admin.php';
$zbp->Load();
$action='root';
if (!$zbp->CheckRights($action)) {$zbp->ShowError(6);die();}
if (!$zbp->CheckPlugin('Watermark2')) {$zbp->ShowError(48);die();}

$blogtitle='Watermark2';
require $blogpath . 'zb_system/admin/admin_header.php';
require $blogpath . 'zb_system/admin/admin_top.php';
?>
<div id="divMain">
  <div class="divHeader"><?php echo $blogtitle;?></div>
  <div class="SubMenu">
		<a href="" ><span class="m-left">配置首页</span></a>
        <a href="http://www.birdol.com/" target="_blank"><span class="m-right">帮助</span></a>
  </div>
  <div id="divMain2">
<!--代码-->
	<form enctype="multipart/form-data" method="post" action="save.php?type=Watermark2">  
		<table width="100%" style='padding:0;margin:0;' cellspacing='0' cellpadding='0' class="tableBorder">
			<tr>
				<td width="15%"><label for="Watermark2.png"><p align="center">上传水印图片[仅限PNG格式]</p></label></td>
				<td width="50%"><p align="center"><input name="Watermark2.png" type="file"/></p></td>
				<td width="25%"><p align="center"><input name="" type="Submit" class="button" value="保存"/></p></td>
			</tr>
		</table>
	</form>

    <?php
	if(isset($_POST['waterPos'])){
		$zbp->Config('Watermark2')->waterPos=$_POST['waterPos'];
		$zbp->Config('Watermark2')->waterText=$_POST['waterText'];
		$zbp->Config('Watermark2')->textFont=$_POST['textFont'];
		$zbp->Config('Watermark2')->textColor=$_POST['textColor'];
		$zbp->Config('Watermark2')->Watermark2Type=$_POST['Watermark2Type'];
		$zbp->SaveConfig('Watermark2');
		$zbp->SetHint('good');
		Redirect('./main.php');
	}
	?>

	<form id="form1" name="form1" method="post"> 
    <table width="100%" style='padding:0;margin:0;' cellspacing='0' cellpadding='0' class="tableBorder">
		<tr>
			<th width="15%"><p align="center">配置名称</p></th>
			<th width="85%"><p align="center">配置内容</p></th>
		</tr>
		<tr>
			<td><label for="waterPos"><p align="center">水印位置</p></label></td>
			<td>
				<table width="100%" border="0">
					<tr>
					<td><label>
						<input type="radio" name="waterPos" id="radio" value="1" <?php if($zbp->Config('Watermark2')->waterPos==1):?>checked="checked"<?php endif;?> />
					左上</label></td>
					<td><label>
						<input type="radio" name="waterPos" id="radio" value="2" <?php if($zbp->Config('Watermark2')->waterPos==2):?>checked="checked"<?php endif;?> />
					中上</label></td>
					<td><label>
						<input type="radio" name="waterPos" id="radio" value="3" <?php if($zbp->Config('Watermark2')->waterPos==3):?>checked="checked"<?php endif;?> />
					右上</label></td>
					<td><label>
						<input type="radio" name="waterPos" id="radio" value="4" <?php if($zbp->Config('Watermark2')->waterPos==4):?>checked="checked"<?php endif;?> />
					左中</label></td>
					<td><label>
						<input type="radio" name="waterPos" id="radio" value="5" <?php if($zbp->Config('Watermark2')->waterPos==5):?>checked="checked"<?php endif;?> />
					中间</label></td>
					<td><label>
						<input type="radio" name="waterPos" id="radio" value="6" <?php if($zbp->Config('Watermark2')->waterPos==6):?>checked="checked"<?php endif;?> />
					右中</label></td>
					<td><label>
						<input type="radio" name="waterPos" id="radio" value="7" <?php if($zbp->Config('Watermark2')->waterPos==7):?>checked="checked"<?php endif;?> />
					左下</label></td>
					<td><label>
						<input type="radio" name="waterPos" id="radio" value="8" <?php if($zbp->Config('Watermark2')->waterPos==8):?>checked="checked"<?php endif;?> />
					中下</label></td>
					<td><label>
						<input type="radio" name="waterPos" id="radio" value="9" <?php if($zbp->Config('Watermark2')->waterPos==9):?>checked="checked"<?php endif;?>  />
					右下</label></td>
					</tr>
				</table>
			</td>
		</tr>
		<tr>
			<td><label for="waterText"><p align="center">水印文字</p></label></td>
			<td><p align="left"><textarea name="waterText" type="text" id="waterText" style="width:98%;height:25px;"><?php echo htmlspecialchars($zbp->Config('Watermark2')->waterText);?></textarea></p></td>
		</tr>
		<tr>
			<td><label for="textFont"><p align="center">文字大小</p></label></td>
			<td><p align="left"><textarea name="textFont" type="text" id="textFont" style="width:98%;height:25px;"><?php echo htmlspecialchars($zbp->Config('Watermark2')->textFont);?></textarea></p></td>
		</tr>
		<tr>
			<td><label for="textColor"><p align="center">文字颜色</p></label></td>
			<td><p align="left"><textarea name="textColor" type="text" id="textColor" style="width:98%;height:25px;"><?php echo htmlspecialchars($zbp->Config('Watermark2')->textColor);?></textarea></p></td>
		</tr>
		<tr>
			<td><label for="Watermark2Type"><p align="center">水印类型</p></label></td>
			<td><label><input type="radio" name="Watermark2Type" value="text" <?php if($zbp->Config('Watermark2')->Watermark2Type == 'text') echo 'checked'; ?> />文字水印</label> <label><input type="radio" name="Watermark2Type" value="image" <?php if($zbp->Config('Watermark2')->Watermark2Type == 'image') echo 'checked'; ?> />图片水印</label></td>
		</tr>
	</table>
	<br />
		<input name="" type="Submit" class="button" value="保存"/>
	</form>
  </div>
</div>

<?php
require $blogpath . 'zb_system/admin/admin_footer.php';
RunTime();
?>