<?php
$template = <<<END
<!-- foods10_menu: メニュー -->
<section id="menu1" class="foods10_menu">
<!--{def item/title}-->
<h2><span class="uline">{val item/title}</span><!--{def item/subtitle}--><span class="small">{val item/subtitle}</span><!--{/def}--></h2>
<!--{/def}-->
<div class="list-menu">
<!--{each item/list}-->
<div class="list {val item/list/view}">
<!--{def item/list/image}-->
<figure><img src="user_data/{val item/list/image}" alt=""></figure>
<!--{/def}-->
<div class="text">
<h4>{val item/list/title}<span class="price">{val item/list/price}</span></h4>
<p class="markdown-body">{rval item/list/text}</p>
</div>
<!--{def item/list/icon}-->
<span class="newicon">{val item/list/icon}</span>
<!--{/def}-->
</div>
<!--{/each}-->
</div>
<!--/.list-menu-->
</section>
END;

$foods10_menu = array(
	"title" => "メニュー(画像付き)",
	"name" => "foods10_menu",			// 名称、重複すると正しく動作しません
	"template" => $template,		// ブロックのテンプレート
	"input" => array(
		"title" => array(
			"title" => "タイトル",
			"type" => "text",
		),
		"subtitle" => array(
			"title" => "サブタイトル",
			"type" => "text",
		),
		"dummy1" => array(
			"title" => " ",
			"type" => "comment",
		),
		"title1" => array(
			"title" => "タイトル1",
			"type" => "text",
		),
		"price1" => array(
			"title" => "価格1",
			"type" => "text",
		),
		"text1" => array(
			"title" => "説明1",
			"type" => "textarea",
		),
		"image1" => array(
			"title" => "画像1",
			"type" => "image",
		),
		"view1" => array(
			"title" => "出現1",
			"type" => "select",
			"list" => array(
				"" => "なし",
				"up" => "上から",
				"down" => "下から",
				"transform1" => "横回転",
				"transform2" => "縦回転",
				"blur" => "徐々に",
			),
		),
		"icon1" => array(
			"title" => "アイコン1",
			"type" => "text",
		),
		"dummy2" => array(
			"title" => " ",
			"type" => "comment",
		),
		"title2" => array(
			"title" => "タイトル2",
			"type" => "text",
		),
		"price2" => array(
			"title" => "価格2",
			"type" => "text",
		),
		"text2" => array(
			"title" => "説明2",
			"type" => "textarea",
		),
		"image2" => array(
			"title" => "画像2",
			"type" => "image",
		),
		"view2" => array(
			"title" => "出現2",
			"type" => "select",
			"list" => array(
				"" => "なし",
				"up" => "上から",
				"down" => "下から",
				"transform1" => "横回転",
				"transform2" => "縦回転",
				"blur" => "徐々に",
			),
		),
		"icon2" => array(
			"title" => "アイコン2",
			"type" => "text",
		),
		"dummy3" => array(
			"title" => " ",
			"type" => "comment",
		),
		"title3" => array(
			"title" => "タイトル3",
			"type" => "text",
		),
		"price3" => array(
			"title" => "価格3",
			"type" => "text",
		),
		"text3" => array(
			"title" => "説明3",
			"type" => "textarea",
		),
		"image3" => array(
			"title" => "画像3",
			"type" => "image",
		),
		"view3" => array(
			"title" => "出現3",
			"type" => "select",
			"list" => array(
				"" => "なし",
				"up" => "上から",
				"down" => "下から",
				"transform1" => "横回転",
				"transform2" => "縦回転",
				"blur" => "徐々に",
			),
		),
		"icon3" => array(
			"title" => "アイコン3",
			"type" => "text",
		),
		"dummy4" => array(
			"title" => " ",
			"type" => "comment",
		),
		"title4" => array(
			"title" => "タイトル4",
			"type" => "text",
		),
		"price4" => array(
			"title" => "価格4",
			"type" => "text",
		),
		"text4" => array(
			"title" => "説明4",
			"type" => "textarea",
		),
		"image4" => array(
			"title" => "画像4",
			"type" => "image",
		),
		"view4" => array(
			"title" => "出現4",
			"type" => "select",
			"list" => array(
				"" => "なし",
				"up" => "上から",
				"down" => "下から",
				"transform1" => "横回転",
				"transform2" => "縦回転",
				"blur" => "徐々に",
			),
		),
		"icon4" => array(
			"title" => "アイコン4",
			"type" => "text",
		),
		"dummy5" => array(
			"title" => " ",
			"type" => "comment",
		),
		"title5" => array(
			"title" => "タイトル5",
			"type" => "text",
		),
		"price5" => array(
			"title" => "価格5",
			"type" => "text",
		),
		"text5" => array(
			"title" => "説明5",
			"type" => "textarea",
		),
		"image5" => array(
			"title" => "画像5",
			"type" => "image",
		),
		"view5" => array(
			"title" => "出現5",
			"type" => "select",
			"list" => array(
				"" => "なし",
				"up" => "上から",
				"down" => "下から",
				"transform1" => "横回転",
				"transform2" => "縦回転",
				"blur" => "徐々に",
			),
		),
		"icon5" => array(
			"title" => "アイコン5",
			"type" => "text",
		),
		"dummy6" => array(
			"title" => " ",
			"type" => "comment",
		),
		"title6" => array(
			"title" => "タイトル6",
			"type" => "text",
		),
		"price6" => array(
			"title" => "価格6",
			"type" => "text",
		),
		"text6" => array(
			"title" => "説明6",
			"type" => "textarea",
		),
		"image6" => array(
			"title" => "画像6",
			"type" => "image",
		),
		"view6" => array(
			"title" => "出現6",
			"type" => "select",
			"list" => array(
				"" => "なし",
				"up" => "上から",
				"down" => "下から",
				"transform1" => "横回転",
				"transform2" => "縦回転",
				"blur" => "徐々に",
			),
		),
		"icon6" => array(
			"title" => "アイコン6",
			"type" => "text",
		),
		"dummy7" => array(
			"title" => " ",
			"type" => "comment",
		),
		"title7" => array(
			"title" => "タイトル7",
			"type" => "text",
		),
		"price7" => array(
			"title" => "価格7",
			"type" => "text",
		),
		"text7" => array(
			"title" => "説明7",
			"type" => "textarea",
		),
		"image7" => array(
			"title" => "画像7",
			"type" => "image",
		),
		"view7" => array(
			"title" => "出現7",
			"type" => "select",
			"list" => array(
				"" => "なし",
				"up" => "上から",
				"down" => "下から",
				"transform1" => "横回転",
				"transform2" => "縦回転",
				"blur" => "徐々に",
			),
		),
		"icon7" => array(
			"title" => "アイコン7",
			"type" => "text",
		),
		"dummy8" => array(
			"title" => " ",
			"type" => "comment",
		),
		"title8" => array(
			"title" => "タイトル8",
			"type" => "text",
		),
		"price8" => array(
			"title" => "価格8",
			"type" => "text",
		),
		"text8" => array(
			"title" => "説明8",
			"type" => "textarea",
		),
		"image8" => array(
			"title" => "画像8",
			"type" => "image",
		),
		"view8" => array(
			"title" => "出現8",
			"type" => "select",
			"list" => array(
				"" => "なし",
				"up" => "上から",
				"down" => "下から",
				"transform1" => "横回転",
				"transform2" => "縦回転",
				"blur" => "徐々に",
			),
		),
		"icon8" => array(
			"title" => "アイコン8",
			"type" => "text",
		),
		"dummy9" => array(
			"title" => " ",
			"type" => "comment",
		),
		"title9" => array(
			"title" => "タイトル9",
			"type" => "text",
		),
		"price9" => array(
			"title" => "価格9",
			"type" => "text",
		),
		"text9" => array(
			"title" => "説明9",
			"type" => "textarea",
		),
		"image9" => array(
			"title" => "画像9",
			"type" => "image",
		),
		"view9" => array(
			"title" => "出現9",
			"type" => "select",
			"list" => array(
				"" => "なし",
				"up" => "上から",
				"down" => "下から",
				"transform1" => "横回転",
				"transform2" => "縦回転",
				"blur" => "徐々に",
			),
		),
		"icon9" => array(
			"title" => "アイコン9",
			"type" => "text",
		),
		"dummy10" => array(
			"title" => " ",
			"type" => "comment",
		),
		"title10" => array(
			"title" => "タイトル10",
			"type" => "text",
		),
		"price10" => array(
			"title" => "価格10",
			"type" => "text",
		),
		"text10" => array(
			"title" => "説明10",
			"type" => "textarea",
		),
		"image10" => array(
			"title" => "画像10",
			"type" => "image",
		),
		"view10" => array(
			"title" => "出現10",
			"type" => "select",
			"list" => array(
				"" => "なし",
				"up" => "上から",
				"down" => "下から",
				"transform1" => "横回転",
				"transform2" => "縦回転",
				"blur" => "徐々に",
			),
		),
		"icon10" => array(
			"title" => "アイコン10",
			"type" => "text",
		),
	),
	"repeat" => array(
		"title", "price", "text", "image", "icon", "view",
	),
//	"func" => "func_foods10_menu",		// 処理プログラム（指定がない物は標準処理）
);

block_add($foods10_menu);

function func_foods10_menu($def, $info)
{
	$ary = array();
	for ($i = 1; $i <= 10; $i++) {
		unset($item);
		if ($info["image" . $i]) {
			$item["image"] = $info["image" . $i . "_file"];
			$item["link"] = $info["link" . $i];
			$ary[] = $item;
		}
	}
	$info["ary"] = $ary;
	return $info;
}
