diff --git a/modules/board/board.controller.php b/modules/board/board.controller.php index fe1c492fc..a20d13395 100644 --- a/modules/board/board.controller.php +++ b/modules/board/board.controller.php @@ -12,7 +12,7 @@ **/ function init() { } - + /** * @brief 문서 입력 **/ @@ -216,6 +216,36 @@ $oDocumentController->addGrant($document_srl); } } + + /** + * @brief 관리자가 글 선택시 세션에 담음 + **/ + function procBoardAdminAddCart() { + $document_srl = Context::get('srl'); + $check_flag = Context::get('check_flag'); + if(!$document_srl || !in_array($check_flag, array('add','remove'))) return; + + $flag_list = $_SESSION['document_management'][$this->module_srl]; + + if($check_flag == 'remove') unset($flag_list[$document_srl]); + else $flag_list[$document_srl] = true; + + $_SESSION['document_management'][$this->module_srl] = $flag_list; + } + + /** + * @brief 세션에 담긴 선택글의 이동 + **/ + function procBoardAdminMoveCheckedDocument() { + $this->setMessage('success_moved'); + } + + /** + * @brief 세션에 담긴 선택글의 삭제 + **/ + function procBoardAdminDeleteCheckedDocument() { + $this->setMessage('success_deleted'); + } /** * @brief 권한 추가 diff --git a/modules/board/board.view.php b/modules/board/board.view.php index afb2b9094..744adee22 100644 --- a/modules/board/board.view.php +++ b/modules/board/board.view.php @@ -153,6 +153,11 @@ } Context::set('search_option', $search_option); + // 관리자일 경우 체크한 문서들의 목록을 세팅 + if($this->grant->is_admin) { + Context::set('check_list',$_SESSION['document_management'][$this->module_srl]); + } + $this->setTemplateFile('list'); } @@ -583,5 +588,32 @@ $this->setTemplateFile('grant_list'); } + + /** + * @brief 선택한 목록 출력 + **/ + function dispBoardAdminManageDocument() { + // 팝업 레이아웃 선택 + $this->setLayoutFile('popup_layout'); + + // 선택한 목록을 세션에서 가져옴 + $flag_list = $_SESSION['document_management'][$this->module_srl]; + + // 목록이 있으면 게시글을 가져옴 + $document_srl_list = array_keys($flag_list); + if(count($document_srl_list)) { + $oDocumentModeul = &getModel('document'); + $document_list = $oDocumentModeul->getDocuments($document_srl_list, $this->grant->is_admin); + Context::set('document_list', $document_list); + } + + // 게시판의 목록을 가져옴 + $output = executeQuery('board.getAllBoard', $args); + $board_list = $output->data; + if($board_list && !is_array($board_list)) $board_list = array($board_list); + Context::set('board_list', $board_list); + + $this->setTemplateFile('checked_list'); + } } ?> diff --git a/modules/board/conf/module.xml b/modules/board/conf/module.xml index b50063ce1..440c39a91 100644 --- a/modules/board/conf/module.xml +++ b/modules/board/conf/module.xml @@ -56,7 +56,9 @@ + + @@ -64,5 +66,7 @@ + + diff --git a/modules/board/lang/ko.lang.php b/modules/board/lang/ko.lang.php index 355e45446..904c07c88 100644 --- a/modules/board/lang/ko.lang.php +++ b/modules/board/lang/ko.lang.php @@ -6,44 +6,47 @@ **/ // 버튼에 사용되는 언어 - $lang->cmd_board_list = "게시판 목록"; - $lang->cmd_module_config = "게시판 공통 설정"; - $lang->cmd_view_info = "게시판 정보"; - $lang->cmd_manage_category = "분류관리"; - $lang->cmd_manage_grant = "권한관리"; - $lang->cmd_manage_skin = "스킨관리"; + $lang->cmd_board_list = '게시판 목록'; + $lang->cmd_module_config = '게시판 공통 설정'; + $lang->cmd_view_info = '게시판 정보'; + $lang->cmd_manage_category = '분류관리'; + $lang->cmd_manage_grant = '권한관리'; + $lang->cmd_manage_skin = '스킨관리'; + $lang->cmd_manage_document = '게시글 관리'; // 항목 - $lang->header_text = "상단 내용"; - $lang->footer_text = "하단 내용"; - $lang->use_category = "분류 사용"; - $lang->category_title = "분류명"; + $lang->header_text = '상단 내용'; + $lang->footer_text = '하단 내용'; + $lang->use_category = '분류 사용'; + $lang->category_title = '분류명'; + $lang->checked_count = '선택된 글 수'; - $lang->skin_default_info = "스킨 기본정보"; - $lang->skin_maker = "스킨제작자"; - $lang->skin_maker_homepage = "홈페이지"; + $lang->skin_default_info = '스킨 기본정보'; + $lang->skin_maker = '스킨제작자'; + $lang->skin_maker_homepage = '홈페이지'; - $lang->test = "테스트"; - $lang->about_test = "테스트는 블라블라..."; + $lang->test = '테스트'; + $lang->about_test = '테스트는 블라블라...'; // 주절 주절.. - $lang->about_mid = "모듈이름은 http://주소/?mid=모듈이름 처럼 직접 호출할 수 있는 값입니다. (영문+숫자만 가능)"; - $lang->about_category = "분류를 통한 관리를 할 수 있도록 합니다. 모듈 분류의 관리는 모듈관리 > 모듈카테고리에서 하실 수 있습니다."; - $lang->about_browser_title = "브라우저의 제목에 나타나는 값입니다. RSS/Trackback에서도 사용됩니다."; - $lang->about_description= "관리용으로 사용되는 설명입니다"; - $lang->about_default = "선택하시면 사이트에 mid값 없이 접속하였을 경우 기본으로 보여줍니다"; - $lang->about_header_text = "모듈의 상단에 표시되는 내용입니다 (html 태그 사용 가능)"; - $lang->about_footer_text = "모듈의 하단에 표시되는 내용입니다 (html 태그 사용 가능)"; - $lang->about_skin = "모듈의 스킨을 선택하실 수 있습니다"; - $lang->about_use_category = "선택하시면 분류기능을 사용할 수 있습니다"; - $lang->about_list_count = "한페이지에 표시될 글의 수를 지정하실 수 있습니다. (기본 20개)"; - $lang->about_page_count = "목록 하단 페이지 이동 하는 링크의 수를 지정하실 수 있습니다. (기본 10개)"; + $lang->about_mid = '모듈이름은 http://주소/?mid=모듈이름 처럼 직접 호출할 수 있는 값입니다. (영문+숫자만 가능)'; + $lang->about_category = '분류를 통한 관리를 할 수 있도록 합니다. 모듈 분류의 관리는 모듈관리 > 모듈카테고리에서 하실 수 있습니다.'; + $lang->about_browser_title = '브라우저의 제목에 나타나는 값입니다. RSS/Trackback에서도 사용됩니다.'; + $lang->about_description= '관리용으로 사용되는 설명입니다'; + $lang->about_default = '선택하시면 사이트에 mid값 없이 접속하였을 경우 기본으로 보여줍니다'; + $lang->about_header_text = '모듈의 상단에 표시되는 내용입니다 (html 태그 사용 가능)'; + $lang->about_footer_text = '모듈의 하단에 표시되는 내용입니다 (html 태그 사용 가능)'; + $lang->about_skin = '모듈의 스킨을 선택하실 수 있습니다'; + $lang->about_use_category = '선택하시면 분류기능을 사용할 수 있습니다'; + $lang->about_list_count = '한페이지에 표시될 글의 수를 지정하실 수 있습니다. (기본 20개)'; + $lang->about_page_count = '목록 하단 페이지 이동 하는 링크의 수를 지정하실 수 있습니다. (기본 10개)'; - $lang->about_admin_id = "해당 모듈에 대해 최고 권한을 가지는 관리자를 지정할 수 있습니다.
,(콤마)로 다수 아이디 지정이 가능합니다. (관리자페이지 접근은 불가능)"; - $lang->about_grant = "특정 권한의 대상을 모두 해제하시면 로그인하지 않은 회원까지 권한을 가질 수 있습니다"; + $lang->about_admin_id = '해당 모듈에 대해 최고 권한을 가지는 관리자를 지정할 수 있습니다.
,(콤마)로 다수 아이디 지정이 가능합니다. (관리자페이지 접근은 불가능)'; + $lang->about_grant = '특정 권한의 대상을 모두 해제하시면 로그인하지 않은 회원까지 권한을 가질 수 있습니다'; - $lang->msg_new_module = "모듈 생성"; - $lang->msg_update_module = "모듈 수정"; - $lang->msg_category_is_null = "등록된 분류가 없습니다"; - $lang->msg_grant_is_null = "등록된 권한 대상이 없습니다"; + $lang->msg_new_module = '모듈 생성'; + $lang->msg_update_module = '모듈 수정'; + $lang->msg_category_is_null = '등록된 분류가 없습니다'; + $lang->msg_grant_is_null = '등록된 권한 대상이 없습니다'; + $lang->msg_no_checked_document = '선택된 게시물이 없습니다'; ?> diff --git a/modules/board/queries/getAllBoard.xml b/modules/board/queries/getAllBoard.xml new file mode 100644 index 000000000..49554aeac --- /dev/null +++ b/modules/board/queries/getAllBoard.xml @@ -0,0 +1,14 @@ + + + + + + + + + + + + + + diff --git a/modules/board/skins/default/js/board.js b/modules/board/skins/default/js/board.js index d9f1a44aa..a9757df89 100644 --- a/modules/board/skins/default/js/board.js +++ b/modules/board/skins/default/js/board.js @@ -5,15 +5,16 @@ **/ /* 관리자가 카트 선택시 세션에 넣음 */ -function doAddCart(obj) { - var document_srl = obj.value; +function doAddCart(mid, obj) { + var srl = obj.value; var check_flag = obj.checked?'add':'remove'; var params = new Array(); - params["document_srl"] = document_srl; + params["mid"] = mid; + params["srl"] = srl; params["check_flag"] = check_flag; - exec_xml("document","procDocumentAddCart", params, null); + exec_xml("board","procBoardAdminAddCart", params, null); } /* 글쓰기 작성후 */ diff --git a/modules/board/skins/default/list.html b/modules/board/skins/default/list.html index 1efce124f..5e3386378 100644 --- a/modules/board/skins/default/list.html +++ b/modules/board/skins/default/list.html @@ -41,7 +41,7 @@ ] - + [{$lang->cmd_management}] @@ -86,8 +86,8 @@
- - checked)-->checked="true" /> + + document_srl])-->checked="true" /> {$val->title} @@ -115,10 +115,15 @@ diff --git a/modules/board/tpl/checked_list.html b/modules/board/tpl/checked_list.html new file mode 100644 index 000000000..6825275dc --- /dev/null +++ b/modules/board/tpl/checked_list.html @@ -0,0 +1,35 @@ + + + + +
+ +
{$lang->cmd_manage_document}
+ + + +
+
{$lang->checked_count} : {count($document_list)}
+ + +
+ + {$lang->cmd_move} +
+
+ + + +
{$lang->msg_no_checked_document}
+ + + + + +
diff --git a/modules/board/tpl/filter/delete_checked_document.xml b/modules/board/tpl/filter/delete_checked_document.xml new file mode 100644 index 000000000..941ef6b03 --- /dev/null +++ b/modules/board/tpl/filter/delete_checked_document.xml @@ -0,0 +1,7 @@ + +
+ + + + + diff --git a/modules/board/tpl/filter/move_checked_document.xml b/modules/board/tpl/filter/move_checked_document.xml new file mode 100644 index 000000000..6c23e7a31 --- /dev/null +++ b/modules/board/tpl/filter/move_checked_document.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/modules/board/tpl/js/board_admin.js b/modules/board/tpl/js/board_admin.js index fea2b5c16..a3ec1fa90 100644 --- a/modules/board/tpl/js/board_admin.js +++ b/modules/board/tpl/js/board_admin.js @@ -99,3 +99,9 @@ function doChangeCategory(sel_obj, url) { if(!module_category_srl) location.href=url; else location.href=url+'&module_category_srl='+module_category_srl; } + +/* 선택된 글의 삭제 또는 이동 후 */ +function completeManageDocument(ret_obj) { + alert(ret_obj['message']); + window.close(); +} diff --git a/modules/document/conf/module.xml b/modules/document/conf/module.xml index c3c6811bc..e47ff71e0 100644 --- a/modules/document/conf/module.xml +++ b/modules/document/conf/module.xml @@ -3,8 +3,6 @@ - - diff --git a/modules/document/document.controller.php b/modules/document/document.controller.php index 07d62993c..f80d14c06 100644 --- a/modules/document/document.controller.php +++ b/modules/document/document.controller.php @@ -13,21 +13,6 @@ function init() { } - /** - * @brief 관리자가 글 선택시 세션에 담음 - **/ - function procDocumentAddCart() { - $document_srl = Context::get('document_srl'); - $check_flag = Context::get('check_flag'); - - $flag_list = $_SESSION['document_management']; - - if($check_flag == 'remove') unset($flag_list[$document_srl]); - else $flag_list[$document_srl] = true; - - $_SESSION['document_management'] = $flag_list; - } - /** * @brief 관리자 페이지에서 선택된 문서들 삭제 **/ diff --git a/modules/document/document.model.php b/modules/document/document.model.php index 7034bf8c5..e353ad7a9 100644 --- a/modules/document/document.model.php +++ b/modules/document/document.model.php @@ -88,6 +88,7 @@ $output = executeQuery('document.getDocuments', $args); $document_list = $output->data; if(!$document_list) return; + if(!is_array($document_list)) $document_list = array($document_list); // 권한 체크 $oMemberModel = &getModel('member'); @@ -221,9 +222,6 @@ $oMemberModel = &getModel('member'); $member_srl = $oMemberModel->getLoggedMemberSrl(); - // 체크 플래그 - $flag_list = $_SESSION['document_management']; - foreach($output->data as $key => $document) { $is_granted = false; @@ -231,8 +229,6 @@ elseif($member_srl && $member_srl == $document->member_srl) $is_granted = true; $output->data[$key]->is_granted = $is_granted; - - if($flag_list[$document->document_srl]) $output->data[$key]->checked = true; } return $output; } diff --git a/modules/document/document.view.php b/modules/document/document.view.php index 1f1614848..395791f42 100644 --- a/modules/document/document.view.php +++ b/modules/document/document.view.php @@ -65,7 +65,6 @@ } Context::set('search_option', $search_option); - // 템플릿 지정 $this->setTemplatePath($this->module_path.'tpl'); $this->setTemplateFile('document_list'); diff --git a/modules/document/lang/ko.lang.php b/modules/document/lang/ko.lang.php index d998b72cd..3f8bd133e 100644 --- a/modules/document/lang/ko.lang.php +++ b/modules/document/lang/ko.lang.php @@ -6,7 +6,6 @@ **/ $lang->cmd_delete_checked_document = '선택항목 삭제'; - $lang->cmd_document_management = '게시글 관리'; $lang->msg_cart_is_null = '삭제할 글을 선택해주세요'; $lang->msg_category_not_moved = '이동할 수가 없습니다';