diff --git a/common/js/tree_menu.js b/common/js/tree_menu.js index ea1a83f09..c3bc02b66 100644 --- a/common/js/tree_menu.js +++ b/common/js/tree_menu.js @@ -232,8 +232,9 @@ function drawNode(parent_node, menu_id) { html += 'linefolder'; - if(node_move_callback_func[menu_id]) { - html += ''; + var chk_enable = xGetElementById(menu_id+"_enable_move"); + if(chk_enable) { + html += ''; } else { html += ''; } @@ -251,6 +252,18 @@ function drawNode(parent_node, menu_id) { return output; } +// 관리자 모드일 경우 *_enable_move 의 값에 따라 메뉴 이동을 시키거나 정보를 보여주도록 변경 +function doNodeFunc(obj, menu_id, node_srl, zone_id) { + var chk_enable = xGetElementById(menu_id+"_enable_move"); + if(!chk_enable || chk_enable.checked!=true || !obj) { + selectNode(menu_id,node_srl,zone_id); + return; + } + + deSelectNode(); + tree_drag_enable(obj,tree_drag_start,tree_drag,tree_drag_end); +} + // 수동으로 메뉴를 선택하도록 함 function manualSelectNode(menu_id, node_srl) { var zone_id = "menu_"+menu_id+"_"+node_srl; @@ -286,22 +299,23 @@ function toggleFolder(zone_id) { // 노드의 글자 선택시 var prev_selected_node = null; function selectNode(menu_id, node_srl, zone_id, move_url) { - // 이전에 선택된 노드가 있었다면 원래데로 돌림 - if(prev_selected_node) { - prev_selected_node.style.backgroundColor = "#ffffff"; - prev_selected_node.style.fontWeight = "normal"; - prev_selected_node.style.color = "#000000"; - } - // 선택된 노드를 찾아봄 var node_zone = xGetElementById(zone_id+'_node'); if(!node_zone) return; + // 이전에 선택된 노드가 있었다면 원래데로 돌림 + if(prev_selected_node) { + var prev_zone = xGetElementById(prev_selected_node.id); + prev_zone.style.backgroundColor = "#ffffff"; + prev_zone.style.fontWeight = "normal"; + prev_zone.style.color = "#000000"; + } + // 선택된 노드의 글자를 변경 + prev_selected_node = node_zone; node_zone.style.backgroundColor = "#0e078f"; node_zone.style.fontWeight = "bold"; node_zone.style.color = "#FFFFFF"; - prev_selected_node = node_zone; // 함수 실행 if(typeof(move_url)=="undefined"||move_url==true) { @@ -418,7 +432,7 @@ function tree_get_tmp_object(obj) { } // 메뉴에 마우스 클릭이 일어난 시점에 드래그를 위한 제일 첫 동작 (해당 object에 각종 함수나 상태변수 설정) -function tree_drag_enable(child_obj, funcDragStart, funcDrag, funcDragEnd, callback_func) { +function tree_drag_enable(child_obj, funcDragStart, funcDrag, funcDragEnd) { // 클릭이 일어난 메뉴의 상위 object를 찾음 var obj = child_obj.parentNode.parentNode; @@ -429,16 +443,14 @@ function tree_drag_enable(child_obj, funcDragStart, funcDrag, funcDragEnd, callb obj.drag_end = funcDragEnd; obj.target_id = null; - // mousedown이벤트 값을 지정 - xAddEventListener(obj, 'mousedown', tree_mouse_down, false); - // 드래그 가능하지 않다면 드래그 가능하도록 상태 지정하고 mousemove이벤트 등록 if (!tree_drag_manager.isDrag) { tree_drag_manager.isDrag = true; xAddEventListener(document, 'mousemove', tree_drag_mouse_move, false); - - if(typeof(callback_func)!="undefined") callback_func(); } + + // mousedown이벤트 값을 지정 + xAddEventListener(obj, 'mousedown', tree_mouse_down, false); } // 드래그를 시작할때 호출되는 함수 (이동되는 형태를 보여주기 위한 작업을 함) @@ -487,14 +499,6 @@ function tree_drag(tobj, dx, dy) { tobj.target_id = target_obj.id; } catch(e) { } - } else if(tobj.xDPY >= t+h && tobj.xDPY <= tt) { - if(target_obj.nextSibling == tobj) { - try { - target_obj.parentNode.insertBefore(tobj, target_obj.nextSibling); - tobj.target_id = target_obj.id; - } catch(e) { - } - } } } } @@ -602,16 +606,13 @@ function tree_drag_disable(id) { xRemoveEventListener(obj, 'mousedown', tree_mouse_down, false); - if(obj.id && obj.target_id) { + if(obj.id && obj.target_id && obj.id!=obj.target_id) { var menu_id = obj.id.replace(/menu_/,''); menu_id = menu_id.replace(/_([0-9]+)$/,''); if(menu_id) { var callback_move_func = node_move_callback_func[menu_id]; - if(callback_move_func) { - callback_move_func(obj.id, obj.target_id); - obj.callback_func = null; - obj.target_id = null; - } + if(callback_move_func) callback_move_func(obj.id, obj.target_id); } - } + } + obj.target_id = null; } diff --git a/modules/layout/lang/ko.lang.php b/modules/layout/lang/ko.lang.php index c7e85da27..de9b40a35 100644 --- a/modules/layout/lang/ko.lang.php +++ b/modules/layout/lang/ko.lang.php @@ -25,6 +25,8 @@ $lang->menu_group_srls = '그룹 제한'; $lang->cmd_move_to_installed_list = "생성된 목록 보기"; + $lang->cmd_enable_move_menu = "메뉴 옮기기"; + $lang->about_downloaded_layouts = "다운로드 되어 있는 레이아웃 목록"; $lang->about_title = '모듈에 연결시 쉽게 구분할 수 있는 제목을 입력해주세요'; $lang->about_menu_management = "메뉴관리는 선택하신 레이아웃에서 사용하는 메뉴를 구성할 수 있도록 합니다.\n정해진 단계까지 메뉴를 구성 가능하며 입력하신 메뉴를 클릭하시면 상세 정보를 입력할 수 있습니다.\n폴더그림을 클릭하시면 메뉴를 확장하실 수 있습니다.\n간혹 메뉴가 정상적으로 나타나지 않으면 \"캐시파일 재생성\" 버튼을 눌러서 정보를 갱신하세요.\n* 정해진 단계 이상의 메뉴는 제대로 표시되지 않을 수 있습니다."; diff --git a/modules/layout/tpl.admin/layout_info.html b/modules/layout/tpl.admin/layout_info.html index b030e41d5..0dfed1c42 100644 --- a/modules/layout/tpl.admin/layout_info.html +++ b/modules/layout/tpl.admin/layout_info.html @@ -86,8 +86,11 @@ -
+ +
+ +