<!--#
##
#	Project: PHPDISK File Storage Solution
#	This is NOT a freeware, use is subject to license terms.
#
#	Site: http://www.phpdisk.com
#
#	$Id: public.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'){#-->
<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");
		});
	});
	$("#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_user(fid){
	$('#tr_'+fid).toggle();
	$.ajax({
		type : 'post',
		url : 'ajax.php',
		data : 'action=view_share_user&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="40%" class="bold"><?=__('file_name')?></td>
	<td align="center" class="bold">共享人</td>
	<td align="center" 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['username']}</td>
	<td align="center">{$v['file_size']}</td>
	<td align="center"  class="txtgray">{$v['file_time']}</td>
	<td align="right">
	<!--#if($action=='buddy_files'){#-->
	<a href="javascript:;" onclick="view_share_user({$v[file_id]})" title="查看共享人"><img src="images/link_icon.gif" border="0" align="absmiddle" /></a>
	<!--#}#-->&nbsp;
	</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'){#-->
<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");
		});
	});
	$("#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_user(fid){
	$('#tr_'+fid).toggle();
	$.ajax({
		type : 'post',
		url : 'ajax.php',
		data : 'action=view_share_user&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=public&menu=$menu&action=$action")#}">共享目录</a>&nbsp;&raquo;&nbsp;{#get_share_folder_path($folder_id,$userid)#}</div>
<table align="center" width="100%" cellpadding="4" cellspacing="0" border="0" class="td_line">
<tr>
	<td width="40%" class="bold">目录名称</td>
	<td align="center" class="bold">共享人</td>
	<td align="center" 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['username']}</td>
	<td align="center">{$v['folder_size']}</td>
	<td align="center" class="txtgray">{$v['in_time']}</td>
	<td align="right">
	<!--#if($action=='buddy_folders'){#-->
	<a href="javascript:;" onclick="view_share_user({$v[folder_id]})" title="查看共享人"><img src="images/link_icon.gif" border="0" align="absmiddle" /></a>
	<!--#}#-->&nbsp;
	</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>
<!--#}#-->
	</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['username']}</td>
	<td align="center">{$v['file_size']}</td>
	<td align="center" class="txtgray">{$v['file_time']}</td>
	<td align="right">&nbsp;</td>
</tr>
<!--#		
	}
}
if(!count($files) && !count($folders)){
#-->
<tr>
	<td colspan="6" align="center">此目录暂无文件记录</td>
</tr>
<!--#}#-->
</table>
</div>
<!--#}#-->
