<?php
$template = <<<END
<!-- haken1_interview: haken1インタビュー -->
<!--{def item/format1}-->
<section>
<h2>{val item/title}</h2>
<!--{def item/image}-->
<figure class="mb30 c"><img src="user_data/{val item/image_file}" alt=""></figure>
<!--{/def}-->
<p>{rval item/text}</p>
</section>
<!--{/def}-->
<!--{def item/format2}-->
<section class="bg1">
<h2 class="hidden">大見出し</h2>
<div class="c2">
<div class="text l">
<h2>{val item/title}</h2>
<p>{rval item/text}</p>
</div>
<!--/.text-->
<div class="image r">
<!--{def item/image}-->
<figure><img src="user_data/{val item/image_file}" alt=""></figure>
<!--{/def}-->
</div>
<!--/.image-->
</div>
</section>
<!--{/def}-->
<!--{def item/format3}-->
<section class="bg2">
<h2 class="hidden">大見出し</h2>
<div class="c2">
<div class="text r">
<h2>{val item/title}</h2>
<p>{rval item/text}</p>
</div>
<!--/.text-->
<div class="image l">
<!--{def item/image}-->
<figure><img src="user_data/{val item/image_file}" alt=""></figure>
<!--{/def}-->
</div>
<!--/.image-->
</div>
</section>
<!--{/def}-->
END;

$haken1_interview = array(
	"title" => "haken1インタビュー",
	"name" => "haken1_interview",			// 名称、重複すると正しく動作しません
	"template" => $template,		// ブロックのテンプレート
	"input" => array(
		"help" => array(
			"title" => "使い方",
			"type" => "comment",
			"link" => DOCUMENT1 . "/?act=haken1_interview",
			"class" => "notice",
		),
        "format" => array(
            "title" => "書式",
            "type" => "select",
            "list" => array(
                "1" => "画像大",
                "2" => "画像左",
                "3" => "画像右",
            ),
        ),
        "class" => array(
            "title" => "背景",
            "type" => "select",
            "list" => array(
                "" => "なし",
                "bg1" => "色1",
                "bg2" => "色2",
                "bg3" => "色3",
            ),
        ),
        "title" => array(
			"title" => "タイトル",
			"type" => "text",
		),
		"image" => array(
			"title" => "画像",
			"type" => "image",
		),
		"text" => array(
			"title" => "内容",
			"type" => "textarea",
		),
	),
	"func" => "func_haken1_interview",
);

block_add($haken1_interview);

function func_haken1_interview($def, $info)
{
	if ($info["format"]) {
		$info["format" . $info["format"]] = $info["format"];
	}
	return $info;
}
