<?php
$template = <<<END
<section class="hairsalon1_kiji">
<div class="list-half">
<!--{each item/list}-->
<div class="list blur">
<div class="text">
<h4>{val item/list/title}</h4>
<p class="markdown-body">{rval item/list/text}</p>
</div>
<!--/.text-->
<div class="{val item/list/image_dir}">
<figure><img src="user_data/{val item/list/image}"></figure>
</div>
<!--/.image-r-->
</div>
<!--/.list-->
<!--{/each}-->
</div>
<!--/.list-half-->
</section>
END;

$hairsalon1_kiji = array(						// ブロック
		"title" => "hairsalon1 記事",	// ブロックの名称
		"name" => "hairsalon1_kiji",			// 名称、重複すると正しく動作しません
		"template" => $template,		// ブロックのテンプレート
		"input" => array(				// ブロックの入力定義
		"help" => array(
			"title" => "使い方",
			"type" => "comment",
			"link" => DOCUMENT1 . "/?act=hairsalon1_kiji",
			"class" => "notice",
		),
			"title1" => array(
				"title" => "タイトル1",
				"type" => "text",
			),
			"text1" => array(
				"title" => "説明1",
				"type" => "textarea",
			),
			"image1" => array(
				"title" => "画像1",
				"type" => "image",
			),
			"image_dir1" => array(
				"title" => "画像配置",
				"type" => "select",
				"list" => array(
					"image-r" => "右",
					"image-l" => "左",
				),
			),
			"title2" => array(
				"title" => "タイトル2",
				"type" => "text",
			),
			"text2" => array(
				"title" => "説明2",
				"type" => "textarea",
			),
			"image2" => array(
				"title" => "画像2",
				"type" => "image",
			),
			"image_dir2" => array(
				"title" => "画像配置2",
				"type" => "select",
				"list" => array(
					"image-r" => "右",
					"image-l" => "左",
				),
			),
			"title3" => array(
				"title" => "タイトル3",
				"type" => "text",
			),
			"text3" => array(
				"title" => "説明3",
				"type" => "textarea",
			),
			"image3" => array(
				"title" => "画像3",
				"type" => "image",
			),
			"image_dir3" => array(
				"title" => "画像配置3",
				"type" => "select",
				"list" => array(
					"image-r" => "右",
					"image-l" => "左",
				),
			),
			"title4" => array(
				"title" => "タイトル4",
				"type" => "text",
			),
			"text4" => array(
				"title" => "説明4",
				"type" => "textarea",
			),
			"image4" => array(
				"title" => "画像4",
				"type" => "image",
			),
			"image_dir4" => array(
				"title" => "画像配置4",
				"type" => "select",
				"list" => array(
					"image-r" => "右",
					"image-l" => "左",
				),
			),
			"title5" => array(
				"title" => "タイトル5",
				"type" => "text",
			),
			"text5" => array(
				"title" => "説明5",
				"type" => "textarea",
			),
			"image5" => array(
				"title" => "画像5",
				"type" => "image",
			),
			"image_dir5" => array(
				"title" => "画像配置5",
				"type" => "select",
				"list" => array(
					"image-r" => "右",
					"image-l" => "左",
				),
			),
		),
		"func" => "func_hairsalon1_kiji",		// 処理プログラム（指定がない物は標準処理）
	);

block_add($hairsalon1_kiji);

// スライドの設定
function func_hairsalon1_kiji($def, $info)
{
	$list = array();
	for ($i = 1; $i <= 10; $i++) {
		if ($info["title" . $i]) {
			unset($item);
			$item["title"] = $info["title" . $i];
			$item["text"] = $info["text" . $i];
			$item["image"] = $info["image" . $i . "_file"];
			$item["image_dir"] = $info["image_dir" . $i];
			$list[] = $item;
		}
	}
	$info["list"] = $list;
	return $info;
}
