<?php
$template = <<<END
<!--{def item/pdf}-->
<!--block_file:ダウンロード-->
<section class="block_file">
<table class="ta1">
<tr>
<th>{val item/title}</th>
<td>
<a href="?act=get_file&id={val item/pdf}">{val item/pdf_name}</a>
</td>
</tr>
<!--{def item/contents}-->
<tr>
<th>説明</th>
<td class="markdown-body">
{rval item/contents}
</td>
</tr>
<!--{/def}-->
</table>

</section>
<!--{/def}-->
END;

$block_file = array(
	"title" => "ファイルダウンロード",
	"name" => "block_file",			// 名称、重複すると正しく動作しません
	"template" => $template,		// ブロックのテンプレート
	"input" => array(
		"help" => array(
			"title" => "使い方",
			"type" => "comment",
			"link" => DOCUMENT1 . "/?act=block_file",
			"class" => "notice",
		),
		"title" => array(
			"title" => "タイトル",
			"type" => "text",
		),
		"pdf" => array(
			"title" => "ファイル",
			"type" => "file",
		),
		"contents" => array(
			"title" => "説明",
			"type" => "textarea",
		),
	),
);

block_add($block_file);
