<!--#
##
#	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 28 2014-01-29 03:12:01Z along $
#
#	Copyright (C) 2008-2016 PHPDisk Team. All Rights Reserved.
#
##
#-->
<?php !defined('IN_PHPDISK') && exit('[PHPDisk] Access Denied!'); ?>
<!--#if($action =='category'){#-->
<div id="container">
<h1><?=__('menu_public_category')?><!--#sitemap_tag(__('menu_public_category'));#--></h1>
<div>
<div class="tips_box"><img class="img_light" src="images/light.gif" align="absmiddle" /> <b><?=__('tips')?>: </b>
<span class="txtgray"><?=__('category_title_tips')?></span>
</div>
<form name="link_form" action="{#urr(ADMINCP,"item=$item&menu=file")#}" method="post">
<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">
<!--#
if($cate_tree){
#-->
<tr>
	<td width="40%" class="bold"><?=__('show_order')?>|<?=__('cate_name')?></td>
	<td align="center" class="bold"><?=__('file_num')?></td>
	<td align="right" width="100" class="bold"><?=__('operation')?></td>
</tr>
{$cate_tree}

<!--#
}else{	
#-->
<tr>
	<td colspan="6" align="center"><?=__('category_not_found')?></td>
</tr>
<!--#
}
#-->
<tr>
	<td align="center" colspan="5">
	<input type="button" class="btn" value="添加分类" onclick="go('{#urr(ADMINCP,"item=$item&menu=file&action=add_cate")#}');" />&nbsp;
	<input type="submit" class="btn" value="<?=__('btn_update')?>"/>
	</td>
</tr>
</table>
</form>
</div>
</div>
<!--#}elseif($action =='add_cate' || $action =='modify_cate'){#-->
<div id="container">
<!--#if($action =='add_cate'){#-->
<h1><?=__('add_cate_title')?></h1>
<!--#}else{#-->
<h1><?=__('modify_cate_title')?></h1>
<!--#}#-->
<div>
<div class="tips_box"><img class="img_light" src="images/light.gif" align="absmiddle" /> <b><?=__('tips')?>: </b>
<span class="txtgray"><?=__('add_cate_title_tips')?></span>
</div>
<form action="{#urr(ADMINCP,"item=$item&menu=file")#}" method="post" onsubmit="return dosubmit(this);">
<input type="hidden" name="action" value="{$action}" />
<input type="hidden" name="task" value="{$action}" />
<input type="hidden" name="cate_id" value="{$cate_id}" />
<input type="hidden" name="formhash" value="{$formhash}" />
<table align="center" width="100%" cellpadding="4" cellspacing="0" border="0" class="td_line">
<tr>
	<td width="30%"><span class="bold"><?=__('pid')?>:</span><br /><span class="txtgray">添加多个分类，可以让用户上传文件到相应的分类下，支持无限级分类。</span></td>
	<td>
	<select name="pid">
	<option value="0" style="color:#008800"><?=__('top_cate')?></option>
	{#get_cate_option(0,$pid)#}
	</select>
	</td>
</tr>
<tr>
	<td><span class="bold"><?=__('cate_name')?>:</span><br /><span class="txtgray"><?=__('cate_name_tips')?></span></td>
	<td><input type="text" name="cate_name" value="{$cate_name}" maxlength="50" /></td>
</tr>
<tr>
	<td><span class="bold"><?=__('is_hidden')?>:</span><br /><span class="txtgray"><?=__('is_hidden_tips')?></span></td>
	<td><input type="radio" name="is_hidden" value="1" {#ifchecked($is_hidden,1)#} /><?=__('yes')?>&nbsp;&nbsp;<input type="radio" name="is_hidden" value="0" {#ifchecked($is_hidden,0)#} /><?=__('no')?></td>
</tr>
<tr>
	<td>&nbsp;</td>
	<td><input type="submit" class="btn" value="<?=__('btn_submit')?>"/>&nbsp;<input type="button" class="btn" value="<?=__('btn_back')?>" onclick="javascript:history.back();" /></td>
</tr>
</table>
</form>
</div>
</div>
<script language="javascript">
function dosubmit(o){
	if(o.cate_name.value.strtrim().length <1){
		atips("<?=__('cate_name_error')?>");
		o.cate_name.focus();
		return false;
	}
}
</script>
<!--#}elseif($action =='viewfile'){#-->
<script type="text/javascript">
function ck(){
	if($('#ts_move_to').is(':checked')){
		$('#to_cate_id').attr('disabled',false);
	}else{
		$('#to_cate_id').attr('disabled',true);
	}
}
</script>
<div id="container">
<h1>公共文件管理<!--#sitemap_tag('公共文件管理');#--></h1>
<div>
<div class="tips_box"><img class="img_light" src="images/light.gif" align="absmiddle" /> <b><?=__('tips')?>: </b>
<span class="txtgray"><?=__('public_setting_tips')?></span>
</div>
<div class="search_box">
<img src="{$admin_tpl_dir}images/it_nav.gif" align="absbottom" />
<?=__('view_mode')?>: 
<select name="cate_id" id="cate_id" onchange="chg_view();">
<option value="0" {#ifselected($cate_id,0)#}>最近更新</option>
<option value="-1" {#ifselected($cate_id,-1)#}>未审核</option>
<option disabled="disabled">- 分类浏览 -</option>
{#get_cate_option(0,$cate_id);#}
</select>
</div>
<form name="file_frm" action="{#urr(ADMINCP,"item=$item&menu=file")#}" method="post" onsubmit="return dosubmit(this);">
<input type="hidden" name="action" value="{$action}"/>
<input type="hidden" name="formhash" value="{$formhash}" />
<table align="center" width="100%" cellpadding="4" cellspacing="0" border="0" class="td_line">
<!--#
if(count($files_array)){
#-->
<tr>
	<td width="40%" class="bold"><?=__('file_name')?></td>
	<td align="center" width="10%" class="bold">上传人</td>
	<td align="center" width="10%" class="bold"><?=__('file_status')?></td>
	<td align="center" class="bold"><?=__('file_size')?></td>
	<td width="150" class="bold"><?=__('file_upload_time')?>|发布时间</td>
	<td align="center" width="100" class="bold"><?=__('upload_ip')?></td>
</tr>
<!--#
	foreach($files_array as $k => $v){
		$color = ($k%2 ==0) ? 'color1' :'color4';
#-->
<tr class="{$color}">
	<td><input type="checkbox" name="file_ids[]" id="file_ids" value="{$v['file_id']}" />&nbsp;<a href="{$v['a_downfile']}" title="<?=__('download')?>">{#file_icon($v['file_extension'])#}</a>&nbsp;
	<!--#if($v['is_image']){#-->
	<a href="{$v['a_viewfile']}" id="p_{$k}" target="_blank" title="{$v['file_name_all']} {$v['file_size']}">{$v['file_name']}</a>&nbsp;[<a href="{$v[a_cate]}" title="所属分类">{$v[cate_name]}</a>]<br />
<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="{$v['a_viewfile']}" target="_blank" title="{$v['file_name_all']} {$v['file_size']}">{$v['file_name']}</a>&nbsp;[<a href="{$v[a_cate]}" title="所属分类">{$v[cate_name]}</a>]
	<!--#}#-->
	</td>
	<td align="center">{$v['username']}</td>
	<td align="center">{$v['status_txt']}</td>
	<td align="center">{$v['file_size']}</td>
	<td class="txtgray">{$v['file_time']}<br />{$v[pub_time]}</td>
	<td align="center" class="txtgray">{$v['ip']}</td>
</tr>
<!--#		
	}
	unset($files_array);
#-->
<tr>
	<td colspan="6"><a href="javascript:void(0);" onclick="reverse_ids(document.file_frm.file_ids);"><?=__('select_all')?></a>&nbsp;&nbsp;<a href="javascript:void(0);" onclick="cancel_ids(document.file_frm.file_ids);"><?=__('select_cancel')?></a>&nbsp;&nbsp;
	<input type="radio" name="task" value="check_file" checked="checked" onclick="ck()" />审核成功 
	<input type="radio" name="task" value="uncheck_file" onclick="ck()"/><span class="txtred">退回推送</span>
	<input type="radio" name="task" value="move_to" id="ts_move_to" onclick="ck()" />移动到:<select id="to_cate_id" name="to_cate_id" disabled="disabled"><option value="0">- 请选择分类 -</option>{#get_cate_option()#}</select>
	<input type="submit" class="btn" value="<?=__('btn_submit')?>"/></td>
</tr>
<!--#		
}else{
#-->
<tr>
	<td colspan="6"><?=__('file_not_found')?></td>
</tr>
<!--#
}
#-->
<!--#if($page_nav){#-->
<tr>
	<td colspan="6">{$page_nav}</td>
</tr>
<!--#}#-->
</table>
</form>
</div>
</div>
<script language="javascript">
function chg_view(){
	var cate_id = getId('cate_id').value.strtrim();
	document.location.href = '{#urr(ADMINCP,"item=$item&menu=file&action=$action&cate_id='+cate_id+'")#}';
}
function dosubmit(o){
	if(checkbox_ids("file_ids[]") != true){
		atips("<?=__('please_select_operation_files')?>");
		return false;
	}
}
</script>
<!--#}else{#-->
<div id="container">
<h1><?=__('menu_public_setting')?><!--#sitemap_tag(__('menu_public_setting'));#--></h1>
<div>
<div class="tips_box"><img class="img_light" src="images/light.gif" align="absmiddle" /> <b><?=__('tips')?>: </b>
<span class="txtgray">公共文件允许任意用户、访客进行访问并下载其中的文件</span>
</div>
<form action="{#urr(ADMINCP,"item=$item&menu=file")#}" method="post">
<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="30%"><span class="bold">是否使用公共文件功能</span>: <br /><span class="txtgray">允许任意用户、访客进行访问并下载其中的文件，同时允许用户推送自己的文件为公共文件。</span></td>
	<td><input type="radio" name="setting[open_public_file]" value="1" {#ifchecked(1,$setting['open_public_file'])#} /> <?=__('yes')?>&nbsp;&nbsp;<input type="radio" name="setting[open_public_file]" value="0" {#ifchecked(0,$setting['open_public_file'])#}/> <?=__('no')?></td>
</tr>
<tr>
	<td>&nbsp;</td>
	<td><input type="submit" class="btn" value="<?=__('btn_update')?>"/></td>
</tr>
</table>
</form>
</div>
</div>
<!--#}#-->

