git-svn-id: http://xe-core.googlecode.com/svn/trunk@481 201d5d3c-b55e-5fd7-737f-ddc643e51545

This commit is contained in:
zero 2007-03-16 03:49:40 +00:00
parent 267fbb3ddc
commit ea86e795ff
5 changed files with 34 additions and 11 deletions

View file

@ -97,10 +97,18 @@
if($this->grant->view && $document_srl) { if($this->grant->view && $document_srl) {
$document = $oDocumentModel->getDocument($document_srl, $this->grant->manager, true); $document = $oDocumentModel->getDocument($document_srl, $this->grant->manager, true);
// 찾아지지 않았다면 초기화
if($document->document_srl != $document_srl) { if($document->document_srl != $document_srl) {
unset($document); unset($document);
unset($document_srl); unset($document_srl);
Context::set('document_srl','',true); Context::set('document_srl','',true);
// 글이 찾아졌으면 댓글 권한과 허용 여부를 체크하여 댓글 에디터 세팅
} elseif($this->grant->write_comment && $document->allow_comment == 'Y' && $document->lock_comment != 'Y') {
// 에디터 모듈의 dispEditor를 호출하여 세팅
$oEditorView = &getView('editor');
$comment_editor = $oEditorView->getEditor($comment_srl);
Context::set('comment_editor', $comment_editor);
} }
Context::set('document', $document); Context::set('document', $document);
@ -181,6 +189,11 @@
Context::set('document_srl',$document_srl); Context::set('document_srl',$document_srl);
Context::set('document', $document); Context::set('document', $document);
// 에디터 모듈의 dispEditor를 호출하여 세팅
$oEditorView = &getView('editor');
$editor = $oEditorView->getEditor($document_srl);
Context::set('editor', $editor);
$this->setTemplateFile('write_form'); $this->setTemplateFile('write_form');
} }

View file

@ -57,9 +57,7 @@
<tr> <tr>
<th>{$lang->content}</th> <th>{$lang->content}</th>
<td> <td>
{@$upload_target_srl = $document_srl} {$comment_editor}
<!--#include("$editor_path/editor.html")-->
<!--#include("$editor_path/editor_uploader.html")-->
</td> </td>
</tr> </tr>
<tr> <tr>

View file

@ -68,8 +68,7 @@
<tr> <tr>
<th>{$lang->content}</th> <th>{$lang->content}</th>
<td> <td>
{@$upload_target_srl = $document_srl} {$editor}
<!--#include("./editor/editor.html")-->
</td> </td>
</tr> </tr>
<tr> <tr>

View file

@ -2,6 +2,6 @@
<module> <module>
<grants /> <grants />
<actions> <actions>
<action name="dispEditor" type="view" standalone="true" /> <action name="dispPopup" type="view" standalone="true" />
</actions> </actions>
</module> </module>

View file

@ -11,15 +11,28 @@
* @brief 초기화 * @brief 초기화
**/ **/
function init() { function init() {
// template path 지정
$this->setTemplatePath($this->module_path.'tpl');
} }
/** /**
* @brief 에디터 출력 * @brief 에디터return
**/ **/
function dispEditor() { function getEditor($upload_target_srl) {
$this->setTemplateFile('editor.html'); Context::set('upload_target_srl', $upload_target_srl);
$tpl_path = $this->module_path.'tpl';
$tpl_file = 'editor.html';
require_once("./classes/template/TemplateHandler.class.php");
$oTemplate = new TemplateHandler();
return $oTemplate->compile($tpl_path, $tpl_file);
}
/**
* @brief 팝업 출력 출력
**/
function dispPopup() {
$this->setTemplatePath($this->module_path.'tpl/popup');
$this->setTemplateFile('emoticon.html');
} }
} }