<?php
$template = <<<END
<!-- pop1_point: 記事 -->
<section class="pop1_point">
<div class="list-free {val item/bg}">

<!--{ndef item/pos}-->
<p class="point order1 transform3 {val item/point_class}"><span>{val item/point/0}<span>{val item/point/1}</span></span></p>
<div class="text order2">
<h3><span class="fade-in-text">{val item/title}</span></h3>
<div class="markdown-body">{rval item/text}</div>
<!--{def item/link_type}-->
<!--{def item/link}-->
<p class="{val item/link_type}"><a href="{val item/link}">もっと見る</a></p>
<!--{/def}-->
<!--{/def}-->
</div>
<div class="image w2 order3 blur">
<img src="user_data/{val item/image_file}" alt="">
</div>
<!--{/ndef}-->

<!--{def item/pos1}-->
<p class="point order3 transform3 {val item/point_class}"><span>{val item/point/0}<span>{val item/point/1}</span></span></p>
<div class="text order2">
<h3><span class="fade-in-text">{val item/title}</span></h3>
<div class="markdown-body">{rval item/text}</div>
<!--{def item/link_type}-->
<!--{def item/link}-->
<p class="{val item/link_type}"><a href="{val item/link}">もっと見る</a></p>
<!--{/def}-->
<!--{/def}-->
</div>
<div class="image w2 order1 blur">
<img src="user_data/{val item/image_file}" alt="">
</div>
<!--{/def}-->

<!--{def item/pos2}-->
<p class="point order3 transform3 {val item/point_class}"><span>{val item/point/0}<span>{val item/point/1}</span></span></p>
<div class="text order2">
<h3><span class="fade-in-text">{val item/title}</span></h3>
<div class="markdown-body">{rval item/text}</div>
<!--{def item/link_type}-->
<!--{def item/link}-->
<p class="{val item/link_type}"><a href="{val item/link}">もっと見る</a></p>
<!--{/def}-->
<!--{/def}-->
</div>
<div class="image w2 order3 blur">
<img src="user_data/{val item/image_file}" alt="">
</div>
<!--{/def}-->

<!--{def item/pos3}-->
<p class="point order3 transform3 {val item/point_class}"><span>{val item/point/0}<span>{val item/point/1}</span></span></p>
<div class="text order1">
<h3><span class="fade-in-text">{val item/title}</span></h3>
<div class="markdown-body">{rval item/text}</div>
<!--{def item/link_type}-->
<!--{def item/link}-->
<p class="{val item/link_type}"><a href="{val item/link}">もっと見る</a></p>
<!--{/def}-->
<!--{/def}-->
</div>
<div class="image w2 order2 blur">
<img src="user_data/{val item/image_file}" alt="">
</div>
<!--{/def}-->

</div>
<!--/.list-free-->
</section>
END;

$pop1_point = array(
		"title" => "POP1記事",
		"name" => "pop1_point",			// 名称、重複すると正しく動作しません
		"template" => $template,		// ブロックのテンプレートファイル
		"input" => array(
		"help" => array(
			"title" => "使い方",
			"type" => "comment",
			"link" => DOCUMENT1 . "/?act=pop1_point",
			"class" => "notice",
		),
			"title" => array(
				"title" => "タイトル",
				"type" => "text",
			),
			"image" => array(
				"title" => "画像",
				"type" => "image",
			),
			"point" => array(
				"title" => "Point",
				"type" => "text",
				"info" => "空白を挟んで指定（例：特徴 1）",
			),
			"point_class" => array(
				"title" => "Point表示",
				"type" => "select",
				"list" => array(
					"" => "静止",
					"spin" => "回転",
				),
			),
			"text" => array(
				"title" => "説明",
				"type" => "textarea",
			),
			"link" => array(
				"title" => "リンク",
				"type" => "text",
				"info" => "記入しないとリンクは表示されません",
			),
			"bg" => array(
				"title" => "背景",
				"type" => "select",
				"list" => array(
					"" => "なし",
					"bg1" => "あり",
				),
			),
			"pos" => array(
				"title" => "配置",
				"type" => "select",
				"list" => array(
					"" => "右画像配置",
					"1" => "左画像配置",
					"2" => "右画像配置2",
					"3" => "中央画像配置",
				),
			),
			"link_type" => array(
				"title" => "リンク形状",
				"type" => "select",
				"list" => array(
					"" => "リンクなし",
					"btn1" => "四角",
					"btn2" => "丸ボタン",
				)
			),
		),
		"func" => "func_pop1_point",		// 処理プログラム（指定がない物は標準処理）
	);

block_add($pop1_point);


// 記事
function func_pop1_point($def, $info)
{
	$info["image"] = $info["image_file"];
	//
	$ary = explode(" ", $info["point"]);
	$info["point"] = $ary;
	if ($info["pos"]) {
		$info["pos" . $info["pos"]] = $info["pos"];
	}
	return $info;
}
