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='') {