<!--#
##
#	Project: PHPDISK File Storage Solution
#	This is NOT a freeware, use is subject to license terms.
#
#	Site: http://www.phpdisk.com
#
#	$Id: message.tpl.html 2 2011-05-27 02:59:23Z along $
#
#	Copyright (C) 2008-2011 PHPDisk Team. All Rights Reserved.
#
##
#-->
<!--#
if($action =='inbox' || $action =='sendbox'){
#-->
<div id="container">
<h1>{$msg_title}</h1>
<div class="tips_box_p">
<div class="tips_box"><b>{$L['tips']}: </b><img class="img_light" src="images/light.gif" align="absmiddle"> <span class="txtgray">{$L['tips_inbox']}</span>
</div>
</div>
<div id="send_btn">
<a href="{$a_sendmsg}" onclick="return hs.htmlExpand(this,{headingText:'{$L['sendmsg']}',objectType:'iframe',width:500});">{$L['sendmsg']}</a>&nbsp;
<a href="{#urr("mydisk","item=message&action=inbox")#}" id="a_inbox">{$L['msg_inbox']}</a>&nbsp;
<a href="{#urr("mydisk","item=message&action=sendbox")#}" id="a_sendbox">{$L['msg_sendbox']}</a>&nbsp;
</div>
<script language="javascript">
getId('a_{$action}').className = 'bold txtblue';
</script>
<table align="center" width="98%" cellpadding="4" cellspacing="0" border="0" class="td_line">
<tr>
	<td width="20%" class="bold">
	<!--#if($action =='inbox'){#-->
	{$L['msg_user']}
	<!--#}else{#-->
	{$L['msg_touser']}
	<!--#}#-->
	</td>
	<td width="50%" class="bold">{$L['msg_content']}</td>
	<td align="center" width="150" class="bold">{$L['msg_time']}</td>
	<td width="100" align="center" class="bold">{$L['operation']}</td>
</tr>
<!--#
if(count($msg_array)){
	 foreach($msg_array as $k => $v){
		 $color = ($k%2 ==0) ? 'color1' :'color4';
#-->
<tr class="{$color}">
	<td><a href="{$v['a_space']}" target="_blank">{$v['username']}</a></td>
	<td><a href="{$v['a_view_content']}" onclick="return hs.htmlExpand(this,{headingText:'{$L['manage_msg']}',objectType:'iframe',width:500});">{$v['short_content']}({$v['ctn_total']}{$L['byte']})</a></td>
	<td align="center"><span class="txtgray">{$v['in_time']}</span></td>
	<td align="center">
	<!--#if($action =='inbox'){#-->
	<a href="{$v['a_view_content']}" onclick="return hs.htmlExpand(this,{headingText:'{$L['manage_msg']}',objectType:'iframe',width:500});">{$L['reply']}</a>&nbsp;<a href="{$v['a_delete']}" onclick="return confirm('{$L['msg_confirm_delete']}');">{$L['delete']}</a>
	<!--#}else{#-->
	<a href="{$v['a_delete']}" onclick="return confirm('{$L['msg_confirm_delete']}');">{$L['delete']}</a>
	<!--#}#-->
	</td>
</tr>
<!--#	 
	 }
	 unset($msg_array);
}else{
#-->
<tr>
	<td colspan="5">·{$L['msg_not_found']}</td>
</tr>
<!--#
}
#-->
<!--#if($page_nav){#-->
<tr>
	<td colspan="5">{$page_nav}</td>
</tr>
<!--#}#-->
</table>
</div>
</div>
<!--#}elseif($action =='sendmsg'){#-->
<div id="container">
<div class="box_style">
<form action="{#urr("mydisk","item=message")#}" method="post" onsubmit="return dosubmit(this);">
<input type="hidden" name="action" value="{$action}" />
<input type="hidden" name="task" value="{$action}" />
<input type="hidden" name="username" id="username" value="{$username}" />
<input type="hidden" name="ref" value="{$ref}" />
<input type="hidden" name="formhash" value="{$formhash}" />
<li>{$L['msg_touser']}:</li>
<li><input type="text" name="touser" id="touser" value="{$username}" size="20" maxlength="50" readonly />&nbsp;
<select id="sel_user" name="sel_user" onchange="on_sel_user();">
<!--#
if(count($sel_users)){
#-->
<option value="">{$L['please_select']}</option>
<!--#
	foreach($sel_users as $v){
#-->
<option value="{$v['username']}">{$v['username']}</option>
<!--#
	}
	unset($sel_users);
}else{
#-->
<option disabled="disabled">{$L['none_buddy']}</option>
<!--#
}
#-->
</select>
</li>
<li>{$L['msg_content']}: </li>
<li><textarea name="msg_content" style="width:350px; height:100px;"></textarea></li>
<li><input type="submit" class="btn" value="{$L['btn_submit']}" />&nbsp;&nbsp;<input type="checkbox" id="sb" name="save_box" value="1" /><label for="sb">{$L['save_msg_to_box']}</label></li>
</form>
</div>
</div>
<script language="javascript">
function on_sel_user(){
	getId('username').value = getId('sel_user').options[getId('sel_user').selectedIndex].value;
	getId('touser').value = getId('sel_user').options[getId('sel_user').selectedIndex].value;
}
function dosubmit(o){
	if(o.msg_content.value.strtrim().length <2 || o.msg_content.value.strtrim().length > 1000){
		alert("{$L['msg_min_max']}");
		o.msg_content.focus();
		return false;
	}
}
</script>
<!--#}elseif($action =='view'){#-->
<div id="container">
<div class="box_style">
<form action="{#urr("mydisk","item=message")#}" method="post">
<input type="hidden" name="action" value="reply" />
<input type="hidden" name="username" value="{$msg_array['username']}" />
<input type="hidden" name="msgid" value="{$msg_array['msgid']}" />
<input type="hidden" name="ref" value="{$ref}" />
<input type="hidden" name="formhash" value="{$formhash}" />
<li>{$L['msg_user']}:</li>
<li><input type="text" name="touser" value="{$msg_array['username']}" size="20" maxlength="50" readonly /></li>
<li>{$L['msg_content']}: </li>
<li><textarea name="msg_content" style="width:350px; height:100px;" readonly="readonly">{$msg_array['content']}</textarea></li>
<li>
<!--#if($can_reply){#-->
<input type="submit" class="btn" value="{$L['reply_msg']}" />&nbsp;&nbsp;
<!--#}else{#-->
<input type="button" class="btn" value="{$L['btn_close']}"  onclick="return self.parent.hs.close();" />
<!--#}#-->
</li>
</form>
</div>
</div>
<!--#}elseif($action =='reply'){#-->
<div id="container">
<div class="box_style">
<form action="{#urr("mydisk","item=message")#}" method="post" onsubmit="return dosubmit(this);">
<input type="hidden" name="action" value="{$action}" />
<input type="hidden" name="task" value="reply" />
<input type="hidden" name="username" value="{$username}" />
<input type="hidden" name="msgid" value="{$msgid}" />
<input type="hidden" name="ref" value="{$ref}" />
<input type="hidden" name="formhash" value="{$formhash}" />
<li>{$L['msg_touser']}:</li>
<li><input type="text" name="touser" value="{$username}" size="20" maxlength="50" readonly /></li>
<li>{$L['msg_content']}: </li>
<li><textarea name="msg_content" style="width:350px; height:100px;"></textarea></li>
<li><input type="submit" class="btn" value="{$L['btn_submit']}" />&nbsp;&nbsp;<input type="checkbox" id="sb" name="save_box" value="1" /><label for="sb">{$L['save_msg_to_box']}</label></li>
</form>
</div>
</div>
<script language="javascript">
function dosubmit(o){
	if(o.msg_content.value.strtrim().length <2 || o.msg_content.value.strtrim().length > 1000){
		alert("{$L['msg_min_max']}");
		o.msg_content.focus();
		return false;
	}
}
</script>
<!--#}#-->