2 * 表示データ作成用テンプレート(patTemplate)
4 * LICENSE: This source file is licensed under the terms of the GNU General Public License.
6 * @package Magic3 Framework
7 * @author 平田直毅(Naoki Hirata) <naoki@aplo.co.jp>
8 * @copyright Copyright 2006-2015 Magic3 Project.
9 * @license http://www.gnu.org/copyleft/gpl.html GPL License
11 * @link http://www.magic3.org
13 <patTemplate:tmpl name="_widget">
14 <script type="text/javascript">
16 function selectMenu(){
17 document.main.submit();
21 if (!window.confirm('{_LC_MSG_ADD}')) return false;
22 document.main.act.value = 'add';
23 document.main.submit();
26 function updateItem(serialNo){
27 if (!window.confirm('{_LC_MSG_UPDATE}')) return false;
28 document.main.act.value = 'update';
29 document.main.submit();
32 function delItem(serialNo){
33 if (!window.confirm('{_LC_MSG_DELETE}')) return false;
34 document.main.act.value = 'delete';
35 document.main.submit();
38 function cancelItem(){
39 document.main.task.value = 'smenudef';
40 document.main.submit();
44 function previewInOtherWindow()
46 var url = $('#item_url').val();
47 m3ShowPreviewWindow({DEVICE_TYPE}, url);
50 function setLinkUrl(url)
52 $('#item_url').val(url);
56 $("#get_title_button").prop('disabled', true);
58 $("#get_title_button").prop('disabled', false);
64 var url = $('#item_url').val();
67 m3_ajax_request('', 'task=linkinfo&act=gettitle&url=' + url, function(request, retcode, jsondata){ // 正常終了
70 if (jsondata.title != '') $('#item_name').val(jsondata.title);
72 }, function(request){ // 異常終了
79 m3SetConfigTable('mainconfig');
82 var url = $('#item_url').val();
84 $("#get_title_button").prop('disabled', true);
86 $("#get_title_button").prop('disabled', false);
90 $("#{TAGID_CREATE_URL}").click(function (){
91 var url = $('#item_url').val();
92 m3CreateLinkUrl({DEVICE_TYPE}, url, setLinkUrl);
96 m3CreateOptionButton('{OPEN_BUTTON_ID}', '{CLOSE_BUTTON_ID}', 'option_area', {OPTION_AREA_OPEN});
102 m3AdjustParentWindow();
106 <div class="m3config_container">
107 <!-- m3:ErrorMessage -->
108 <form method="post" name="main">
109 <input type="hidden" name="fixed_mode" value="{FIXED_MODE}" />
110 <input type="hidden" name="task" value="smenudef_detail" />
111 <input type="hidden" name="act" />
112 <input type="hidden" name="serial" value="{SERIAL}" />
113 <input type="hidden" name="menuid" value="{MENU_ID}" />
114 <h3 class="m3config_h"><span {_HELP_MENUDEF_DETAIL}>{_LC_LABEL_MENU_ITEM_DETAIL}</span></h3>
115 <div class="m3config_h_side_buttons pull-right"><div {_HELP_MENUDEF_BUTTONS2}><div class="btn-group">
116 <input type="button" class="button" onclick="cancelItem();" value="{_LC_LABEL_GO_BACK}" />
119 <table id="mainconfig">
122 <th><span {_HELP_MENUDEF_NAME}>{_LC_LABEL_NAME}</span></th>
124 <div class="col-sm-4 m3config_item">
125 <select name="item_sel_menuid" class="form-control" onchange="selectMenu();">
126 <option value="0" {SELECTED}>-- {_LC_LABEL_NEW} --</option>
127 <patTemplate:tmpl name="menuid_list">
128 <option value="{VALUE}" {SELECTED}>{NAME}</option>
132 <div class="col-sm-4 m3config_item"><input type="text" id="item_name" name="item_name" class="form-control" value="{SEL_ITEM_NAME}" size="40" maxlength="40" /></div><div class="col-sm-1 m3config_item form-control-static">{LANG}</div>
133 <div class="col-sm-3 m3config_item"><input type="button" id="get_title_button" class="button pull-right" onclick="getTitle();" value="{_LC_LABEL_GET_TITLE}" {GET_TITLE_DISABLED} /></div>
134 <patTemplate:tmpl name="input_lang" visibility="hidden">
135 <div class="form-group">
136 <div class="col-sm-4 m3config_item"><input type="text" name="item_name_{ID}" class="form-control" value="{VALUE}" size="40" maxlength="40" /></div><div class="col-sm-1 m3config_item form-control-static">{LANG}</div>
142 <th><span {_HELP_MENUDEF_LINK_URL}>{_LC_LABEL_LINK_URL}</span><div class="pull-right">{CREATE_URL_BUTTON}</div></th>
144 <div class="input-group">
145 <input type="text" id="item_url" name="item_url" class="form-control" value="{URL}" readonly />
146 <span class="input-group-btn">
147 <a class="btn btn-default" onclick="previewInOtherWindow();return false;" rel="m3help" title="{PREVIEW_STR}"><i class="glyphicon glyphicon-new-window"></i></a>
152 <tr class="option_area" style="display:none;">
153 <th><span {_HELP_MENUDEF_ITEM_TYPE}>{_LC_LABEL_ITEM_TYPE}</span></th>
154 <td style="width:200px;">
155 <select name="item_type" class="form-control">
156 <patTemplate:tmpl name="item_type_list">
157 <option value="{VALUE}" {SELECTED}>{NAME}</option>
161 <th><span {_HELP_MENUDEF_LINK_TYPE}>{_LC_LABEL_LINK_TYPE}</span></th>
163 <div class="col-sm-6 m3config_item">
164 <select name="item_link_type" class="form-control">
165 <option value="0" {LINK_TYPE_0}>{_LC_LABEL_LINK_SELF}</option>
166 <option value="1" {LINK_TYPE_1}>{_LC_LABEL_LINK_OTHER}</option>
171 <tr class="option_area" style="display:none;">
172 <th><span {_HELP_MENUDEF_VISIBLE}>{_LC_LABEL_ITEM_VISIBLE}</span></th>
173 <td colspan="3"><div class="checkbox"><label><input type="checkbox" name="item_visible" {SEL_ITEM_VISIBLE} />{_LC_LABEL_VISIBLE}</label></div>
174 <div class="checkbox"><label><input type="checkbox" name="item_user_limited" {USER_LIMITED_CHECKED} />{_LC_MSG_USER_LIMITED}</label></div>
175 <div class="checkbox"><label><input type="checkbox" name="item_link_content" {LINK_CONTENT} />{_LC_MSG_LINK_TO_CONTENT}</label></div></td>
178 <th><span {_HELP_MENUDEF_DESC}>{_LC_LABEL_DESC}</span></th>
179 <td colspan="3"><input type="text" name="item_desc" value="{DESC}" size="100" maxlength="100" /></td>
181 <tr class="option_area" style="display:none;">
182 <th><span {_HELP_MENUDEF_TITLE}>{_LC_LABEL_TITLE}</span></th>
184 <div class="col-sm-11 m3config_item"><input type="text" name="item_title" class="form-control" value="{TITLE}" maxlength="300" /></div><div class="col-sm-1 m3config_item form-control-static">{LANG}</div>
185 <patTemplate:tmpl name="input_title" visibility="hidden">
186 <div class="col-sm-11 m3config_item"><input type="text" name="item_title_{ID}" class="form-control" value="{VALUE}" maxlength="300" /></div><div class="col-sm-1 m3config_item form-control-static">{LANG}</div>
191 <td colspan="4"><div class="pull-left">{OPEN_BUTTON}{CLOSE_BUTTON}</div></td>
195 <div class="well m3config_update_buttons">
196 <patTemplate:tmpl name="del_button" visibility="hidden">
197 <input type="button" class="button" onclick="delItem();" value="{_LC_LABEL_DELETE}" />
198 <input type="button" class="button" onclick="updateItem();" value="{_LC_LABEL_UPDATE}" />
200 <patTemplate:tmpl name="add_button" visibility="hidden">
201 <input type="button" class="button" onclick="addItem();" value="{_LC_LABEL_ADD}" />