/**
 * 表示データ作成用テンプレート(patTemplate)
 *
 * LICENSE: This source file is licensed under the terms of the GNU General Public License.
 *
 * @package    Magic3 Framework
 * @author     平田直毅(Naoki Hirata) <naoki@aplo.co.jp>
 * @copyright  Copyright 2006-2014 Magic3 Project.
 * @license    http://www.gnu.org/copyleft/gpl.html  GPL License
 * @version    SVN: $Id$
 * @link       http://www.magic3.org
 */
<patTemplate:tmpl name="_widget">
<script type="text/javascript">
//<![CDATA[
function addItem(){
	if (!window.confirm('項目を新規追加しますか?')) return false;
	document.main.act.value = 'add';
	document.main.submit();
	return true;
}
function updateItem(){
	if (!window.confirm('設定を更新しますか?')) return false;
	document.main.act.value='update';
	document.main.submit();
	return true;
}
function selectItem()
{
	document.main.act.value = 'select';
	document.main.submit();
	return true;
}
function listItem(){
	document.main.task.value = 'list';
	document.main.submit();
	return true;
}
$(function(){
	// WYSIWYGエディター作成
	m3SetWysiwygEditor('item_html', 450);
});
//]]>
</script>
<div align="center">
<br />
<!-- m3:ErrorMessage -->
<form method="post" name="main">
<input type="hidden" name="task" />
<input type="hidden" name="act" />
<input type="hidden" name="serial" value="{SERIAL}" />
<!-- m3:PostParam -->
<table width="90%">
<tr><td><label>汎用HTML詳細</label></td>
<td align="right"><input type="button" class="button" onclick="listItem();" value="設定一覧" />
</td></tr>
<tr><td colspan="2">

<table class="simple-table" style="margin: 0 auto;width:950px;">
    <tbody>
        <tr>
	    <td class="table-headside" width="150">名前</td>
	    <td>
	    <select name="item_id" onchange="selectItem();" {ID_DISABLED}>
	        <option value="0">-- 新規登録 --</option>
	        <patTemplate:tmpl name="title_list">
	        <option value="{VALUE}" {SELECTED}>{NAME}</option>
	        </patTemplate:tmpl>
	    </select>
	    <patTemplate:tmpl name="item_name_visible" visibility="hidden">
	    <input type="text" name="item_name" value="{NAME}" size="40" maxlength="40" />
	    </patTemplate:tmpl>
	    </td>
	</tr>
        <tr class="even">
	    <td class="table-headside">HTML</td>
	    <td><textarea name="item_html">{HTML}</textarea></td>
	</tr>
	<tr>
	    <td align="right" colspan="2">
<patTemplate:tmpl name="del_button" visibility="hidden">
		<input type="button" class="button" onclick="deleteItem();" value="削除" />
</patTemplate:tmpl>
<patTemplate:tmpl name="update_button" visibility="hidden">
		<input type="button" class="button" onclick="updateItem();" value="更新" />
</patTemplate:tmpl>
<patTemplate:tmpl name="add_button" visibility="hidden">
		<input type="button" class="button" onclick="addItem();" value="新規追加" />
</patTemplate:tmpl>
	    </td>
	</tr>
    </tbody>
</table>
</td></tr>
</table>
</form>
</div>
</patTemplate:tmpl>
