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) {
$document = $oDocumentModel->getDocument($document_srl, $this->grant->manager, true);
// 찾아지지 않았다면 초기화
if($document->document_srl != $document_srl) {
unset($document);
unset($document_srl);
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);
@ -181,6 +189,11 @@
Context::set('document_srl',$document_srl);
Context::set('document', $document);
// 에디터 모듈의 dispEditor를 호출하여 세팅
$oEditorView = &getView('editor');
$editor = $oEditorView->getEditor($document_srl);
Context::set('editor', $editor);
$this->setTemplateFile('write_form');
}

View file

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

View file

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

View file

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

View file

@ -11,15 +11,28 @@
* @brief 초기화
**/
function init() {
// template path 지정
$this->setTemplatePath($this->module_path.'tpl');
}
/**
* @brief 에디터 출력
* @brief 에디터return
**/
function dispEditor() {
$this->setTemplateFile('editor.html');
function getEditor($upload_target_srl) {
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');
}
}