<?php include_once( "../../../../spider.inc.php" ); ?>
{charset:UTF-8}
{template:admin_innerblock.tpl}
{module:content.LoadFolders}
{module:content.upload.Form}

<link rel="stylesheet" type="text/css" media="screen,tv" href="/<?php echo SYSTEM_DIR_NAME_ADMIN_PANEL; ?>/css/common.css.php" />
<link rel="stylesheet" type="text/css" media="screen" href="/<?php echo SYSTEM_DIR_NAME_ADMIN_PANEL; ?>/css/contents.css.php" />
<link rel="stylesheet" type="text/css" media="print" href="/<?php echo SYSTEM_DIR_NAME_ADMIN_PANEL; ?>/css/print.css.php" />

	<h1>コンテンツ管理 &gt; アップロードファイル一覧 &gt; ファイルアップロード</h1>
	
{if:IS_ERROR}
	<ul class="error">
	{foreach:errors error}
		<li style="color:#FF0000;">{write:error}</li>
	{/foreach}
	</ul>
{else}

	<form name="mform" action="/<?php echo SYSTEM_DIR_NAME_ADMIN_PANEL; ?>/content/file/upload/ajax_execute.php" method="post" enctype="multipart/form-data" target="upload_frame">

	{if:content.upload.folderSelect}
	<p>アップロードフォルダを選択してファイルをアップロードしてください。</p>
	<p>
		アップロード先: <select name="target_uri" style="font-size:16px;margin:0px;padding:0px;">
		{foreach:content.folderArray folderPath}{if:preg_match('/^\\/upload/',folderPath)>0}
			<option value="{write:folderPath}"
				{if:content.upload.targetUri==folderPath} selected{set:folderExist 'true'}{/if}
				>{write:folderPath}</option>
		{/if}{/foreach}
		{if:strlen(content.upload.targetUri)>0 && folderExist!='true'}
			<option value="{write:content.upload.targetUri}" selected>{write:content.upload.targetUri}</option>
		{/if}
		</select>
		{if:is_array(content.upload.uploadName)}
			<br />
			{foreach:content.upload.uploadName upname}
			{write:upname} 
			<input type="file" name="upfile[]" size="50" style="margin:0px;padding:0px;" value="" />
			<input type="hidden" name="regist_file_name[]" value="{write:upname}" /><br />
			{/foreach}
			<br />
		{else-if:strlen(content.upload.uploadName)>0}
			/{write:content.upload.uploadName}
			<br />
			<input type="file" name="upfile[]" size="50" style="margin:0px;padding:0px;" value="" />
			<input type="hidden" name="regist_file_name[]" value="{write:content.upload.uploadName}" />
			<br />
		{else}
			/
			<br /><input type="file" name="upfile[]" size="50" style="margin:0px;padding:0px;" value="" />
		{/if}
	</p>
	{else}
		アップロード先:
		{if:strlen(content.upload.targetUri)>0}
			{write:content.upload.targetUri}
			<input type="hidden" name="target_uri" value="{write:content.upload.targetUri}" />
		{else}
			/upload
			<input type="hidden" name="target_uri" value="/upload" />
		{/if}
		{if:is_array(content.upload.uploadName)}
			<br />
			{foreach:content.upload.uploadName upname}
			{write:upname} 
			<input type="file" name="upfile[]" size="50" style="margin:0px;padding:0px;" value="" />
			<input type="hidden" name="regist_file_name[]" value="{write:upname}" /><br />
			{/foreach}
			<br />
		{else-if:strlen(content.upload.uploadName)>0}
			/{write:content.upload.uploadName}
			<br />
			<input type="file" name="upfile[]" size="50" style="margin:0px;padding:0px;" value="" />
			<input type="hidden" name="regist_file_name[]" value="{write:content.upload.uploadName}" />
			<br />
		{else}
			/
			<br /><input type="file" name="upfile[]" size="50" style="margin:0px;padding:0px;" value="" />
		{/if}
	{/if}
	<table style="width:740px;margin:0 auto;">
	<tbody>
	<tr>
		<td style="text-align:center;">
			<input type="submit" value="アップロード実行"
			/><input type="button" value="閉じる" onclick="contentFileViewUploadFormClose()"
			/>
			<br />
			<span style="font-size:x-small;color:#ff8030;">※JPEG/GIF/PNG/CSS/JS/PDFのみ対応しています。</span>
		</td>
	</tr>
	</tbody>
	</table>
	</form>
	<iframe id="upload_frame" name="upload_frame" style="visibility:hidden;width:0px;height:0px;"></iframe>
	<img src="/<?php echo SYSTEM_DIR_NAME_ADMIN_PANEL; ?>/images/transparent.gif" onload="contentFileViewUploadFormResize();" />
{/if}