From 69c15ee1f010781ccb2874120762bf061ec2e9a1 Mon Sep 17 00:00:00 2001 From: zero Date: Tue, 20 Nov 2007 07:12:23 +0000 Subject: [PATCH] =?UTF-8?q?=C3=AB=C2=B8=C2=94=C3=AB=C2=A1=C2=9C=C3=AA?= =?UTF-8?q?=C2=B7=C2=B8=C3=AB=C2=AA=C2=A8=C3=AB=C2=93=C2=88=C3=AC=C2=97?= =?UTF-8?q?=C2=90=C3=AC=C2=84=C2=9C=20=C3=AD=C2=8A=C2=B9=C3=AC=C2=A0=C2=95?= =?UTF-8?q?=20=C3=AA=C2=B8=C2=80=C3=AC=C2=9D=C2=B4=20=C3=AD=C2=98=C2=B8?= =?UTF-8?q?=C3=AC=C2=B6=C2=9C=C3=AB=C2=90=C2=A0=20=C3=AA=C2=B2=C2=BD=C3=AC?= =?UTF-8?q?=C2=9A=C2=B0=20=C3=AB=C2=AA=C2=A9=C3=AB=C2=A1=C2=9D=20=C3=AC?= =?UTF-8?q?=C2=B2=C2=98=C3=AB=C2=A6=C2=AC=C3=AB=C2=A5=C2=BC=20=C3=AD=C2=95?= =?UTF-8?q?=C2=98=C3=AC=C2=A7=C2=80=20=C3=AC=C2=95=C2=8A=C3=AA=C2=B3=C2=A0?= =?UTF-8?q?=20=C3=AD=C2=95=C2=B4=C3=AB=C2=8B=C2=B9=20=C3=AA=C2=B8=C2=80?= =?UTF-8?q?=C3=AB=C2=A7=C2=8C=20=C3=AB=C2=B3=C2=B4=C3=AC=C2=9D=C2=B4=C3=AB?= =?UTF-8?q?=C2=8F=C2=84=C3=AB=C2=A1=C2=9D=20=C3=AD=C2=95=C2=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: http://xe-core.googlecode.com/svn/sandbox@3026 201d5d3c-b55e-5fd7-737f-ddc643e51545 --- modules/blog/blog.view.php | 91 ++++++++++++++-------------- modules/blog/skins/xe_blog/list.html | 13 ++-- 2 files changed, 53 insertions(+), 51 deletions(-) diff --git a/modules/blog/blog.view.php b/modules/blog/blog.view.php index a2bf7f0f8..11eb3ba34 100644 --- a/modules/blog/blog.view.php +++ b/modules/blog/blog.view.php @@ -88,7 +88,7 @@ $oDocument = $oDocumentModel->getDocument(0, $this->grant->manager); - // document_srl이 있다면 해당 글을 구해오자 + // document_srl이 있다면 해당 글만 출력 if($this->grant->list && $document_srl) { // 글을 구함 @@ -109,70 +109,67 @@ // 조회수 증가 $oDocument->updateReadedCount(); - // 목록수를 1개로 수정 (글이 선택되었을 때만) - $this->list_count = 1; + // 카테고리 설정 + Context::set('category', $oDocument->get('category_srl')); - // 페이지 변수를 제거하여 직접 구하도록 변경 - unset($page); + // comment editor 생성/ 세팅 + $comment_editor[$oDocument->document_srl] = $this->getCommentEditor($oDocument->document_srl, 0, 100); + Context::set('comment_editor', $comment_editor); } - } Context::set('oDocument', $oDocument); - // 만약 document_srl은 있는데 page가 없다면 글만 호출된 경우 page를 구해서 세팅해주자.. - if($document_srl && !$page) { - $page = $oDocumentModel->getDocumentPage($document_srl, $this->module_srl, $this->list_count); - Context::set('page', $page); - } + // document_srl이 없다면 정해진데로 목록을 구함 + if(!$oDocument->isExists()) { + // 목록을 구하기 위한 옵션 + $args->module_srl = $this->module_srl; ///< 현재 모듈의 module_srl + $args->page = $page; ///< 페이지 + $args->list_count = $this->list_count; ///< 한페이지에 보여줄 글 수 + $args->page_count = $this->page_count; ///< 페이지 네비게이션에 나타날 페이지의 수 - // 목록을 구하기 위한 옵션 - $args->module_srl = $this->module_srl; ///< 현재 모듈의 module_srl - $args->page = $page; ///< 페이지 - $args->list_count = $this->list_count; ///< 한페이지에 보여줄 글 수 - $args->page_count = $this->page_count; ///< 페이지 네비게이션에 나타날 페이지의 수 + // 검색 옵션 + $args->search_target = trim(Context::get('search_target')); ///< 검색대상 + $args->search_keyword = trim(Context::get('search_keyword')); ///< 검색어 - // 검색 옵션 - $args->search_target = trim(Context::get('search_target')); ///< 검색대상 - $args->search_keyword = trim(Context::get('search_keyword')); ///< 검색어 + // 키워드 검색이 아닌 검색일 경우 목록의 수를 40개로 고정 + if($args->search_target && $args->search_keyword) $args->list_count = 40; - // 키워드 검색이 아닌 검색일 경우 목록의 수를 40개로 고정 - if($args->search_target && $args->search_keyword) $args->list_count = 40; + // 키워드 검색의 경우 제목,내용으로 검색 대상 고정 + if($args->search_keyword && !$args->search_target) $args->search_target = "title_content"; - // 키워드 검색의 경우 제목,내용으로 검색 대상 고정 - if($args->search_keyword && !$args->search_target) $args->search_target = "title_content"; + // 블로그 카테고리 + $args->category_srl = (int)Context::get('category'); - // 블로그 카테고리 - $args->category_srl = (int)Context::get('category'); + $args->sort_index = 'list_order'; ///< 소팅 값 - $args->sort_index = 'list_order'; ///< 소팅 값 + // 목록 구함, document->getDocumentList 에서 걍 알아서 다 해버리는 구조 + $output = $oDocumentModel->getDocumentList($args, true); - // 목록 구함, document->getDocumentList 에서 걍 알아서 다 해버리는 구조 - $output = $oDocumentModel->getDocumentList($args, true); + // 템플릿에 쓰기 위해서 document_model::getDocumentList() 의 return object에 있는 값들을 세팅 + Context::set('total_count', $output->total_count); + Context::set('total_page', $output->total_page); + Context::set('page', $output->page); + Context::set('document_list', $output->data); + Context::set('page_navigation', $output->page_navigation); - // 템플릿에 쓰기 위해서 document_model::getDocumentList() 의 return object에 있는 값들을 세팅 - Context::set('total_count', $output->total_count); - Context::set('total_page', $output->total_page); - Context::set('page', $output->page); - Context::set('document_list', $output->data); - Context::set('page_navigation', $output->page_navigation); - - // 문서 갯수만큼 comment editor 생성 - if(count($output->data)) { - foreach($output->data as $obj) { - $comment_editor[$obj->document_srl] = $this->getCommentEditor($obj->document_srl, 0, 100); + // 문서 갯수만큼 comment editor 생성 + if(count($output->data)) { + foreach($output->data as $obj) { + $comment_editor[$obj->document_srl] = $this->getCommentEditor($obj->document_srl, 0, 100); + } } - } - // 에디터 세팅 - Context::set('comment_editor', $comment_editor); + // 에디터 세팅 + Context::set('comment_editor', $comment_editor); - // 템플릿에서 사용할 검색옵션 세팅 - $count_search_option = count($this->search_option); - for($i=0;$i<$count_search_option;$i++) { - $search_option[$this->search_option[$i]] = Context::getLang($this->search_option[$i]); + // 템플릿에서 사용할 검색옵션 세팅 + $count_search_option = count($this->search_option); + for($i=0;$i<$count_search_option;$i++) { + $search_option[$this->search_option[$i]] = Context::getLang($this->search_option[$i]); + } + Context::set('search_option', $search_option); } - Context::set('search_option', $search_option); // 블로그의 코멘트는 ajax로 호출되기에 미리 css, js파일을 import Context::addJsFile('./modules/editor/tpl/js/editor.js'); diff --git a/modules/blog/skins/xe_blog/list.html b/modules/blog/skins/xe_blog/list.html index 5cec3afe5..dd99e17d4 100644 --- a/modules/blog/skins/xe_blog/list.html +++ b/modules/blog/skins/xe_blog/list.html @@ -1,6 +1,11 @@ - + + + + + + @@ -11,10 +16,8 @@ - - - + + +