From a9f4aee93ff9cfa408d63d24aecf69de0d8f81f0 Mon Sep 17 00:00:00 2001 From: thisgun Date: Wed, 17 May 2017 14:09:05 +0900 Subject: [PATCH] =?UTF-8?q?=EB=A9=94=EB=89=B4=20=EC=B6=94=EA=B0=80=20?= =?UTF-8?q?=EB=8C=80=EC=83=81=EC=97=90=EC=84=9C=20=EA=B2=8C=EC=8B=9C?= =?UTF-8?q?=ED=8C=90=EC=9D=BC=20=EA=B2=BD=EC=9A=B0=20=EA=B2=8C=EC=8B=9C?= =?UTF-8?q?=ED=8C=90=20=EA=B7=B8=EB=A3=B9=20=ED=91=9C=EC=8B=9C=ED=95=98?= =?UTF-8?q?=EA=B8=B0=20#73?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- adm/css/admin.css | 1 + adm/menu_form.php | 50 +++++++++++++++++++++++++++++++++++++--- adm/menu_form_search.php | 19 +++++++++++++-- lib/common.lib.php | 21 +++++++++++++++++ 4 files changed, 86 insertions(+), 5 deletions(-) diff --git a/adm/css/admin.css b/adm/css/admin.css index 4028c3b63..be142eda0 100644 --- a/adm/css/admin.css +++ b/adm/css/admin.css @@ -311,6 +311,7 @@ tfoot td {font-weight:bold;text-align:center} #menu_frm #menu_result {margin:20px 0} #menulist .sub_menu_class {padding-left:25px;background:url('../img/sub_menu_ico.gif') 5px 15px no-repeat} +.exist_menu_link {font-weight:bold;color:red} /* 회원관리 목록 */ .mb_leave_msg {color:#b6b6b6} diff --git a/adm/menu_form.php b/adm/menu_form.php index 0db45d575..15592bd33 100644 --- a/adm/menu_form.php +++ b/adm/menu_form.php @@ -43,13 +43,57 @@ $(function() { "./menu_form_search.php" ); - $("#me_type").on("change", function() { - var type = $(this).val(); + function link_checks_all_chage(){ + + var $links = $(opener.document).find("#menulist input[name='me_link[]']"), + $o_link = $(".td_mngsmall input[name='link[]']"), + hrefs = [], + menu_exist = false; + + if( $links.length ){ + $links.each(function( index ) { + hrefs.push( $(this).val() ); + }); + + $o_link.each(function( index ) { + if( $.inArray( $(this).val(), hrefs ) != -1 ){ + $(this).closest("tr").find("td:eq( 0 )").addClass("exist_menu_link"); + menu_exist = true; + } + }); + } + + if( menu_exist ){ + $(".menu_exists_tip").show(); + } else { + $(".menu_exists_tip").hide(); + } + } + + function menu_result_change( type ){ + + var dfd = new $.Deferred(); $("#menu_result").empty().load( "./menu_form_search.php", - { type : type } + { type : type }, + function(){ + dfd.resolve('Finished'); + } ); + + return dfd.promise(); + } + + $("#me_type").on("change", function() { + var type = $(this).val(); + + var promise = menu_result_change( type ); + + promise.done(function(message) { + link_checks_all_chage(type); + }); + }); $(document).on("click", "#add_manual", function() { diff --git a/adm/menu_form_search.php b/adm/menu_form_search.php index 1d5ff3ee7..c11c6288e 100644 --- a/adm/menu_form_search.php +++ b/adm/menu_form_search.php @@ -11,7 +11,7 @@ switch($type) { order by gr_order, gr_id "; break; case 'board': - $sql = " select bo_table as id, bo_subject as subject + $sql = " select bo_table as id, bo_subject as subject, gr_id from {$g5['board_table']} order by bo_order, bo_table "; break; @@ -32,13 +32,18 @@ if($sql) { for($i=0; $row=sql_fetch_array($result); $i++) { if($i == 0) { + + $bbs_subject_title = ($type == 'board') ? '게시판제목' : '제목'; ?>
- + + + + @@ -63,6 +68,12 @@ if($sql) { + + +
제목게시판 그룹 선택
"> @@ -76,6 +87,10 @@ if($sql) {
+ +
diff --git a/lib/common.lib.php b/lib/common.lib.php index 7785a2cd2..65fd95d66 100644 --- a/lib/common.lib.php +++ b/lib/common.lib.php @@ -3260,6 +3260,27 @@ function check_write_token($bo_table) return true; } +function get_call_func_cache($func, $args=array()){ + + static $cache = array(); + + $key = md5(serialize($args)); + + if( isset($cache[$func]) && isset($cache[$func][$key]) ){ + return $cache[$func][$key]; + } + + $result = null; + + try{ + $cache[$func][$key] = $result = call_user_func_array($func, $args); + } catch (Exception $e) { + return null; + } + + return $result; +} + // include 하는 경로에 data file 경로가 포함되어 있는지 체크합니다. function is_include_path_check($path='') {