Cloud computing platform
Révision | 67abd940bf9e39a5bc50baa4f4182f4e8644d8d5 (tree) |
---|---|
l'heure | 2014-04-24 09:52:56 |
Auteur | naoki hirata <naoki@magi...> |
Commiter | naoki hirata |
「デフォルトメニュー」のタブをBootstrap型に変更。
@@ -89,6 +89,7 @@ class admin_default_menuWidgetContainer extends BaseAdminWidgetContainer | ||
89 | 89 | |
90 | 90 | $userId = $this->gEnv->getCurrentUserId(); |
91 | 91 | $this->langId = $this->gEnv->getCurrentLanguage(); // 表示言語を取得 |
92 | + $anchor = $request->trimValueOf('anchor'); | |
92 | 93 | $act = $request->trimValueOf('act'); |
93 | 94 | $this->serialNo = $request->trimValueOf('serial'); // 選択項目のシリアル番号 |
94 | 95 |
@@ -197,6 +198,39 @@ class admin_default_menuWidgetContainer extends BaseAdminWidgetContainer | ||
197 | 198 | // メニューID選択メニュー作成 |
198 | 199 | $this->db->getMenuIdList(0/*PC用*/, array($this, 'menuIdListLoop')); |
199 | 200 | |
201 | + // 一度設定を保存している場合は、メニュー定義を前面にする(初期起動時のみ) | |
202 | + $activeIndex = 0; | |
203 | + if (empty($act) && !empty($this->configId)) $activeIndex = 1; | |
204 | + // 一覧画面からの戻り画面が指定されてる場合は優先する | |
205 | + if ($anchor == 'widget_config') $activeIndex = 0; | |
206 | + | |
207 | + // ナビゲーションタブ作成 | |
208 | + $tabItemIndex = 0; | |
209 | + $tabDef = array(); | |
210 | + $tabItem = new stdClass; | |
211 | + $tabItem->name = 'ウィジェット設定'; | |
212 | + $tabItem->task = ''; | |
213 | + $tabItem->url = '#widget_config'; | |
214 | + $tabItem->parent = 0; | |
215 | +// $tabItem->active = ($tabItemIndex == $activeIndex) ? true : false; | |
216 | + $tabItem->active = false; | |
217 | + $tabDef[] = $tabItem; $tabItemIndex++; | |
218 | + $tabItem = new stdClass; | |
219 | + $tabItem->name = 'メニュー定義'; | |
220 | + $tabItem->task = ''; | |
221 | + $tabItem->url = '#menu_define'; | |
222 | + $tabItem->parent = 0; | |
223 | +// $tabItem->active = ($tabItemIndex == $activeIndex) ? true : false; | |
224 | + $tabItem->active = false; | |
225 | + $tabDef[] = $tabItem; $tabItemIndex++; | |
226 | + $tabHtml = $this->gDesign->createConfigNavTab($tabDef); | |
227 | + $this->tmpl->addVar("_widget", "nav_tab", $tabHtml); | |
228 | + if (empty($activeIndex)){ // タブの選択 | |
229 | + $this->tmpl->addVar("_widget", "select_tab", 'widget_config'); | |
230 | + } else { | |
231 | + $this->tmpl->addVar("_widget", "select_tab", 'menu_define'); | |
232 | + } | |
233 | + | |
200 | 234 | // 画面にデータを埋め込む |
201 | 235 | $this->tmpl->addVar("item_name_visible", "name", $name); // 名前 |
202 | 236 | if (!empty($this->configId)) $this->tmpl->addVar("_widget", "id", $this->configId); // 定義ID |
@@ -221,7 +255,7 @@ class admin_default_menuWidgetContainer extends BaseAdminWidgetContainer | ||
221 | 255 | } |
222 | 256 | // タブの選択状態を設定 |
223 | 257 | // 一度設定を保存している場合は、メニュー定義を前面にする(初期起動時のみ) |
224 | - if (empty($act) && !empty($this->configId)) $this->tmpl->setAttribute('select_menu_def', 'visibility', 'visible'); | |
258 | +// if (empty($act) && !empty($this->configId)) $this->tmpl->setAttribute('select_menu_def', 'visibility', 'visible'); | |
225 | 259 | |
226 | 260 | // ページ定義IDとページ定義のレコードシリアル番号を更新 |
227 | 261 | $this->endPageDefParam($defSerial, $defConfigId, $this->paramObj); |
@@ -340,6 +374,29 @@ class admin_default_menuWidgetContainer extends BaseAdminWidgetContainer | ||
340 | 374 | $this->createItemList(); |
341 | 375 | if (count($this->serialArray) <= 0) $this->tmpl->setAttribute('itemlist', 'visibility', 'hidden');// 一覧非表示 |
342 | 376 | |
377 | + // 選択状態はメニュー設定に固定 | |
378 | + $activeIndex = 0; | |
379 | + | |
380 | + // ナビゲーションタブ作成 | |
381 | + $tabItemIndex = 0; | |
382 | + $tabDef = array(); | |
383 | + $tabItem = new stdClass; | |
384 | + $tabItem->name = 'ウィジェット設定'; | |
385 | + $tabItem->task = ''; | |
386 | + $tabItem->url = '#widget_config'; | |
387 | + $tabItem->parent = 0; | |
388 | + $tabItem->active = false; | |
389 | + $tabDef[] = $tabItem; $tabItemIndex++; | |
390 | + $tabItem = new stdClass; | |
391 | + $tabItem->name = 'メニュー定義'; | |
392 | + $tabItem->task = ''; | |
393 | + $tabItem->url = '#menu_define'; | |
394 | + $tabItem->parent = 0; | |
395 | + $tabItem->active = false; | |
396 | + $tabDef[] = $tabItem; $tabItemIndex++; | |
397 | + $tabHtml = $this->gDesign->createConfigNavTab($tabDef); | |
398 | + $this->tmpl->addVar("_widget", "nav_tab", $tabHtml); | |
399 | + | |
343 | 400 | // メニュー定義画面のURLを作成 |
344 | 401 | $taskValue = 'menudef'; |
345 | 402 | if (empty($isHierMenu)) $taskValue = 'smenudef'; |
@@ -5,7 +5,7 @@ | ||
5 | 5 | * |
6 | 6 | * @package Magic3 Framework |
7 | 7 | * @author 平田直毅(Naoki Hirata) <naoki@aplo.co.jp> |
8 | - * @copyright Copyright 2006-2013 Magic3 Project. | |
8 | + * @copyright Copyright 2006-2014 Magic3 Project. | |
9 | 9 | * @license http://www.gnu.org/copyleft/gpl.html GPL License |
10 | 10 | * @version SVN: $Id$ |
11 | 11 | * @link http://www.magic3.org |
@@ -36,44 +36,50 @@ function listItem(){ | ||
36 | 36 | document.main.submit(); |
37 | 37 | return true; |
38 | 38 | } |
39 | +function reloadMenuDef() | |
40 | +{ | |
41 | + var url = ''; | |
42 | + var id = document.main.menuid.value; | |
43 | + if (document.main.is_hier.checked){ | |
44 | + url = "?task=menudef&openby=tabs&menuid=" + id; | |
45 | + } else { | |
46 | + url = "?task=smenudef&openby=tabs&menuid=" + id; | |
47 | + } | |
48 | + document.getElementById("menu_def").src = url; | |
49 | +} | |
50 | +function activateTab(tab) | |
51 | +{ | |
52 | + $('.nav-tabs a[href="#' + tab + '"]').tab('show'); | |
53 | +}; | |
39 | 54 | $(function(){ |
40 | - // タブ作成 | |
41 | - $tabs = $("#main_area").tabs({ | |
42 | - select: function(event, ui){ | |
43 | - if (ui.panel.id == 'menu_define'){ | |
44 | - var url = ''; | |
45 | - var id = document.main.menuid.value; | |
46 | - if (document.main.is_hier.checked){ | |
47 | - url = "?task=menudef&openby=tabs&menuid=" + id; | |
48 | - } else { | |
49 | - url = "?task=smenudef&openby=tabs&menuid=" + id; | |
50 | - } | |
51 | - document.getElementById("menu_def").src = url; | |
52 | - } | |
53 | - return true; | |
54 | - } | |
55 | - }); | |
56 | - $('#edit_menu').click(function() { | |
57 | - $tabs.tabs('select', 1); | |
58 | - return false; | |
55 | + // メニュー定義画面作成 | |
56 | + reloadMenuDef(); | |
57 | + | |
58 | + // タブを選択 | |
59 | + activateTab('{SELECT_TAB}'); | |
60 | + | |
61 | + // 階層化の種別選択 | |
62 | + $('#is_hier').click(function(){ | |
63 | + reloadMenuDef(); | |
59 | 64 | }); |
60 | - <patTemplate:tmpl name="select_menu_def" visibility="hidden">$tabs.tabs('select', 1);</patTemplate:tmpl> | |
61 | 65 | }); |
62 | 66 | //]]> |
63 | 67 | </script> |
64 | -<div id="main_area" class="m3config_tabs"> | |
65 | - <ul> | |
68 | +{NAV_TAB} | |
69 | +<!--<div id="main_area" class="m3config_tabs">--> | |
70 | +<div class="m3config_tabs tab-content"> | |
71 | +<!-- <ul> | |
66 | 72 | <li><a href="#widget_config"><span>ウィジェット設定</span></a></li> |
67 | 73 | <li><a href="#menu_define"><span>メニュー定義</span></a></li> |
68 | - </ul> | |
69 | - <div id="widget_config"> | |
74 | + </ul>--> | |
75 | + <div id="widget_config" class="tab-pane"> | |
70 | 76 | <!-- m3:ErrorMessage --> |
71 | 77 | <form method="post" name="main"> |
72 | 78 | <input type="hidden" name="task" /> |
73 | 79 | <input type="hidden" name="act" /> |
74 | 80 | <input type="hidden" name="serial" value="{SERIAL}" /> |
75 | 81 | <!-- m3:PostParam --> |
76 | -<table style="margin: 0 auto;width:95%;"> | |
82 | +<table style="margin: 0 auto;"> | |
77 | 83 | <tr><td><span {_HELP_MENU_DETAIL}><label>メニュー設定</label></span></td> |
78 | 84 | <td align="right"><span {_HELP_MENU_LIST_BTN}><input type="button" class="button" onclick="listItem();" value="設定一覧" /></span> |
79 | 85 | </td></tr> |
@@ -115,7 +121,7 @@ $(function(){ | ||
115 | 121 | </tr> |
116 | 122 | <tr class="even"> |
117 | 123 | <td class="table-headside"><span {_HELP_MENU_DESIGN}>デザイン</span></td> |
118 | - <td colspan="3"><label class="item_list_inline"><input type="checkbox" name="is_hier" {IS_HIER} {IS_HIER_DISABLED} />階層化あり</label><label class="item_list_inline"><input type="checkbox" name="item_vertical_menu" {VERTICAL_MENU} />縦型メニュー</label> | |
124 | + <td colspan="3"><label class="item_list_inline"><input type="checkbox" id="is_hier" name="is_hier" {IS_HIER} {IS_HIER_DISABLED} />階層化あり</label><label class="item_list_inline"><input type="checkbox" name="item_vertical_menu" {VERTICAL_MENU} />縦型メニュー</label> | |
119 | 125 | </td> |
120 | 126 | </tr> |
121 | 127 | <tr> |
@@ -135,7 +141,8 @@ $(function(){ | ||
135 | 141 | </table> |
136 | 142 | </form> |
137 | 143 | </div> |
138 | - <div id="menu_define" style="padding:0;"> | |
144 | + <!--<div id="menu_define" style="padding:0;">--> | |
145 | + <div id="menu_define" class="tab-pane"> | |
139 | 146 | <iframe id="menu_def" name="menu_def" style="width:100%; height:2000px; border:none;" allowTransparency="true" frameborder="0">{_LC_LABEL_NENU_DEF}</iframe> |
140 | 147 | </div> |
141 | 148 | </div> |
@@ -5,7 +5,7 @@ | ||
5 | 5 | * |
6 | 6 | * @package Magic3 Framework |
7 | 7 | * @author 平田直毅(Naoki Hirata) <naoki@aplo.co.jp> |
8 | - * @copyright Copyright 2006-2013 Magic3 Project. | |
8 | + * @copyright Copyright 2006-2014 Magic3 Project. | |
9 | 9 | * @license http://www.gnu.org/copyleft/gpl.html GPL License |
10 | 10 | * @version SVN: $Id$ |
11 | 11 | * @link http://www.magic3.org |
@@ -37,51 +37,60 @@ function cancelItem(){ | ||
37 | 37 | document.main.submit(); |
38 | 38 | return true; |
39 | 39 | } |
40 | +function reloadMenuDef() | |
41 | +{ | |
42 | + document.getElementById("menu_def").src = '{URL}'; | |
43 | +} | |
44 | +function activateTab(tab) | |
45 | +{ | |
46 | + $('.nav-tabs a[href="#' + tab + '"]').tab('show'); | |
47 | +}; | |
40 | 48 | $(function(){ |
41 | - // タブ作成 | |
42 | - $tabs = $("#main_area").tabs({ | |
43 | - select: function(event, ui){ | |
44 | - if (ui.panel.id == 'menu_define'){ | |
45 | - document.getElementById("menu_def").src = '{URL}'; | |
46 | - } | |
47 | - return true; | |
48 | - } | |
49 | - }); | |
50 | - $('#edit_menu').click(function(){ | |
51 | - $tabs.tabs('select', 1); | |
49 | + // メニュー定義画面作成 | |
50 | + reloadMenuDef(); | |
51 | + | |
52 | + // タブを選択 | |
53 | + activateTab('widget_config'); | |
54 | + | |
55 | + $('#m3navtab a[href="#widget_config"]').click(function(e){ | |
56 | + e.preventDefault(); | |
57 | + | |
58 | + cancelItem(); | |
52 | 59 | return false; |
53 | 60 | }); |
54 | - $('#tab_widget').click(function(){ | |
55 | - window.location.href = window.location.href; | |
56 | - }); | |
61 | + | |
57 | 62 | // スクロールバー付きのテーブルを作成 |
58 | 63 | m3_tableWithScrollbar('itemlist', -1, 0); |
59 | 64 | }); |
60 | 65 | //]]> |
61 | 66 | </script> |
62 | -<div id="main_area" class="m3config_tabs"> | |
63 | - <ul> | |
67 | +{NAV_TAB} | |
68 | +<!--<div id="main_area" class="m3config_tabs">--> | |
69 | +<div class="m3config_tabs tab-content"> | |
70 | +<!-- <ul> | |
64 | 71 | <li><a id="tab_widget" href="#widget_config"><span>ウィジェット設定</span></a></li> |
65 | 72 | <li><a href="#menu_define"><span>メニュー定義</span></a></li> |
66 | - </ul> | |
67 | - <div id="widget_config"> | |
73 | + </ul>--> | |
74 | + <!--<div id="widget_config">--> | |
75 | + <div id="widget_config" class="tab-pane"> | |
68 | 76 | <!-- m3:ErrorMessage --> |
69 | 77 | <form method="post" name="main"> |
70 | 78 | <input type="hidden" name="task" value="list" /> |
79 | +<input type="hidden" name="anchor" value="widget_config" /> | |
71 | 80 | <input type="hidden" name="act" /> |
72 | 81 | <input type="hidden" name="serial" /> |
73 | 82 | <input type="hidden" name="seriallist" value="{SERIAL_LIST}" /> |
74 | 83 | <input type="hidden" name="menuid" value="{MENU_ID}" /> |
75 | 84 | <input type="hidden" name="is_hier" value="{IS_HIER}" /> |
76 | 85 | <!-- m3:PostParam --> |
77 | -<table width="95%" style="margin: 0 auto;"> | |
86 | +<table style="margin: 0 auto;"> | |
78 | 87 | <tr><td> |
79 | 88 | <span {_HELP_MENU_LIST}><label>メニュー設定一覧</label></span> |
80 | 89 | </td><td align="right"><span {_HELP_MENU_DEL_BTN}><input type="button" class="button" onclick="delItem();" value="削除" /></span> |
81 | 90 | <span {_HELP_MENU_RET_BTN}><input type="button" class="button" onclick="cancelItem();" value="戻る" /></span> |
82 | 91 | </td></tr> |
83 | 92 | <tr><td colspan="2"> |
84 | -<table id="itemlist" class="simple-table" width="100%"> | |
93 | +<table id="itemlist" class="simple-table" width="950"> | |
85 | 94 | <thead> |
86 | 95 | <tr> |
87 | 96 | <th width="35" align="center"><span {_HELP_MENU_CHECK}>選択</span></th> |
@@ -107,7 +116,8 @@ $(function(){ | ||
107 | 116 | </table> |
108 | 117 | </form> |
109 | 118 | </div> |
110 | - <div id="menu_define"> | |
119 | + <!--<div id="menu_define">--> | |
120 | + <div id="menu_define" class="tab-pane"> | |
111 | 121 | <iframe id="menu_def" name="menu_def" style="width:100%; height:2000px; border:none;" allowTransparency="true" frameborder="0">{_LC_LABEL_NENU_DEF}</iframe> |
112 | 122 | </div> |
113 | 123 | </div> |