<?php
$template = <<<END
<section class="foods10_menu2">
<h2><span class="uline">{val item/title}</span><!--{def item/subtitle}--><span class="small">{val item/subtitle}</span><!--{/def}--></h2>
<h3 class="type2">{val item/category}</h3>
<dl class="text-menu {val item/view}">
<!--{each item/list}-->
<dt>{val item/list/title}</dt>
<dd>{val item/list/price}</dd>
<!--{/each}-->
</dl>
</section>
END;

$foods10_menu2 = array(
		"title" => "メニュー(画像無し)",
		"name" => "foods10_menu2",			// 名称、重複すると正しく動作しません
		"template" => $template,		// ブロックのテンプレート
		"input" => array(
		"help" => array(
			"title" => "使い方",
			"type" => "comment",
			"link" => DOCUMENT1 . "/?act=foods10_menu2",
			"class" => "notice",
		),
		"title" => array(
			"title" => "タイトル",
			"type" => "text",
		),
		"subtitle" => array(
			"title" => "サブタイトル",
			"type" => "text",
		),
		"category" => array(
			"title" => "カテゴリ",
			"type" => "text",
		),
		"view" => array(
			"title" => "出現",
			"type" => "select",
			"list" => array(
				"" => "なし",
				"up" => "上から",
				"down" => "下から",
				"transform1" => "横回転",
				"transform2" => "縦回転",
				"blur" => "徐々に",
			),
		),
		"dummy1" => array(
			"title" => " ",
			"type" => "comment",
		),
		"title1" => array(
			"title" => "タイトル1",
			"type" => "text",
		),
		"price1" => array(
			"title" => "価格1",
			"type" => "text",
		),
		"dummy2" => array(
			"title" => " ",
			"type" => "comment",
		),
		"title2" => array(
			"title" => "タイトル2",
			"type" => "text",
		),
		"price2" => array(
			"title" => "価格2",
			"type" => "text",
		),
		"dummy3" => array(
			"title" => " ",
			"type" => "comment",
		),
		"title3" => array(
			"title" => "タイトル3",
			"type" => "text",
		),
		"price3" => array(
			"title" => "価格3",
			"type" => "text",
		),
		"dummy4" => array(
			"title" => " ",
			"type" => "comment",
		),
		"title4" => array(
			"title" => "タイトル4",
			"type" => "text",
		),
		"price4" => array(
			"title" => "価格4",
			"type" => "text",
		),
		"dummy5" => array(
			"title" => " ",
			"type" => "comment",
		),
		"title5" => array(
			"title" => "タイトル5",
			"type" => "text",
		),
		"price5" => array(
			"title" => "価格5",
			"type" => "text",
		),
		"dummy6" => array(
			"title" => " ",
			"type" => "comment",
		),
		"title6" => array(
			"title" => "タイトル6",
			"type" => "text",
		),
		"price6" => array(
			"title" => "価格6",
			"type" => "text",
		),
		"dummy7" => array(
			"title" => " ",
			"type" => "comment",
		),
		"title7" => array(
			"title" => "タイトル7",
			"type" => "text",
		),
		"price7" => array(
			"title" => "価格7",
			"type" => "text",
		),
		"dummy8" => array(
			"title" => " ",
			"type" => "comment",
		),
		"title8" => array(
			"title" => "タイトル8",
			"type" => "text",
		),
		"price8" => array(
			"title" => "価格8",
			"type" => "text",
		),
		"dummy9" => array(
			"title" => " ",
			"type" => "comment",
		),
		"title9" => array(
			"title" => "タイトル9",
			"type" => "text",
		),
		"price9" => array(
			"title" => "価格9",
			"type" => "text",
		),
		"dummy10" => array(
			"title" => " ",
			"type" => "comment",
		),
		"title10" => array(
			"title" => "タイトル10",
			"type" => "text",
		),
		"price10" => array(
			"title" => "価格10",
			"type" => "text",
		),
	),
	"repeat" => array(
		"title", "price", 
	),
//	"func" => "func_foods10_menu2",		// 処理プログラム（指定がない物は標準処理）
);

block_add($foods10_menu2);

function func_foods10_menu2($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;
}
