<!--#
##
#	Project: PHPDISK File Storage Solution
#	This is NOT a freeware, use is subject to license terms.
#
#	Site: http://www.phpdisk.com
#
#	$Id: email.tpl.html 2 2011-05-27 02:59:23Z along $
#
#	Copyright (C) 2008-2011 PHPDisk Team. All Rights Reserved.
#
##
#-->
<!--#
if($action == 'setting'){
#-->
<div id="container">
<h1>{$L['email_title']}<!--#sitemap_tag($L['email_title']);#--></h1>
<div>
<div class="tips_box"><img class="img_light" src="images/light.gif" align="absmiddle" /> <b>{$L['tips']}: </b>
<span class="txtgray">{$L['email_tips']}</span>
</div>
<form action="{#urr("admincp","item=email")#}" method="post" onsubmit="return dosubmit(this);">
<input type="hidden" name="action" value="{$action}" />
<input type="hidden" name="task" value="update" />
<input type="hidden" name="formhash" value="{$formhash}" />
<table align="center" width="100%" cellpadding="4" cellspacing="0" border="0" class="td_line">
<tr>
	<td width="40%"><span class="bold">{$L['open_email']}</span>: <br /><span class="txtgray">{$L['open_email_tips']}</span></td>
	<td><input type="radio" name="setting[open_email]" value="1" {#ifchecked(1,$setting['open_email'])#}/>{$L['yes']}&nbsp;&nbsp;<input type="radio" name="setting[open_email]" value="0" {#ifchecked(0,$setting['open_email'])#}/>{$L['no']}</td>
</tr>
<tr>
	<td><span class="bold">{$L['email_address']}</span>: <br /><span class="txtgray">{$L['email_address_tips']}</span></td>
	<td><input type="text" id="email_address" name="setting[email_address]" value="{$setting['email_address']}" maxlength="50" /></td>
</tr>
<tr>
	<td><span class="bold">{$L['email_pwd']}</span>: <br /><span class="txtgray">{$L['email_pwd_tips']}</span></td>
	<td><input type="text" id="email_pwd" name="setting[email_pwd]" value="{$setting['email_pwd']}" maxlength="50"/></td>
</tr>
<tr>
	<td><span class="bold">{$L['email_user']}</span>: <br /><span class="txtgray">{$L['email_user_tips']}</span></td>
	<td><input type="text" id="email_user" name="setting[email_user]" value="{$setting['email_user']}" maxlength="50"/></td>
</tr>
<tr>
	<td><span class="bold">{$L['email_smtp']}</span>: <br /><span class="txtgray">{$L['email_smtp_tips']}</span></td>
	<td><input type="text" id="email_smtp" name="setting[email_smtp]" value="{$setting['email_smtp']}" maxlength="50"/></td>
</tr>
<tr>
	<td><span class="bold">{$L['email_port']}</span>: <br /><span class="txtgray">{$L['email_port_tips']}</span></td>
	<td><input type="text" id="email_port" name="setting[email_port]" value="{$setting['email_port']}" maxlength="50"/></td>
</tr>
<tr>
	<td><span class="bold">{$L['email_ssl']}</span>: <br /><span class="txtgray">{$L['email_ssl_tips']}</span></td>
	<td><input type="radio" name="setting[email_ssl]" value="1" {#ifchecked(1,$setting['email_ssl'])#}/>{$L['yes']}
	  <input type="radio" name="setting[email_ssl]" value="0" {#ifchecked(0,$setting['email_ssl'])#}/>{$L['no']}</td>
</tr>
<tr>
	<td>&nbsp;</td>
	<td><input type="submit" class="btn" value="{$L['btn_update']}"/></td>
</tr>
</table>
</form>
</div>
</div>
<script language="javascript">
function dosubmit(o){
	if(getId('email_address').value.strtrim().length <6 || getId('email_address').value.strtrim().indexOf('@') ==-1 || getId('email_address').value.strtrim().indexOf('.') ==-1){
		alert("{$L['email_address_error']}");
		getId('email_address').focus();
		return false;
	}
	if(getId('email_user').value.strtrim().length <2){
		alert("{$L['email_user_error']}");
		getId('email_user').focus();
		return false;
	}
	if(getId('email_pwd').value.strtrim().length <2){
		alert("{$L['email_pwd_error']}");
		getId('email_pwd').focus();
		return false;
	}
	if(getId('email_smtp').value.strtrim().length <6 || getId('email_smtp').value.strtrim().indexOf('.') ==-1){
		alert("{$L['email_smtp_error']}");
		getId('email_smtp').focus();
		return false;
	}
	if(getId('email_port').value.strtrim().length <2){
		alert("{$L['email_port_error']}");
		getId('email_port').focus();
		return false;
	}
}
</script>
<!--#}elseif($action =='mail_test'){#-->
<div id="container">
<h1>{$L['email_test']}<!--#sitemap_tag($L['email_test']);#--></h1>
<div>
<div class="tips_box"><img class="img_light" src="images/light.gif" align="absmiddle" /> <b>{$L['tips']}: </b>
<span class="txtgray">{$L['email_tips']}</span>
</div>
<form action="{#urr("admincp","item=email")#}" method="post" onsubmit="return dosubmit(this);">
<input type="hidden" name="action" value="{$action}" />
<input type="hidden" name="task" value="mail_test" />
<input type="hidden" name="formhash" value="{$formhash}" />
<table align="center" width="100%" cellpadding="4" cellspacing="0" border="0" class="td_line">
<tr>
	<td width="40%"><span class="bold">{$L['receive_address']}:</span></td>
	<td><input type="text" name="receive_address" value="" maxlength="50" /></td>
</tr>
<tr>
	<td><span class="bold">{$L['mail_subject']}:</span></td>
	<td><input type="text" name="mail_subject" value="{$L['test_mail_subject']}" maxlength="80" /></td>
</tr>
<tr>
	<td><span class="bold">{$L['mail_content']}:</span></td>
	<td><textarea name="mail_content" id="mail_content" style="width:350px;height:100px">{$L['test_mail_content']}</textarea><br />
	<a href="javascript:void(0);" onclick="resize_textarea('mail_content','plus');">[+]</a> <a href="javascript:void(0);" onclick="resize_textarea('mail_content','sub');">[-]</a></td>
</tr>
<tr>
	<td>&nbsp;</td>
	<td><input type="submit" class="btn" id="s1" value="{$L['btn_submit']}"/></td>
</tr>
</table>
</form>
</div>
</div>
<script type="text/javascript">
function dosubmit(o){
	if(o.receive_address.value.strtrim().length <6 || o.receive_address.value.strtrim().indexOf('@') ==-1 || o.receive_address.value.strtrim().indexOf('.') ==-1){
		alert("{$L['email_address_error']}");
		o.receive_address.focus();
		return false;
	}
	if(o.mail_subject.value.strtrim().length <2){
		alert("{$L['email_subject_error']}");
		o.mail_subject.focus();
		return false;
	}
	if(o.mail_content.value.strtrim().length <2 || o.mail_content.value.strtrim().length >255){
		alert("{$L['email_content_error']}");
		o.mail_content.focus();
		return false;
	}
	getId('s1').disabled = true;
}
</script>
<!--#}#-->