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 @@