<?php
/* このファイルはtp_home5用の共通設定ファイルです。 */
// 共通定義
$common_items = array(
	"items" => array(
		"dummy1" => array(
			"title" => "表示関連",
			"type" => "comment",
			"class" => "openclose",
		),
		"site_title" => array(	
			"title" => "サイトタイトル",
			"type" => "text",
		),
		"site_logo" => array(	
			"title" => "ロゴファイル（縦）",
			"type" => "image",
		),
		"site_logo2" => array(	
			"title" => "ロゴファイル（横）",
			"type" => "image",
		),
		"char_size" => array(
			"title" => "文字サイズ切替",
			"type" => "text",
			"info" => "文字サイズ切替が不要の場合は空欄",
		),
		"tel" => array(
			"title" => "電話番号",
			"type" => "text",
		),
		"tel_comment" => array(
			"title" => "電話コメント",
			"type" => "text",
		),
		"contact_url" => array(
			"title" => "お問い合わせリンク",
			"type" => "text",
		),
		"contact2_title" => array(
			"title" => "資料請求表示",
			"type" => "text",
			"info" => "こことリンク先を記入すると資料請求ボタンが表示されます",
		),
		"contact2_url" => array(
			"title" => "資料請求リンク",
			"type" => "text",
			"info" => "上とここにリンク先を記入すると資料請求ボタンが表示されます",
		),
		"contact_banner" => array(
			"title" => "資料請求バナー",
			"type" => "file",
		),
		"site_desc" => array(	
			"title" => "サイト説明",
			"type" => "text",
		),
		"site_keyword" => array(	
			"title" => "サイトキーワード",
			"type" => "text",
		),
		"site_image" => array(	
			"title" => "サイト画像",
			"type" => "image",
			"info" => "SNSなどで参照された際に表示されます",
		),
		// 1列目
		"dummy2-1" => array(
			"title" => "メニュー１列目１（サブメニュー無し）",
			"type" => "comment",
			"class" => "openclose",
		),
		"menu11_title" => array(
			"title" => "メニュー1-1",
			"type" => "text",
		),
		"menu11_link" => array(
			"title" => "リンク1",
			"type" => "text",
		),
		"dummy2-2" => array(
			"title" => "メニュー１列目２（サブメニュー無し）",
			"type" => "comment",
			"class" => "openclose",
		),
		"menu12_title" => array(
			"title" => "メニュー2",
			"type" => "text",
		),
		"menu12_link" => array(
			"title" => "リンク2",
			"type" => "text",
		),
		"dummy2-3" => array(
			"title" => "メニュー１列目３（サブメニュー無し）",
			"type" => "comment",
			"class" => "openclose",
		),
		"menu13_title" => array(
			"title" => "メニュー3",
			"type" => "text",
		),
		"menu13_link" => array(
			"title" => "リンク3",
			"type" => "text",
		),
		"dummy2-4" => array(
			"title" => "メニュー１列目４（サブメニュー無し）",
			"type" => "comment",
			"class" => "openclose",
		),
		"menu14_title" => array(
			"title" => "メニュー4",
			"type" => "text",
		),
		"menu14_link" => array(
			"title" => "リンク4",
			"type" => "text",
		),
		"dummy2-5" => array(
			"title" => "メニュー１列目５（サブメニュー無し）",
			"type" => "comment",
			"class" => "openclose",
		),
		"menu15_title" => array(
			"title" => "メニュー5",
			"type" => "text",
		),
		"menu15_link" => array(
			"title" => "リンク5",
			"type" => "text",
		),
		// 2列目
		"dummy2-6" => array(
			"title" => "メニュー２列目（サブメニューあり）",
			"type" => "comment",
			"class" => "openclose",
		),
		"menu21_title" => array(
			"title" => "メニュー2",
			"type" => "text",
		),
		"menu21_link" => array(
			"title" => "リンク2",
			"type" => "text",
		),
		"dummy2-5-1" => array(
			"title" => " ",
			"type" => "comment",
		),
		"menu21_sub1_title" => array(
			"title" => "サブメニュー2-1",
			"type" => "text",
		),
		"menu21_sub1_link" => array(
			"title" => "サブリンク2-1",
			"type" => "text",
		),
		"menu21_sub2_title" => array(
			"title" => "サブメニュー2-2",
			"type" => "text",
		),
		"menu21_sub2_link" => array(
			"title" => "サブリンク2-2",
			"type" => "text",
		),
		"menu21_sub3_title" => array(
			"title" => "サブメニュー2-3",
			"type" => "text",
		),
		"menu21_sub3_link" => array(
			"title" => "サブリンク2-3",
			"type" => "text",
		),
		"menu21_sub4_title" => array(
			"title" => "サブメニュー2-4",
			"type" => "text",
		),
		"menu21_sub4_link" => array(
			"title" => "サブリンク2-4",
			"type" => "text",
		),
		// 3列目
		"dummy2-7" => array(
			"title" => "メニュー３列目（サブメニューあり）",
			"type" => "comment",
			"class" => "openclose",
		),
		"menu31_title" => array(
			"title" => "メニュー3",
			"type" => "text",
		),
		"menu31_link" => array(
			"title" => "リンク3",
			"type" => "text",
		),
		"dummy2-8-1" => array(
			"title" => " ",
			"type" => "comment",
		),
		"menu31_sub1_title" => array(
			"title" => "サブメニュー3-1",
			"type" => "text",
		),
		"menu31_sub1_link" => array(
			"title" => "サブリンク3-1",
			"type" => "text",
		),
		"menu31_sub2_title" => array(
			"title" => "サブメニュー3-2",
			"type" => "text",
		),
		"menu31_sub2_link" => array(
			"title" => "サブリンク3-2",
			"type" => "text",
		),
		"menu31_sub3_title" => array(
			"title" => "サブメニュー3-3",
			"type" => "text",
		),
		"menu31_sub3_link" => array(
			"title" => "サブリンク3-3",
			"type" => "text",
		),
		"menu31_sub4_title" => array(
			"title" => "サブメニュー3-4",
			"type" => "text",
		),
		"menu31_sub4_link" => array(
			"title" => "サブリンク3-4",
			"type" => "text",
		),
		"dummy4" => array(
			"title" => "フッター関連",
			"type" => "comment",
			"class" => "openclose",
		),
		"footer_title" => array(
			"title" => "タイトル",
			"type" => "text",
		),
		"footer_text" => array(
			"title" => "説明",
			"type" => "textarea",
		),
		"footer_map_text" => array(
			"title" => "地図説明",
			"type" => "textarea",
		),
		"footer_map_url" => array(
			"title" => "地図iframe",
			"type" => "text",
		),
		"dummy3-1" => array(
			"title" => "フッターメニューグループ1",
			"type" => "comment",
			"class" => "openclose",
		),
		"footer_menu1_title" => array(
			"title" => "グループ1タイトル",
			"type" => "text",
		),
		"footer_menu1_item1_title" => array(
			"title" => "メニュー1-1",
			"type" => "text",
		),
		"footer_menu1_item1_link" => array(
			"title" => "リンク1-1",
			"type" => "text",
		),
		"footer_menu1_item2_title" => array(
			"title" => "メニュー1-2",
			"type" => "text",
		),
		"footer_menu1_item2_link" => array(
			"title" => "リンク1-2",
			"type" => "text",
		),
		"footer_menu1_item3_title" => array(
			"title" => "メニュー1-3",
			"type" => "text",
		),
		"footer_menu1_item3_link" => array(
			"title" => "リンク1-3",
			"type" => "text",
		),
		"footer_menu1_item4_title" => array(
			"title" => "メニュー1-4",
			"type" => "text",
		),
		"footer_menu1_item4_link" => array(
			"title" => "リンク1-4",
			"type" => "text",
		),
		"dummy3-2" => array(
			"title" => "フッターメニューグループ2",
			"type" => "comment",
			"class" => "openclose",
		),
		"footer_menu2_title" => array(
			"title" => "グループ2タイトル",
			"type" => "text",
		),
		"footer_menu2_item1_title" => array(
			"title" => "メニュー2-1",
			"type" => "text",
		),
		"footer_menu2_item1_link" => array(
			"title" => "リンク2-1",
			"type" => "text",
		),
		"footer_menu2_item2_title" => array(
			"title" => "メニュー2-2",
			"type" => "text",
		),
		"footer_menu2_item2_link" => array(
			"title" => "リンク2-2",
			"type" => "text",
		),
		"footer_menu2_item3_title" => array(
			"title" => "メニュー2-3",
			"type" => "text",
		),
		"footer_menu2_item3_link" => array(
			"title" => "リンク2-3",
			"type" => "text",
		),
		"footer_menu2_item4_title" => array(
			"title" => "メニュー2-4",
			"type" => "text",
		),
		"footer_menu2_item4_link" => array(
			"title" => "リンク2-4",
			"type" => "text",
		),
		"dummy3-3" => array(
			"title" => "フッターメニューグループ3",
			"type" => "comment",
			"class" => "openclose",
		),
		"footer_menu3_title" => array(
			"title" => "グループ3タイトル",
			"type" => "text",
		),
		"footer_menu3_item1_title" => array(
			"title" => "メニュー3-1",
			"type" => "text",
		),
		"footer_menu3_item1_link" => array(
			"title" => "リンク3-1",
			"type" => "text",
		),
		"footer_menu3_item2_title" => array(
			"title" => "メニュー3-2",
			"type" => "text",
		),
		"footer_menu3_item2_link" => array(
			"title" => "リンク3-2",
			"type" => "text",
		),
		"footer_menu3_item3_title" => array(
			"title" => "メニュー3-3",
			"type" => "text",
		),
		"footer_menu3_item3_link" => array(
			"title" => "リンク3-3",
			"type" => "text",
		),
		"footer_menu3_item4_title" => array(
			"title" => "メニュー3-4",
			"type" => "text",
		),
		"footer_menu3_item4_link" => array(
			"title" => "リンク3-4",
			"type" => "text",
		),
		"dummy3-4" => array(
			"title" => "フッターメニューグループ4",
			"type" => "comment",
			"class" => "openclose",
		),
		"footer_menu4_title" => array(
			"title" => "グループ4タイトル",
			"type" => "text",
		),
		"footer_menu4_item1_title" => array(
			"title" => "メニュー4-1",
			"type" => "text",
		),
		"footer_menu4_item1_link" => array(
			"title" => "リンク4-1",
			"type" => "text",
		),
		"footer_menu4_item2_title" => array(
			"title" => "メニュー4-2",
			"type" => "text",
		),
		"footer_menu4_item2_link" => array(
			"title" => "リンク4-2",
			"type" => "text",
		),
		"footer_menu4_item3_title" => array(
			"title" => "メニュー4-3",
			"type" => "text",
		),
		"footer_menu4_item3_link" => array(
			"title" => "リンク4-3",
			"type" => "text",
		),
		"footer_menu4_item4_title" => array(
			"title" => "メニュー4-4",
			"type" => "text",
		),
		"footer_menu4_item4_link" => array(
			"title" => "リンク4-4",
			"type" => "text",
		),
		"dummy5" => array(
			"title" => "共通",
			"type" => "comment",
			"class" => "openclose",
		),
		"copyright" => array(	
			"title" => "著作権表示",
			"type" => "text",
		),
		"head_tag" => array(
			"title" => "&lt;/head&gt;前挿入",
			"type" => "textarea",
			"info" => "Google Analyticsのタグなどの挿入",
		),
		"body_tag" => array(
			"title" => "&lt;/body&gt;前挿入",
			"type" => "textarea",
			"info" => "Google Analyticsのタグなどの挿入",
		),
		"dummy6" => array(
			"title" => "SNS",
			"type" => "comment",
			"class" => "openclose",
		),
		"sns1" => array(	
			"title" => "X(旧Twitter)",
			"type" => "text",
		),
		"sns2" => array(	
			"title" => "LINE",
			"type" => "text",
		),
		"sns3" => array(	
			"title" => "YouTube",
			"type" => "text",
		),
		"sns4" => array(	
			"title" => "INSTAGRAM",
			"type" => "text",
		),
		"sns5" => array(	
			"title" => "FaceBook",
			"type" => "text",
		),
		"sns6" => array(	
			"title" => "その他",
			"type" => "text",
		),
		"dummy7" => array(
			"title" => "認証",
			"type" => "comment",
			"class" => "openclose",
		),
		"login_id" => array(
			"title" => "ログインID",
			"type" => "text",
			"info" => "ログインIDが不要の場合は、空欄にしてください。",
		),
		"passwd" => array(
			"title" => "パスワード",
			"type" => "text",
		),
	),
	"func" => "func_common",
);

// 共通データの変換
function func_common($def, $info)
{
	// メニュー1列目
	$menu = array();
	for ($i = 1; $i <= 10; $i++) {
		$title = $info["menu1" . $i . "_title"];
		$link = $info["menu1" . $i . "_link"];
		if ($title && $link) {
			unset($item);
			$item["title"] = $title;
			$item["link"] = $link;
			// サブメニュー
			$sub = array();
			for ($j = 1; $j <= 10; $j++) {
				$subtitle = $info["menu1" . $i . "_sub" . $j . "_title"];
				$sublink = $info["menu1" . $i . "_sub" . $j . "_link"];
				if ($subtitle && $sublink) {
					$subitem["title"] = $subtitle;
					$subitem["link"] = $sublink;
					$sub[] = $subitem;
				}
			}
			if ($sub) {
				$item["submenu"] = $sub;
			}
			$menu[] = $item;
		}
	}
	$info["menu1"] = $menu;
	// メニュー2列目
	$menu = array();
	for ($i = 1; $i <= 10; $i++) {
		$title = $info["menu2" . $i . "_title"];
		$link = $info["menu2" . $i . "_link"];
		if ($title && $link) {
			unset($item);
			$item["title"] = $title;
			$item["link"] = $link;
			// サブメニュー
			$sub = array();
			for ($j = 1; $j <= 10; $j++) {
				$subtitle = $info["menu2" . $i . "_sub" . $j . "_title"];
				$sublink = $info["menu2" . $i . "_sub" . $j . "_link"];
				if ($subtitle && $sublink) {
					$subitem["title"] = $subtitle;
					$subitem["link"] = $sublink;
					$sub[] = $subitem;
				}
			}
			if ($sub) {
				$item["submenu"] = $sub;
			}
			$menu[] = $item;
		}
	}
	$info["menu2"] = $menu;
	// メニュー3列目
	$menu = array();
	for ($i = 1; $i <= 10; $i++) {
		$title = $info["menu3" . $i . "_title"];
		$link = $info["menu3" . $i . "_link"];
		if ($title && $link) {
			unset($item);
			$item["title"] = $title;
			$item["link"] = $link;
			// サブメニュー
			$sub = array();
			for ($j = 1; $j <= 10; $j++) {
				$subtitle = $info["menu3" . $i . "_sub" . $j . "_title"];
				$sublink = $info["menu3" . $i . "_sub" . $j . "_link"];
				if ($subtitle && $sublink) {
					$subitem["title"] = $subtitle;
					$subitem["link"] = $sublink;
					$sub[] = $subitem;
				}
			}
			if ($sub) {
				$item["submenu"] = $sub;
			}
			$menu[] = $item;
		}
	}
	$info["menu3"] = $menu;
	// フッターメニュー
	$footer_menu = array();
	for ($i = 1; $i <= 10; $i++) {
		$group = array();
		$group_title = $info["footer_menu" . $i . "_title"];
		if ($group_title) {
			$group["title"] = $group_title;
			$menu = array();
			for ($j = 1; $j <= 10; $j++) {
				$title = $info["footer_menu" . $i . "_item" . $j . "_title"];
				$link = $info["footer_menu" . $i . "_item" . $j . "_link"];
				if ($title && $link) {
					$item["title"] = $title;
					$item["link"] = $link;
					$menu[] = $item;
				}
			}
			if ($menu) {
				$group["menu"] = $menu;
				$footer_menu[] = $group;
			}
		}
	}
	$info["footer"] = $footer_menu;
	// ロゴ
	if ($info["site_logo"]) {
		$f = Image::getData(intval($info["site_logo"]));
		if ($f) {
			$info["site_logo_file"] = "user_data/" . $f["save_name"];
		}
	}
	if ($info["site_logo2"]) {
		$f = Image::getData(intval($info["site_logo2"]));
		if ($f) {
			$info["site_logo2_file"] = "user_data/" . $f["save_name"];
		}
	}
	// バナー
	if ($info["contact_banner"]) {
		$f = Image::getData(intval($info["contact_banner"]));
		if ($f) {
			$info["contact_banner_file"] = "user_data/" . $f["save_name"];
		}
	}
	//
	$login = get_setup();
	$info["license"] = $login["license"];
	//
	return $info;
}
