<!--#
##
#	Project: PHPDISK File Storage Solution
#	This is NOT a freeware, use is subject to license terms.
#
#	Site: http://www.phpdisk.com
#
#	$Id: share.tpl.php 64 2016-07-30 14:01:18Z along $
#
#	Copyright (C) 2008-2016 PHPDisk Team. All Rights Reserved.
#
##
#-->
<?php !defined('IN_PHPDISK') && exit('[PHPDisk] Access Denied!'); ?>
<!--#if($action=='buddy_files' || $action=='corp_files'||$action=='depart_files'||$action=='other_depart_files'){#-->
<script language="javascript">
$(document).ready(function(){
	$("tr.tr_list").each(function(){
		var obj = $(this).find("div.ext_box");
		$(this).mouseover(function(){
			obj.css("display","");
		}).mouseout(function(){
			obj.css("display","none");
		});
	});
	$("#p_mdl").click(function(){ 
	var file_ids=""; 
		$("input[name='file_ids[]']:checkbox:checked").each(function(){ 
			file_ids += $(this).val()+','; 
		}); 
		if(file_ids){
		abox('mydisk.php?item=files&action=multi_down&file_ids='+file_ids,'文件批量下载',450,320);
		}else{
		atips('请选择需要打包下载的文件。');
		}
	}) ;
	$("#cb_select_all").click(function(){
		 $("input[name='file_ids[]']").each(function(){
		 	if($(this).attr("checked")){
				$(this).attr("checked",false);
			}else{
				$(this).attr("checked",true);
			}
		 });
	});
	$("#cb_select_cancel").click(function(){
		 $("input[name='file_ids[]']").attr("checked",false);
	});
});	
<!--#if($action=='buddy_files'){#-->
function view_share_my(fid){
	$('#tr_'+fid).toggle();
	$.ajax({
		type : 'post',
		url : 'ajax.php',
		data : 'action=view_share_my&task=file&fid='+fid+'&t='+Math.random(),
		dataType : 'text',
		success:function(msg){
			var arr = msg.split('|');
			if(arr[0] == 'true'){
				$('#dd_'+fid).html(arr[1]);
			}else{
				atips(msg);
			}
		},
		error:function(){
		}

	});
}
<!--#}#-->
</script>
<div id="container">
<h1>{#$nav_tit[$action]#} 共享文件管理</h1>
<table align="center" width="100%" cellpadding="4" cellspacing="0" border="0" class="td_line">
<tr>
	<td width="50%" class="bold"><?=__('file_name')?></td>
	<td align="center" width="150" class="bold"><?=__('file_size')?></td>
	<td align="center" width="150" class="bold"><?=__('file_upload_time')?></td>
	<td align="right" width="150" class="bold"><?=__('operation')?></td>
</tr>
<!--#
if(count($files)){
	foreach($files as $k => $v){
		$color = ($k%2 ==0) ? 'color1' :'color4';
#-->
<tr class="{$color} tr_list">
	<td><a href="{$v['a_downfile']}" title="<?=__('download')?>">{#file_icon($v['file_extension'])#}</a>
	<!--#if($v['is_image']){#-->
		<a href="javascript:;" onclick="abox('{$v['a_viewfile']}','下载文件',650,450);" id="p_{$k}">{$v['file_name']}</a>
<div id="c_{$k}" class="menu_thumb"><img src="{$v['file_thumb']}" /></div>
<script type="text/javascript">on_menu('p_{$k}','c_{$k}','x','','');</script>
	<!--#}else{#-->
		<a href="javascript:;" onclick="abox('{$v['a_viewfile']}','下载文件',650,450);">{$v['file_name']}</a>
	<!--#}#--><span class="txtgray" title="文件ID">({$v['file_id']})</span>
	<div class="ext_box" style="display:none">
	<span class="txtgray" title="描述">{$v['file_description']}</span></div>
	</td>
	<td align="center">{$v['file_size']}</td>
	<td align="center"  class="txtgray">{$v['file_time']}</td>
	<td align="right">
	<a href="javascript:;" onclick="abox('{$v['a_file_unshare']}','<?=__('file_unshare')?>',400,200);" title="<?=__('file_unshare')?>"><img src="images/cs_file.gif" border="0" align="absmiddle" /></a>
	<!--#if($action=='buddy_files'){#-->
	<a href="javascript:;" onclick="view_share_my({$v[file_id]})" title="查看/删除接收人"><img src="images/link_icon.gif" border="0" align="absmiddle" /></a>
	<!--#}#-->
	</td>
</tr>
<!--#if($action=='buddy_files'){#-->
<tr id="tr_{$v[file_id]}" style="display:none">
	<td colspan="6"><div id="dd_{$v[file_id]}"><img src="images/ajax_loading.gif" align="absmiddle" border="0" /></div></td>
</tr>
<!--#}#-->
<!--#		
	}
}else{
#-->
<tr>
	<td colspan="6" align="center">暂无共享文件</td>
</tr>
<!--#}#-->
<!--#if($page_nav){#-->
<tr>
	<td colspan="6">{$page_nav}</td>
</tr>
<!--#}#-->

</table>
</div>
<!--#}elseif($action=='buddy_folders' || $action=='corp_folders'||$action=='depart_folders'||$action=='other_depart_folders'){#-->
<script language="javascript">
$(document).ready(function(){
	$("tr.tr_list").each(function(){
		var obj = $(this).find("div.ext_box");
		$(this).mouseover(function(){
			obj.css("display","");
		}).mouseout(function(){
			obj.css("display","none");
		});
	});
	$("#p_mdl").click(function(){ 
	var file_ids=""; 
		$("input[name='file_ids[]']:checkbox:checked").each(function(){ 
			file_ids += $(this).val()+','; 
		}); 
		if(file_ids){
		abox('mydisk.php?item=files&action=multi_down&file_ids='+file_ids,'文件批量下载',450,320);
		}else{
		atips('请选择需要打包下载的文件。');
		}
	}) ;
	$("#cb_select_all").click(function(){
		 $("input[name='file_ids[]']").each(function(){
		 	if($(this).attr("checked")){
				$(this).attr("checked",false);
			}else{
				$(this).attr("checked",true);
			}
		 });
	});
	$("#cb_select_cancel").click(function(){
		 $("input[name='file_ids[]']").attr("checked",false);
	});
});
<!--#if($action=='buddy_folders'){#-->
function view_share_my(fid){
	$('#tr_'+fid).toggle();
	$.ajax({
		type : 'post',
		url : 'ajax.php',
		data : 'action=view_share_my&task=folder&fid='+fid+'&t='+Math.random(),
		dataType : 'text',
		success:function(msg){
			var arr = msg.split('|');
			if(arr[0] == 'true'){
				$('#dd_'+fid).html(arr[1]);
			}else{
				atips(msg);
			}
		},
		error:function(){
		}

	});
}
<!--#}#-->
</script>
<div id="container">
<h1>{#$nav_tit[$action]#} 共享目录管理</h1>
<div style="border:1px #CCC solid; padding:5px;">导航： <a href="{#urr("mydisk","item=share&menu=$menu&action=$action")#}">共享目录</a>&nbsp;&raquo;&nbsp;{#get_share_folder_path($folder_id,$pd_uid)#}</div>
<table align="center" width="100%" cellpadding="4" cellspacing="0" border="0" class="td_line">
<tr>
	<td width="50%" class="bold">目录名称</td>
	<td align="center" width="150" class="bold"><?=__('file_size')?></td>
	<td align="center" width="150" class="bold">创建时间</td>
	<td align="right" width="150" class="bold"><?=__('operation')?></td>
</tr>
<!--#
if(count($folders)){
	foreach($folders as $k => $v){
		$color = ($k%2 ==0) ? 'color1' :'color4';
#-->
<tr class="{$color}">
	<td><a href="{$v[a_folder]}"><img src="images/folder.gif" align="absmiddle" border="0" />{$v['folder_name']}</a><span class="txtgray">(ID:{$v['folder_id']})</span>
	</td>
	<td align="center">{$v['folder_size']}</td>
	<td align="center" class="txtgray">{$v['in_time']}</td>
	<td align="right">
	<a href="javascript:;" onclick="abox('{$v['a_folder_unshare']}','取消目录共享',400,200);" title="取消目录共享"><img src="images/cs_file.gif" border="0" align="absmiddle" /></a>
	<!--#if($action=='buddy_folders'){#-->
	<a href="javascript:;" onclick="view_share_my({$v[folder_id]})" title="查看/删除接收人"><img src="images/link_icon.gif" border="0" align="absmiddle" /></a>
	<!--#}#-->
	</td>
</tr>
<!--#if($action=='buddy_folders'){#-->
<tr id="tr_{$v[folder_id]}" style="display:none">
	<td colspan="6"><div id="dd_{$v[folder_id]}"><img src="images/ajax_loading.gif" align="absmiddle" border="0" /></div></td>
</tr>
<!--#}#-->
<!--#		
	}
}
#-->
<!--#
if(count($files) && $folder_id){
	foreach($files as $k => $v){
		$color = ($k%2 ==0) ? 'color1' :'color4';
#-->
<tr class="{$color} tr_list">
	<td><a href="{$v['a_downfile']}" title="<?=__('download')?>">{#file_icon($v['file_extension'])#}</a>
	<!--#if($v['is_image']){#-->
		<a href="javascript:;" onclick="abox('{$v['a_viewfile']}','下载文件',650,450);" id="p_{$k}">{$v['file_name']}</a>
<div id="c_{$k}" class="menu_thumb"><img src="{$v['file_thumb']}" /></div>
<script type="text/javascript">on_menu('p_{$k}','c_{$k}','x','','');</script>
	<!--#}else{#-->
		<a href="javascript:;" onclick="abox('{$v['a_viewfile']}','下载文件',650,450);">{$v['file_name']}</a>
	<!--#}#--><span class="txtgray" title="文件ID">({$v['file_id']})</span>
	<div class="ext_box" style="display:none">
	<span class="txtgray" title="描述">{$v['file_description']}</span></div>
	</td>
	<td align="center">{$v['file_size']}</td>
	<td align="center"  class="txtgray">{$v['file_time']}</td>
	<td align="right">
	<a href="javascript:;" onclick="abox('{$v['a_file_unshare']}','<?=__('file_unshare')?>',400,200);" title="<?=__('file_unshare')?>"><img src="images/cs_file.gif" border="0" align="absmiddle" /></a>
	</td>
</tr>
<!--#		
	}
}
if(!count($files) && !count($folders)){
#-->
<tr>
	<td colspan="6" align="center">此目录暂无文件记录</td>
</tr>
<!--#}#-->
</table>
</div>

<!--#}elseif($action=='share_file'){#-->
<div id="container">
<div class="box_style">
<form action="{#urr("mydisk","item=$item")#}" method="post">
<input type="hidden" name="action" value="{$action}" />
<input type="hidden" name="task" value="{$action}" />
<input type="hidden" name="file_ids" value="{$file_ids}" />
<input type="hidden" name="sel_type" value="{$sel_type}" />
<input type="hidden" name="ref" value="{$ref}" />
<input type="hidden" name="formhash" value="{$formhash}" />
<table width="100%" cellpadding="4" cellspacing="0" border="0">
<tr>
	<td width="50%" valign="top">共享文件:<br /><div class="share_box">
	<!--#if(count($file_arr)){
		foreach($file_arr as $v){
	#-->
	<li title="{$v[file_name]}">{#file_icon($v[file_extension])#}{$v[file_name]}</li>
	<!--#
		}
	}#-->
	</div></td>	<td valign="top">共享给: <br />
	<!--#if($sel_type=='corp'){#-->
	<select size="10" style="width:250px; height:200px">
	<option selected="selected">公司共享文件</option>
	</select>
	<!--#}elseif($sel_type=='depart'){#-->
	<select size="10" style="width:250px; height:200px">
	<option selected="selected">部门共享文件</option>
	</select>
	<!--#}elseif($sel_type=='other_depart'){#-->
		<select name="depart_ids[]" multiple="multiple" size="10" style="width:250px; height:200px">
		<!--#
		$arr = get_departs(0);
		if(count($arr)){
			foreach($arr as $v){
		#-->
		<option value="{$v[depart_id]}">{$v[depart_name]}</option>
		<!--#
			}
		}
		#-->
	</select><br /><span class="txtgray">按Ctrl+点击可实现多部门选择</span>
	<!--#}else{#-->
		<select name="touserids[]" multiple="multiple" size="10" style="width:250px; height:200px">
		<!--#
		if(count($buddys_arr)){
			foreach($buddys_arr as $v){
		#-->
		<option value="{$v[touserid]}">{$v[username]}</option>
		<!--#
			}
		}
		#-->
	</select><br /><span class="txtgray">按Ctrl+点击可实现多用户选择</span>
	<!--#}#-->
	</td>

</tr>
<tr>
	<td colspan="2" align="center"><input type="submit" class="btn_green" value="<?=__('btn_submit')?>" /></td>
</tr>
</table>
</form>
</div>
</div>
<!--#}elseif($action=='public_file'){#-->
<div id="container">
<div class="box_style">
<form action="{#urr("mydisk","item=$item")#}" method="post">
<input type="hidden" name="action" value="{$action}" />
<input type="hidden" name="task" value="{$action}" />
<input type="hidden" name="file_ids" value="{$file_ids}" />
<input type="hidden" name="ref" value="{$ref}" />
<input type="hidden" name="formhash" value="{$formhash}" />
<table width="100%" cellpadding="4" cellspacing="0" border="0">
<tr>
	<td width="50%" valign="top">共享文件:<br /><div class="share_box">
	<!--#if(count($file_arr)){
		foreach($file_arr as $v){
	#-->
	<li title="{$v[file_name]}">{#file_icon($v[file_extension])#}{$v[file_name]}</li>
	<!--#
		}
	}#-->
	</div></td>	<td valign="top">共享给分类: <br />
	<select name="cate_id" size="10" style="width:250px; height:200px">
	{#get_cate_option()#}
	</select>
	</td>

</tr>
<tr>
	<td colspan="2" align="center"><input type="submit" class="btn_green" value="<?=__('btn_submit')?>" /></td>
</tr>
</table>
</form>
</div>
</div>
<!--#}elseif($action=='cancle_public_file'){#-->
<div id="container">
<div class="box_style">
<form action="{#urr("mydisk","item=$item")#}" method="post">
<input type="hidden" name="action" value="{$action}" />
<input type="hidden" name="task" value="{$action}" />
<input type="hidden" name="file_ids" value="{$file_ids}" />
<input type="hidden" name="ref" value="{$ref}" />
<input type="hidden" name="formhash" value="{$formhash}" />
<table width="100%" cellpadding="4" cellspacing="0" border="0">
<tr>
	<td width="50%" valign="top">取消公共共享文件:<br /><div class="share_box">
	<!--#if(count($file_arr)){
		foreach($file_arr as $v){
	#-->
	<li title="{$v[file_name]}">{#file_icon($v[file_extension])#}{$v[file_name]}</li>
	<!--#
		}
	}#-->
	</div></td>
<tr>
	<td colspan="2" align="center"><input type="submit" class="btn_green" value="<?=__('btn_submit')?>" /></td>
</tr>
</table>
</form>
</div>
</div>
<!--#}elseif($action=='share_folder'){#-->
<div id="container">
<div class="box_style">
<form action="{#urr("mydisk","item=$item")#}" method="post" onsubmit="return dosubmit(this)">
<input type="hidden" name="action" value="{$action}" />
<input type="hidden" name="task" value="{$action}" />
<input type="hidden" name="sel_type" value="{$sel_type}" />
<input type="hidden" name="ref" value="{$ref}" />
<input type="hidden" name="formhash" value="{$formhash}" />
<table width="100%" cellpadding="4" cellspacing="0" border="0">
<tr>
	<td width="50%" valign="top">共享目录:<br /><div class="share_box">
	{#get_folder_list();#}
	</div></td>
	<td valign="top">共享给: <br />
	<!--#if($sel_type=='corp'){#-->
	<select size="10" style="width:250px; height:200px">
	<option selected="selected">公司共享文件</option>
	</select>
	<!--#}elseif($sel_type=='depart'){#-->
	<select size="10" style="width:250px; height:200px">
	<option selected="selected">部门共享文件</option>
	</select>
	<!--#}elseif($sel_type=='other_depart'){#-->
		<select name="depart_ids[]" multiple="multiple" size="10" style="width:250px; height:200px">
		<!--#
		$arr = get_departs(0);
		if(count($arr)){
			foreach($arr as $v){
		#-->
		<option value="{$v[depart_id]}">{$v[depart_name]}</option>
		<!--#
			}
		}
		#-->
	</select><br /><span class="txtgray">按Ctrl+点击可实现多部门选择</span>
	<!--#}else{#-->
		<select name="touserids[]" multiple="multiple" size="10" style="width:250px; height:200px">
		<!--#
		if(count($buddys_arr)){
			foreach($buddys_arr as $v){
		#-->
		<option value="{$v[touserid]}">{$v[username]}</option>
		<!--#
			}
		}
		#-->
	</select><br /><span class="txtgray">按Ctrl+点击可实现多用户选择</span>
	<!--#}#-->
	</td>
</tr>
<tr>
	<td colspan="2" align="center"><input type="submit" class="btn_green" value="<?=__('btn_submit')?>" /></td>
</tr>
</table>
</form>
</div>
</div>
<script type="text/javascript">
function dosubmit(o){
	if(checkbox_ids("folder_ids[]") != true){
		atips("请选择需要共享的目录");
		return false;
	}
}
</script>
<!--#
}elseif($action =='unshare_file'||$action=='unshare_folder'){
#-->
<div id="container">
<div class="box_style">
<form action="{#urr("mydisk","item=share")#}" method="post">
<input type="hidden" name="action" value="{$action}" />
<input type="hidden" name="task" value="{$action}" />
<!--#if($action =='unshare_file'){#-->
<input type="hidden" name="file_id" value="{$file_id}" />
<!--#}else{#-->
<input type="hidden" name="folder_id" value="{$folder_id}" />
<!--#}#-->
<input type="hidden" name="sel_type" value="{$sel_type}" />
<input type="hidden" name="ref" value="{$ref}" />
<input type="hidden" name="formhash" value="{$formhash}" />
<li>&nbsp;</li>
<!--#if($action =='unshare_file'){#-->
<li>{#file_icon($file_extension)#}&nbsp;<span class="txtgreen">{$file_name}</span></li>
<li><?=__('unshare_file_confirm')?>接收此文件的用户共享将会全部失效！</li>
<!--#}else{#-->
<li><img src="images/folder.gif" align="absmiddle" border="0" />&nbsp;<span class="txtgreen">{$folder_name}</span></li>
<li>确认取消此目录共享吗？接收此目录的用户共享将会全部失效！</li>
<!--#}#-->
<li>&nbsp;</li>
<li><input type="submit" class="btn_green" value="<?=__('btn_submit')?>" /></li>
</form>
</div>
</div>

<!--#}#-->
