From dc6fcf3fe0d4b99cca1de61a236da83bcdfefac3 Mon Sep 17 00:00:00 2001 From: zero Date: Fri, 20 Apr 2007 04:26:28 +0000 Subject: [PATCH] git-svn-id: http://xe-core.googlecode.com/svn/trunk@1257 201d5d3c-b55e-5fd7-737f-ddc643e51545 --- modules/blog/blog.model.php | 28 ++++++++++++++ modules/blog/blog.view.php | 10 ++--- modules/blog/conf/module.xml | 2 + modules/blog/skins/default/comment.html | 8 ++-- modules/blog/skins/default/comment_form.html | 3 -- modules/blog/skins/default/js/blog.js | 37 ++++++++++++++++++- modules/blog/skins/default/trackback.html | 2 +- modules/blog/skins/default/view_document.html | 4 +- modules/editor/editor.model.php | 1 - 9 files changed, 78 insertions(+), 17 deletions(-) diff --git a/modules/blog/blog.model.php b/modules/blog/blog.model.php index 97ee7b6b1..415df237a 100644 --- a/modules/blog/blog.model.php +++ b/modules/blog/blog.model.php @@ -15,6 +15,34 @@ function init() { } + /** + * @brief 블로그의 코멘트 폼을 찾아서 return + **/ + function getBlogCommentEditorForm() { + $document_srl = Context::get('document_srl'); + + $upload_target_srl = getNextSequence(); + + // 에디터 모듈의 getEditor를 호출하여 세팅 + $oEditorModel = &getModel('editor'); + $comment_editor = $oEditorModel->getEditor($upload_target_srl, false); + + // 변수 설정 + Context::set('comment_editor', $comment_editor); + Context::set('document_srl', $document_srl); + Context::set('comment_srl', $upload_target_srl); + + // template 가져옴 + $oTemplate = new TemplateHandler(); + $template_path = sprintf("%sskins/%s/",$this->module_path, $this->skin); + $tpl = $oTemplate->compile($template_path, 'comment_form'); + + // 결과 설정 + $this->add('document_srl', $document_srl); + $this->add('upload_target_srl', $upload_target_srl); + $this->add('tpl', $tpl); + } + /** * @brief DB 에 생성된 카테고리 정보를 구함 * 생성된 메뉴의 DB정보+XML정보를 return diff --git a/modules/blog/blog.view.php b/modules/blog/blog.view.php index 274ac4f05..34fb0d314 100644 --- a/modules/blog/blog.view.php +++ b/modules/blog/blog.view.php @@ -124,15 +124,11 @@ unset($document_srl); Context::set('document_srl','',true); - // 글이 찾아졌으면 댓글 권한과 허용 여부를 체크하여 댓글 에디터 세팅 + // 글이 찾아졌으면 댓글 권한과 허용 여부를 체크 } elseif($this->grant->write_comment && $document->allow_comment == 'Y' && $document->lock_comment != 'Y') { - // 브라우저 타이틀 $browser_title = $this->module_info->browser_title.' - '.$document->title; Context::setBrowserTitle($browser_title); - - // 댓글 - $this->setCommentEditor(); } Context::set('document', $document); @@ -174,6 +170,10 @@ } Context::set('search_option', $search_option); + // 블로그의 코멘트는 ajax로 호출되기에 미리 css, js파일을 import + Context::addJsFile('./modules/editor/tpl/js/editor.js'); + Context::addCSSFile('./modules/editor/tpl/css/editor.css'); + $this->setTemplateFile('list'); } diff --git a/modules/blog/conf/module.xml b/modules/blog/conf/module.xml index 0480579ac..2a0414ff5 100644 --- a/modules/blog/conf/module.xml +++ b/modules/blog/conf/module.xml @@ -37,6 +37,8 @@ + + diff --git a/modules/blog/skins/default/comment.html b/modules/blog/skins/default/comment.html index 44d8b5dbb..bf86b7b19 100644 --- a/modules/blog/skins/default/comment.html +++ b/modules/blog/skins/default/comment.html @@ -1,8 +1,10 @@ + + - + -