mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-04 01:01:41 +09:00
#77. 에디터에서 파일 업로드 행동을 하였을 경우에만 getNextSequence() 를 호출하도록 하여 DB 부하를 대폭 감소.
블로그 모듈의 기본 스킨들에서 댓글의 에디터도 위지윅 에디터로 대체하였음.
기본 board모듈의 스킨은 filter/insert.xml에서 document_srl을 제거해야 함.
git-svn-id: http://xe-core.googlecode.com/svn/sandbox@2572 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
86670c07c5
commit
9a9e86f1fa
58 changed files with 857 additions and 620 deletions
|
|
@ -214,6 +214,7 @@
|
|||
if(strpos($v->var,".")===false) {
|
||||
if($v->default) $default_list[$v->var] = $v->default;
|
||||
if($v->filter) $filter_list[] = $v;
|
||||
if($v->notnull) $notnull_list[] = $v->var;
|
||||
if($v->default) $buff .= sprintf('array("column"=>"%s", "value"=>$args->%s?$args->%s:%s,"pipe"=>"%s","operation"=>"%s",),%s', $v->column, $v->var, $v->var, $v->default, $v->pipe, $v->operation, "\n");
|
||||
else $buff .= sprintf('array("column"=>"%s", "value"=>$args->%s,"pipe"=>"%s","operation"=>"%s",),%s', $v->column, $v->var, $v->pipe, $v->operation, "\n");
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -49,6 +49,19 @@ String.prototype.setQuery = function(key, val) {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief xSleep(micro time)
|
||||
**/
|
||||
function xSleep(sec) {
|
||||
sec = sec / 1000;
|
||||
var now = new Date();
|
||||
var sleep = new Date();
|
||||
while( sleep.getTime() - now.getTime() < sec) {
|
||||
sleep = new Date();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief string prototype으로 trim 함수 추가
|
||||
**/
|
||||
|
|
|
|||
|
|
@ -43,7 +43,7 @@
|
|||
* 0 이상 : 단위를 초로 하여 지정된 초 이상의 실행시간이 걸린 쿼리를 로그로 남김
|
||||
* 로그파일은 ./files/_db_slow_query.php 파일로 저장됨
|
||||
**/
|
||||
define('__LOG_SLOW_QUERY__', 0);
|
||||
define('__LOG_SLOW_QUERY__', 1);
|
||||
|
||||
/**
|
||||
* @brief ob_gzhandler를 이용한 압축 기능을 강제로 사용하거나 끄는 옵션
|
||||
|
|
|
|||
|
|
@ -105,9 +105,6 @@
|
|||
// comment 모듈의 controller 객체 생성
|
||||
$oCommentController = &getController('comment');
|
||||
|
||||
// 줄바꾸임나 태그제거등의 작업
|
||||
$obj->content = nl2br(strip_tags($obj->content));
|
||||
|
||||
/**
|
||||
* 존재하는 댓글인지를 확인하여 존재 하지 않는 댓글이라면 신규로 등록하기 위해서 comment_srl의 sequence값을 받는다
|
||||
**/
|
||||
|
|
|
|||
|
|
@ -97,7 +97,7 @@
|
|||
Context::setBrowserTitle($oDocument->getTitleText());
|
||||
|
||||
// 댓글에디터 설정
|
||||
//if($this->grant->write_comment && $oDocument->allowComment() && !$oDocument->isLocked()) $this->setCommentEditor(0, 100);
|
||||
if($this->grant->write_comment && $oDocument->allowComment() && !$oDocument->isLocked()) $comment_editor[$oDocument->document_srl] = $this->getCommentEditor($oDocument->document_srl, 0, 100);
|
||||
|
||||
// 조회수 증가
|
||||
$oDocument->updateReadedCount();
|
||||
|
|
@ -110,10 +110,8 @@
|
|||
}
|
||||
|
||||
}
|
||||
Context::set('oDocument', $oDocument);
|
||||
|
||||
// 댓글
|
||||
//$this->setCommentEditor(0, 100);
|
||||
Context::set('oDocument', $oDocument);
|
||||
|
||||
// 만약 document_srl은 있는데 page가 없다면 글만 호출된 경우 page를 구해서 세팅해주자..
|
||||
if($document_srl && !$page) {
|
||||
|
|
@ -152,6 +150,16 @@
|
|||
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);
|
||||
}
|
||||
}
|
||||
|
||||
// 에디터 세팅
|
||||
Context::set('comment_editor', $comment_editor);
|
||||
|
||||
// 템플릿에서 사용할 검색옵션 세팅
|
||||
$count_search_option = count($this->search_option);
|
||||
for($i=0;$i<$count_search_option;$i++) {
|
||||
|
|
@ -186,8 +194,6 @@
|
|||
Context::set('document_srl','');
|
||||
}
|
||||
|
||||
if(!$document_srl) $document_srl = getNextSequence();
|
||||
|
||||
// 글을 수정하려고 할 경우 권한이 없는 경우 비밀번호 입력화면으로
|
||||
if($oDocument->isExists()&&!$oDocument->isGranted()) return $this->setTemplateFile('input_password_form');
|
||||
|
||||
|
|
@ -196,6 +202,8 @@
|
|||
|
||||
// 에디터 모듈의 getEditor를 호출하여 세팅
|
||||
$oEditorModel = &getModel('editor');
|
||||
$option->primary_key_name = 'document_srl';
|
||||
$option->content_key_name = 'content';
|
||||
$option->allow_fileupload = $this->grant->fileupload;
|
||||
$option->enable_autosave = true;
|
||||
$option->enable_default_component = true;
|
||||
|
|
@ -263,7 +271,7 @@
|
|||
Context::set('source_comment',$source_comment);
|
||||
|
||||
// 댓글 에디터 세팅
|
||||
//$this->setCommentEditor(0,400);
|
||||
Context::set('editor', $this->getCommentEditor($document_srl, 0, 400));
|
||||
|
||||
$this->setTemplateFile('comment_form');
|
||||
}
|
||||
|
|
@ -299,7 +307,7 @@
|
|||
Context::set('comment', $comment);
|
||||
|
||||
// 댓글 에디터 세팅
|
||||
//$this->setCommentEditor($comment_srl,400);
|
||||
Context::set('editor', $this->getCommentEditor($document_srl, $comment_srl, 400));
|
||||
|
||||
$this->setTemplateFile('comment_form');
|
||||
}
|
||||
|
|
@ -368,13 +376,11 @@
|
|||
* 댓글의 경우 수정하는 경우가 아니라면 고유값이 없음.\n
|
||||
* 따라서 고유값이 없을 경우 고유값을 가져와서 지정해 주어야 함
|
||||
**/
|
||||
function setCommentEditor($comment_srl=0, $height = 100) {
|
||||
return;
|
||||
if(!$comment_srl) {
|
||||
$comment_srl = getNextSequence();
|
||||
Context::set('comment_srl', $comment_srl);
|
||||
}
|
||||
function getCommentEditor($editor_sequence, $comment_srl=0, $height = 100) {
|
||||
$oEditorModel = &getModel('editor');
|
||||
$option->editor_sequence = $editor_sequence;
|
||||
$option->primary_key_name = 'comment_srl';
|
||||
$option->content_key_name = 'content';
|
||||
$option->allow_fileupload = $this->grant->comment_fileupload;
|
||||
$option->enable_autosave = false;
|
||||
$option->enable_default_component = true;
|
||||
|
|
@ -382,7 +388,7 @@
|
|||
$option->resizable = true;
|
||||
$option->height = $height;
|
||||
$comment_editor = $oEditorModel->getEditor($comment_srl, $option);
|
||||
Context::set('comment_editor', $comment_editor);
|
||||
return $comment_editor;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -35,6 +35,7 @@
|
|||
<input type="hidden" name="document_srl" value="{$document_srl?$document_srl:$comment->document_srl}" />
|
||||
<input type="hidden" name="comment_srl" value="{$comment_srl}" />
|
||||
<input type="hidden" name="parent_srl" value="{$parent_srl}" />
|
||||
<input type="hidden" name="content" value="{htmlspecialchars($comment->content)}" />
|
||||
|
||||
<!--@if(!$is_logged)-->
|
||||
<div class="userNameAndPw">
|
||||
|
|
@ -53,7 +54,7 @@
|
|||
<!--@end-->
|
||||
|
||||
<div class="commentForm">
|
||||
<textarea class="inputTypeTextArea" name="content">{strip_tags($comment->content)}</textarea>
|
||||
<div>{$editor?$editor:$comment_editor[$document_srl]}</div>
|
||||
<div class="tCenter"><input type="image" src="./images/common/btn_reply2.gif" accesskey="s" /></div>
|
||||
</div>
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
<filter name="insert_comment" module="blog" act="procBlogInsertComment" confirm_msg_code="confirm_submit">
|
||||
<form>
|
||||
<node target="document_srl" required="true" />
|
||||
<node target="nick_name" required="true" />
|
||||
<node target="password" required="true" />
|
||||
<node target="email_address" maxlength="250" />
|
||||
|
|
|
|||
|
|
@ -26,8 +26,8 @@ function completeDeleteDocument(ret_obj) {
|
|||
var mid = ret_obj['mid'];
|
||||
var page = ret_obj['page'];
|
||||
|
||||
var url = "./?mid="+mid;
|
||||
if(page) url += "&page="+page;
|
||||
var url = current_url.setQuery('mid',mid).setQuery('act','').setQuery('document_srl','');
|
||||
if(page) url = url.setQuery('page',page);
|
||||
|
||||
alert(message);
|
||||
|
||||
|
|
@ -73,8 +73,8 @@ function completeDeleteComment(ret_obj) {
|
|||
var document_srl = ret_obj['document_srl'];
|
||||
var page = ret_obj['page'];
|
||||
|
||||
var url = "./?mid="+mid+'&document_srl='+document_srl;
|
||||
if(page) url += "&page="+page;
|
||||
var url = current_url.setQuery('mid',mid).setQuery('document_srl',document_srl).setQuery('act','');
|
||||
if(page) url = url.setQuery('page',page);
|
||||
|
||||
alert(message);
|
||||
|
||||
|
|
|
|||
|
|
@ -33,6 +33,7 @@
|
|||
<input type="hidden" name="document_srl" value="{$document_srl?$document_srl:$comment->document_srl}" />
|
||||
<input type="hidden" name="comment_srl" value="{$comment_srl}" />
|
||||
<input type="hidden" name="parent_srl" value="{$parent_srl}" />
|
||||
<input type="hidden" name="content" value="{htmlspecialchars($comment->content)}" />
|
||||
|
||||
<!--@if(!$is_logged)-->
|
||||
<div class="userNameAndPw">
|
||||
|
|
@ -51,7 +52,7 @@
|
|||
<!--@end-->
|
||||
|
||||
<div class="commentForm">
|
||||
<textarea class="inputTypeTextArea" name="content">{strip_tags($comment->content)}</textarea>
|
||||
<div>{$editor?$editor:$comment_editor[$document_srl]}</div>
|
||||
<div class="tRight">
|
||||
<span class="button"><input type="submit" value="{$lang->cmd_comment_registration}" accesskey="s" /></span>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
<filter name="insert" module="blog" act="procBlogInsertDocument" confirm_msg_code="confirm_submit">
|
||||
<form>
|
||||
<node target="document_srl" required="true" />
|
||||
<node target="nick_name" required="true" />
|
||||
<node target="password" required="true" />
|
||||
<node target="email_address" maxlength="250" />
|
||||
|
|
|
|||
|
|
@ -26,8 +26,8 @@ function completeDeleteDocument(ret_obj) {
|
|||
var mid = ret_obj['mid'];
|
||||
var page = ret_obj['page'];
|
||||
|
||||
var url = "./?mid="+mid;
|
||||
if(page) url += "&page="+page;
|
||||
var url = current_url.setQuery('mid',mid).setQuery('act','').setQuery('document_srl','');
|
||||
if(page) url = url.setQuery('page',page);
|
||||
|
||||
alert(message);
|
||||
|
||||
|
|
@ -73,8 +73,8 @@ function completeDeleteComment(ret_obj) {
|
|||
var document_srl = ret_obj['document_srl'];
|
||||
var page = ret_obj['page'];
|
||||
|
||||
var url = "./?mid="+mid+'&document_srl='+document_srl;
|
||||
if(page) url += "&page="+page;
|
||||
var url = current_url.setQuery('mid',mid).setQuery('document_srl',document_srl).setQuery('act','');
|
||||
if(page) url = url.setQuery('page',page);
|
||||
|
||||
alert(message);
|
||||
|
||||
|
|
|
|||
|
|
@ -180,9 +180,10 @@
|
|||
$oDocument = $oDocumentModel->getDocument(0, $this->grant->manager);
|
||||
$oDocument->setDocument($document_srl);
|
||||
|
||||
if(!$oDocument->isExists()) Context::set('document_srl','');
|
||||
|
||||
if(!$document_srl) $document_srl = getNextSequence();
|
||||
if(!$oDocument->isExists()) {
|
||||
Context::set('document_srl','');
|
||||
$document_srl = null;
|
||||
}
|
||||
|
||||
// 글을 수정하려고 할 경우 권한이 없는 경우 비밀번호 입력화면으로
|
||||
if($oDocument->isExists()&&!$oDocument->isGranted()) return $this->setTemplateFile('input_password_form');
|
||||
|
|
@ -192,6 +193,8 @@
|
|||
|
||||
// 에디터 모듈의 getEditor를 호출하여 세팅
|
||||
$oEditorModel = &getModel('editor');
|
||||
$option->primary_key_name = 'document_srl';
|
||||
$option->content_key_name = 'content';
|
||||
$option->allow_fileupload = $this->grant->fileupload;
|
||||
$option->enable_autosave = true;
|
||||
$option->enable_default_component = true;
|
||||
|
|
@ -368,14 +371,13 @@
|
|||
* 댓글의 경우 수정하는 경우가 아니라면 고유값이 없음.\n
|
||||
* 따라서 고유값이 없을 경우 고유값을 가져와서 지정해 주어야 함
|
||||
**/
|
||||
function setCommentEditor($comment_srl=0, $height = 100) {
|
||||
if(!$comment_srl) {
|
||||
$comment_srl = getNextSequence();
|
||||
Context::set('comment_srl', $comment_srl);
|
||||
}
|
||||
function setCommentEditor($comment_srl = 0, $height = 100) {
|
||||
Context::set('comment_srl', $comment_srl);
|
||||
|
||||
// 에디터 모듈의 getEditor를 호출하여 세팅
|
||||
$oEditorModel = &getModel('editor');
|
||||
$option->primary_key_name = 'comment_srl';
|
||||
$option->content_key_name = 'content';
|
||||
$option->allow_fileupload = $this->grant->comment_fileupload;
|
||||
$option->enable_autosave = false;
|
||||
$option->enable_default_component = true;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
<filter name="insert" module="board" act="procBoardInsertDocument" confirm_msg_code="confirm_submit">
|
||||
<form>
|
||||
<node target="document_srl" required="true" />
|
||||
<node target="nick_name" required="true" />
|
||||
<node target="password" required="true" />
|
||||
<node target="email_address" maxlength="250" />
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ function completeDeleteDocument(ret_obj) {
|
|||
var page = ret_obj['page'];
|
||||
|
||||
var url = current_url.setQuery('mid',mid).setQuery('act','').setQuery('document_srl','');
|
||||
if(page) url += url.setQuery('page',page);
|
||||
if(page) url = url.setQuery('page',page);
|
||||
|
||||
alert(message);
|
||||
|
||||
|
|
@ -98,7 +98,7 @@ function completeDeleteComment(ret_obj) {
|
|||
var page = ret_obj['page'];
|
||||
|
||||
var url = current_url.setQuery('mid',mid).setQuery('document_srl',document_srl).setQuery('act','');
|
||||
if(page) url += url.setQuery('page',page);
|
||||
if(page) url = url.setQuery('page',page);
|
||||
|
||||
alert(message);
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
<filter name="insert" module="board" act="procBoardInsertDocument" confirm_msg_code="confirm_submit">
|
||||
<form>
|
||||
<node target="document_srl" required="true" />
|
||||
<node target="nick_name" required="true" />
|
||||
<node target="password" required="true" />
|
||||
<node target="email_address" maxlength="250" />
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ function completeDeleteDocument(ret_obj) {
|
|||
var page = ret_obj['page'];
|
||||
|
||||
var url = current_url.setQuery('mid',mid).setQuery('act','').setQuery('document_srl','');
|
||||
if(page) url += url.setQuery('page',page);
|
||||
if(page) url = url.setQuery('page',page);
|
||||
|
||||
alert(message);
|
||||
|
||||
|
|
@ -98,7 +98,7 @@ function completeDeleteComment(ret_obj) {
|
|||
var page = ret_obj['page'];
|
||||
|
||||
var url = current_url.setQuery('mid',mid).setQuery('document_srl',document_srl).setQuery('act','');
|
||||
if(page) url += url.setQuery('page',page);
|
||||
if(page) url = url.setQuery('page',page);
|
||||
|
||||
alert(message);
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
<filter name="insert" module="board" act="procBoardInsertDocument" confirm_msg_code="confirm_submit">
|
||||
<form>
|
||||
<node target="document_srl" required="true" />
|
||||
<node target="nick_name" required="true" />
|
||||
<node target="password" required="true" />
|
||||
<node target="email_address" maxlength="250" />
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ function completeDeleteDocument(ret_obj) {
|
|||
var page = ret_obj['page'];
|
||||
|
||||
var url = current_url.setQuery('mid',mid).setQuery('act','').setQuery('document_srl','');
|
||||
if(page) url += url.setQuery('page',page);
|
||||
if(page) url = url.setQuery('page',page);
|
||||
|
||||
alert(message);
|
||||
|
||||
|
|
@ -98,7 +98,7 @@ function completeDeleteComment(ret_obj) {
|
|||
var page = ret_obj['page'];
|
||||
|
||||
var url = current_url.setQuery('mid',mid).setQuery('document_srl',document_srl).setQuery('act','');
|
||||
if(page) url += url.setQuery('page',page);
|
||||
if(page) url = url.setQuery('page',page);
|
||||
|
||||
alert(message);
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
<filter name="insert" module="board" act="procBoardInsertDocument" confirm_msg_code="confirm_submit">
|
||||
<form>
|
||||
<node target="document_srl" required="true" />
|
||||
<node target="nick_name" required="true" />
|
||||
<node target="password" required="true" />
|
||||
<node target="email_address" maxlength="250" />
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ function completeDeleteDocument(ret_obj) {
|
|||
var page = ret_obj['page'];
|
||||
|
||||
var url = current_url.setQuery('mid',mid).setQuery('act','').setQuery('document_srl','');
|
||||
if(page) url += url.setQuery('page',page);
|
||||
if(page) url = url.setQuery('page',page);
|
||||
|
||||
alert(message);
|
||||
|
||||
|
|
@ -98,7 +98,7 @@ function completeDeleteComment(ret_obj) {
|
|||
var page = ret_obj['page'];
|
||||
|
||||
var url = current_url.setQuery('mid',mid).setQuery('document_srl',document_srl).setQuery('act','');
|
||||
if(page) url += url.setQuery('page',page);
|
||||
if(page) url = url.setQuery('page',page);
|
||||
|
||||
alert(message);
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
<filter name="insert" module="board" act="procBoardInsertDocument" confirm_msg_code="confirm_submit">
|
||||
<form>
|
||||
<node target="document_srl" required="true" />
|
||||
<node target="nick_name" required="true" />
|
||||
<node target="password" required="true" />
|
||||
<node target="email_address" maxlength="250" />
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ function completeDeleteDocument(ret_obj) {
|
|||
var page = ret_obj['page'];
|
||||
|
||||
var url = current_url.setQuery('mid',mid).setQuery('act','').setQuery('document_srl','');
|
||||
if(page) url += url.setQuery('page',page);
|
||||
if(page) url = url.setQuery('page',page);
|
||||
|
||||
alert(message);
|
||||
|
||||
|
|
@ -98,7 +98,7 @@ function completeDeleteComment(ret_obj) {
|
|||
var page = ret_obj['page'];
|
||||
|
||||
var url = current_url.setQuery('mid',mid).setQuery('document_srl',document_srl).setQuery('act','');
|
||||
if(page) url += url.setQuery('page',page);
|
||||
if(page) url = url.setQuery('page',page);
|
||||
|
||||
alert(message);
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,5 @@
|
|||
<filter name="insert" module="board" act="procBoardInsertDocument" confirm_msg_code="confirm_submit">
|
||||
<form>
|
||||
<node target="document_srl" required="true" />
|
||||
<node target="nick_name" required="true" />
|
||||
<node target="password" required="true" />
|
||||
<node target="email_address" maxlength="250" />
|
||||
|
|
|
|||
|
|
@ -40,7 +40,7 @@ function completeDeleteDocument(ret_obj) {
|
|||
var page = ret_obj['page'];
|
||||
|
||||
var url = current_url.setQuery('mid',mid).setQuery('act','').setQuery('document_srl','');
|
||||
if(page) url += url.setQuery('page',page);
|
||||
if(page) url = url.setQuery('page',page);
|
||||
|
||||
alert(message);
|
||||
|
||||
|
|
@ -98,7 +98,7 @@ function completeDeleteComment(ret_obj) {
|
|||
var page = ret_obj['page'];
|
||||
|
||||
var url = current_url.setQuery('mid',mid).setQuery('document_srl',document_srl).setQuery('act','');
|
||||
if(page) url += url.setQuery('page',page);
|
||||
if(page) url = url.setQuery('page',page);
|
||||
|
||||
alert(message);
|
||||
|
||||
|
|
|
|||
|
|
@ -56,18 +56,26 @@
|
|||
$obj->homepage = $logged_info->homepage;
|
||||
}
|
||||
}
|
||||
|
||||
// 댓글 번호가 있으면 첨부파일 조사
|
||||
if($obj->comment_srl) {
|
||||
// file의 Model객체 생성
|
||||
$oFileModel = &getModel('file');
|
||||
|
||||
// 첨부 파일의 갯수를 구함
|
||||
$obj->uploaded_count = $oFileModel->getFilesCount($obj->comment_srl);
|
||||
// 댓글 번호가 없다면 신규 번호 할당
|
||||
} else {
|
||||
$obj->comment_srl = getNextSequence();
|
||||
}
|
||||
|
||||
// 순서를 정함
|
||||
$obj->list_order = $obj->comment_srl * -1;
|
||||
|
||||
// begin transaction
|
||||
$oDB = &DB::getInstance();
|
||||
$oDB->begin();
|
||||
|
||||
// file의 Model객체 생성
|
||||
$oFileModel = &getModel('file');
|
||||
|
||||
// 첨부 파일의 갯수를 구함
|
||||
$obj->uploaded_count = $oFileModel->getFilesCount($obj->comment_srl);
|
||||
|
||||
// 댓글을 입력
|
||||
$output = executeQuery('comment.insertComment', $obj);
|
||||
|
||||
|
|
|
|||
|
|
@ -47,11 +47,17 @@
|
|||
unset($obj->_saved_doc_content);
|
||||
unset($obj->_saved_doc_message);
|
||||
|
||||
// file의 Model객체 생성
|
||||
$oFileModel = &getModel('file');
|
||||
// 문서 번호가 이미 있다면 첨부파일을 확인
|
||||
if($obj->document_srl) {
|
||||
// file의 Model객체 생성
|
||||
$oFileModel = &getModel('file');
|
||||
|
||||
// 첨부 파일의 갯수를 구함
|
||||
$obj->uploaded_count = $oFileModel->getFilesCount($obj->document_srl);
|
||||
// 첨부 파일의 갯수를 구함
|
||||
$obj->uploaded_count = $oFileModel->getFilesCount($obj->document_srl);
|
||||
// 문서 번호가 없다면 문서 번호 할당
|
||||
} else {
|
||||
$obj->document_srl = getNextSequence();
|
||||
}
|
||||
|
||||
// 카테고리가 있나 검사하여 없는 카테고리면 0으로 세팅
|
||||
if($obj->category_srl) {
|
||||
|
|
|
|||
|
|
@ -7,15 +7,15 @@
|
|||
|
||||
class colorpicker_bg extends EditorHandler {
|
||||
|
||||
// upload_target_srl 는 에디터에서 필수로 달고 다녀야 함....
|
||||
var $upload_target_srl = 0;
|
||||
// editor_sequence 는 에디터에서 필수로 달고 다녀야 함....
|
||||
var $editor_sequence = 0;
|
||||
var $component_path = '';
|
||||
|
||||
/**
|
||||
* @brief upload_target_srl과 컴포넌트의 경로를 받음
|
||||
* @brief editor_sequence과 컴포넌트의 경로를 받음
|
||||
**/
|
||||
function colorpicker_bg($upload_target_srl, $component_path) {
|
||||
$this->upload_target_srl = $upload_target_srl;
|
||||
function colorpicker_bg($editor_sequence, $component_path) {
|
||||
$this->editor_sequence = $editor_sequence;
|
||||
$this->component_path = $component_path;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -7,15 +7,15 @@
|
|||
|
||||
class colorpicker_text extends EditorHandler {
|
||||
|
||||
// upload_target_srl 는 에디터에서 필수로 달고 다녀야 함....
|
||||
var $upload_target_srl = 0;
|
||||
// editor_sequence 는 에디터에서 필수로 달고 다녀야 함....
|
||||
var $editor_sequence = 0;
|
||||
var $component_path = '';
|
||||
|
||||
/**
|
||||
* @brief upload_target_srl과 컴포넌트의 경로를 받음
|
||||
* @brief editor_sequence과 컴포넌트의 경로를 받음
|
||||
**/
|
||||
function colorpicker_text($upload_target_srl, $component_path) {
|
||||
$this->upload_target_srl = $upload_target_srl;
|
||||
function colorpicker_text($editor_sequence, $component_path) {
|
||||
$this->editor_sequence = $editor_sequence;
|
||||
$this->component_path = $component_path;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -7,15 +7,15 @@
|
|||
|
||||
class emoticon extends EditorHandler {
|
||||
|
||||
// upload_target_srl 는 에디터에서 필수로 달고 다녀야 함....
|
||||
var $upload_target_srl = 0;
|
||||
// editor_sequence 는 에디터에서 필수로 달고 다녀야 함....
|
||||
var $editor_sequence = 0;
|
||||
var $component_path = '';
|
||||
|
||||
/**
|
||||
* @brief upload_target_srl과 컴포넌트의 경로를 받음
|
||||
* @brief editor_sequence과 컴포넌트의 경로를 받음
|
||||
**/
|
||||
function emoticon($upload_target_srl, $component_path) {
|
||||
$this->upload_target_srl = $upload_target_srl;
|
||||
function emoticon($editor_sequence, $component_path) {
|
||||
$this->editor_sequence = $editor_sequence;
|
||||
$this->component_path = $component_path;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -7,15 +7,15 @@
|
|||
|
||||
class image_gallery extends EditorHandler {
|
||||
|
||||
// upload_target_srl 는 에디터에서 필수로 달고 다녀야 함....
|
||||
var $upload_target_srl = 0;
|
||||
// editor_sequence 는 에디터에서 필수로 달고 다녀야 함....
|
||||
var $editor_sequence = 0;
|
||||
var $component_path = '';
|
||||
|
||||
/**
|
||||
* @brief upload_target_srl과 컴포넌트의 경로를 받음
|
||||
* @brief editor_sequence과 컴포넌트의 경로를 받음
|
||||
**/
|
||||
function image_gallery($upload_target_srl, $component_path) {
|
||||
$this->upload_target_srl = $upload_target_srl;
|
||||
function image_gallery($editor_sequence, $component_path) {
|
||||
$this->editor_sequence = $editor_sequence;
|
||||
$this->component_path = $component_path;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -7,7 +7,7 @@
|
|||
</div>
|
||||
|
||||
<form action="./" method="get" onSubmit="return false" id="fo">
|
||||
<input type="hidden" name="upload_target_srl" value="{$upload_target_srl}" />
|
||||
<input type="hidden" name="editor_sequence" value="{$editor_sequence}" />
|
||||
|
||||
<div id="popBody">
|
||||
|
||||
|
|
|
|||
|
|
@ -39,9 +39,9 @@ function getSlideShow() {
|
|||
|
||||
// 부모창의 업로드된 파일중 이미지 목록을 모두 가져와서 세팅
|
||||
var fo = xGetElementById("fo");
|
||||
var upload_target_srl = fo.upload_target_srl.value;
|
||||
var editor_sequence = fo.editor_sequence.value;
|
||||
|
||||
var parent_list_obj = opener.xGetElementById("uploaded_file_list_"+upload_target_srl);
|
||||
var parent_list_obj = opener.xGetElementById("uploaded_file_list_"+editor_sequence);
|
||||
if(parent_list_obj) {
|
||||
|
||||
var list_obj = xGetElementById("image_list");
|
||||
|
|
|
|||
|
|
@ -7,15 +7,15 @@
|
|||
|
||||
class image_link extends EditorHandler {
|
||||
|
||||
// upload_target_srl 는 에디터에서 필수로 달고 다녀야 함....
|
||||
var $upload_target_srl = 0;
|
||||
// editor_sequence 는 에디터에서 필수로 달고 다녀야 함....
|
||||
var $editor_sequence = 0;
|
||||
var $component_path = '';
|
||||
|
||||
/**
|
||||
* @brief upload_target_srl과 컴포넌트의 경로를 받음
|
||||
* @brief editor_sequence과 컴포넌트의 경로를 받음
|
||||
**/
|
||||
function image_link($upload_target_srl, $component_path) {
|
||||
$this->upload_target_srl = $upload_target_srl;
|
||||
function image_link($editor_sequence, $component_path) {
|
||||
$this->editor_sequence = $editor_sequence;
|
||||
$this->component_path = $component_path;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -7,15 +7,15 @@
|
|||
|
||||
class multimedia_link extends EditorHandler {
|
||||
|
||||
// upload_target_srl 는 에디터에서 필수로 달고 다녀야 함....
|
||||
var $upload_target_srl = 0;
|
||||
// editor_sequence 는 에디터에서 필수로 달고 다녀야 함....
|
||||
var $editor_sequence = 0;
|
||||
var $component_path = '';
|
||||
|
||||
/**
|
||||
* @brief upload_target_srl과 컴포넌트의 경로를 받음
|
||||
* @brief editor_sequence과 컴포넌트의 경로를 받음
|
||||
**/
|
||||
function multimedia_link($upload_target_srl, $component_path) {
|
||||
$this->upload_target_srl = $upload_target_srl;
|
||||
function multimedia_link($editor_sequence, $component_path) {
|
||||
$this->editor_sequence = $editor_sequence;
|
||||
$this->component_path = $component_path;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -7,15 +7,15 @@
|
|||
|
||||
class poll_maker extends EditorHandler {
|
||||
|
||||
// upload_target_srl 는 에디터에서 필수로 달고 다녀야 함....
|
||||
var $upload_target_srl = 0;
|
||||
// editor_sequence 는 에디터에서 필수로 달고 다녀야 함....
|
||||
var $editor_sequence = 0;
|
||||
var $component_path = '';
|
||||
|
||||
/**
|
||||
* @brief upload_target_srl과 컴포넌트의 경로를 받음
|
||||
* @brief editor_sequence과 컴포넌트의 경로를 받음
|
||||
**/
|
||||
function poll_maker($upload_target_srl, $component_path) {
|
||||
$this->upload_target_srl = $upload_target_srl;
|
||||
function poll_maker($editor_sequence, $component_path) {
|
||||
$this->editor_sequence = $editor_sequence;
|
||||
$this->component_path = $component_path;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@
|
|||
<input type="hidden" name="component" value="{$component_info->component_name}" />
|
||||
<input type="hidden" name="method" value="insertPoll" />
|
||||
<input type="hidden" name="poll_srl" value="" />
|
||||
<input type="hidden" name="upload_target_srl" value="{$upload_target_srl}" />
|
||||
<input type="hidden" name="editor_sequence" value="{$editor_sequence}" />
|
||||
|
||||
<div id="popBody">
|
||||
|
||||
|
|
|
|||
|
|
@ -7,15 +7,15 @@
|
|||
|
||||
class quotation extends EditorHandler {
|
||||
|
||||
// upload_target_srl 는 에디터에서 필수로 달고 다녀야 함....
|
||||
var $upload_target_srl = 0;
|
||||
// editor_sequence 는 에디터에서 필수로 달고 다녀야 함....
|
||||
var $editor_sequence = 0;
|
||||
var $component_path = '';
|
||||
|
||||
/**
|
||||
* @brief upload_target_srl과 컴포넌트의 경로를 받음
|
||||
* @brief editor_sequence과 컴포넌트의 경로를 받음
|
||||
**/
|
||||
function quotation($upload_target_srl, $component_path) {
|
||||
$this->upload_target_srl = $upload_target_srl;
|
||||
function quotation($editor_sequence, $component_path) {
|
||||
$this->editor_sequence = $editor_sequence;
|
||||
$this->component_path = $component_path;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -7,15 +7,15 @@
|
|||
|
||||
class table_maker extends EditorHandler {
|
||||
|
||||
// upload_target_srl 는 에디터에서 필수로 달고 다녀야 함....
|
||||
var $upload_target_srl = 0;
|
||||
// editor_sequence 는 에디터에서 필수로 달고 다녀야 함....
|
||||
var $editor_sequence = 0;
|
||||
var $component_path = '';
|
||||
|
||||
/**
|
||||
* @brief upload_target_srl과 컴포넌트의 경로를 받음
|
||||
* @brief editor_sequence과 컴포넌트의 경로를 받음
|
||||
**/
|
||||
function table_maker($upload_target_srl, $component_path) {
|
||||
$this->upload_target_srl = $upload_target_srl;
|
||||
function table_maker($editor_sequence, $component_path) {
|
||||
$this->editor_sequence = $editor_sequence;
|
||||
$this->component_path = $component_path;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -7,15 +7,15 @@
|
|||
|
||||
class url_link extends EditorHandler {
|
||||
|
||||
// upload_target_srl 는 에디터에서 필수로 달고 다녀야 함....
|
||||
var $upload_target_srl = 0;
|
||||
// editor_sequence 는 에디터에서 필수로 달고 다녀야 함....
|
||||
var $editor_sequence = 0;
|
||||
var $component_path = '';
|
||||
|
||||
/**
|
||||
* @brief upload_target_srl과 컴포넌트의 경로를 받음
|
||||
* @brief editor_sequence과 컴포넌트의 경로를 받음
|
||||
**/
|
||||
function url_link($upload_target_srl, $component_path) {
|
||||
$this->upload_target_srl = $upload_target_srl;
|
||||
function url_link($editor_sequence, $component_path) {
|
||||
$this->editor_sequence = $editor_sequence;
|
||||
$this->component_path = $component_path;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -31,12 +31,8 @@
|
|||
$args->ipaddress = $_SERVER['REMOTE_ADDR'];
|
||||
}
|
||||
|
||||
// 필요한 데이터가 없으면 pass
|
||||
if(!$args->document_srl || (!$args->title && !$args->content)) return new Object(0,'');
|
||||
|
||||
// 저장
|
||||
$output = executeQuery('editor.insertSavedDoc', $args);
|
||||
|
||||
$this->setMessage('msg_auto_saved');
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -11,13 +11,30 @@
|
|||
|
||||
/**
|
||||
* @brief 에디터를 return
|
||||
*
|
||||
* 에디터의 경우 내부적으로 1~30까지의 임시 editor_seuqnece를 생성한다.
|
||||
* 즉 한페이지에 30개 이상의 에디터를 출력하지는 못하도록 제한되어 있다.
|
||||
*
|
||||
* 단, 수정하는 경우 또는 파일업로드를 한 자동저장본의 경우는 getNextSequence() 값으로 저장된 editor_seqnece가
|
||||
* 설정된다.
|
||||
*
|
||||
* editor_sequence <= 30 일경우에는 무조건 가상의 번호로 판별함
|
||||
**/
|
||||
function getEditor($upload_target_srl, $option = null) {
|
||||
|
||||
/**
|
||||
* 에디터 template을 return
|
||||
* upload_target_srl은 글의 수정시 호출하면 됨.
|
||||
* 이 upload_target_srl은 첨부파일의 유무를 체크하기 위한 루틴을 구현하는데 사용됨.
|
||||
**/
|
||||
function getEditor($upload_target_srl = 0, $option = null) {
|
||||
/**
|
||||
* 기본적인 에디터의 옵션을 정리
|
||||
**/
|
||||
// 파일 업로드 유무 옵션 설정
|
||||
if(!$option->allow_fileupload) $allow_fileupload = false;
|
||||
else $allow_fileupload = true;
|
||||
|
||||
// 자동 저장 유무 옵션 설정
|
||||
// 자동 저장 유무 옵션 설정
|
||||
if(!$option->enable_autosave) $enable_autosave = false;
|
||||
else $enable_autosave = true;
|
||||
|
||||
|
|
@ -41,35 +58,66 @@
|
|||
if(!$option->skin) $skin = 'default';
|
||||
else $skin = $option->skin;
|
||||
|
||||
// 대상 문서 번호 설정
|
||||
Context::set('upload_target_srl', $upload_target_srl);
|
||||
/**
|
||||
* 자동백업 기능 체크 (글 수정일 경우는 사용하지 않음)
|
||||
**/
|
||||
if(!$upload_target_srl && $enable_autosave) {
|
||||
// 자동 저장된 데이터를 추출
|
||||
$saved_doc = $this->getSavedDoc();
|
||||
|
||||
// 업로드 가능 변수 설정
|
||||
if($allow_fileupload) {
|
||||
// 첨부파일 모듈의 정보를 구함
|
||||
$logged_info = Context::get('logged_info');
|
||||
if($logged_info->member_srl && $logged_info->is_admin == 'Y') {
|
||||
$file_config->allowed_filesize = 1024*1024*1024;
|
||||
$file_config->allowed_attach_size = 1024*1024*1024;
|
||||
$file_config->allowed_filetypes = '*.*';
|
||||
} else {
|
||||
$oModuleModel = &getModel('module');
|
||||
$file_config = $oModuleModel->getModuleConfig('file');
|
||||
$file_config->allowed_filesize = $file_config->allowed_filesize * 1024;
|
||||
$file_config->allowed_attach_size = $file_config->allowed_attach_size * 1024;
|
||||
}
|
||||
Context::set('file_config',$file_config);
|
||||
}
|
||||
Context::set('allow_fileupload', $allow_fileupload);
|
||||
// 자동저장된 데이터에 실제하는 문서 번호가 있다면 해당 문서 번호를 세팅
|
||||
if($saved_doc->document_srl) $upload_target_srl = $saved_doc->upload_target_srl;
|
||||
|
||||
// 자동백업 기능 체크
|
||||
if($enable_autosave) {
|
||||
$saved_doc = $this->getSavedDoc($upload_target_srl);
|
||||
// 자동 저장 데이터를 context setting
|
||||
Context::set('saved_doc', $saved_doc);
|
||||
}
|
||||
Context::set('enable_autosave', $enable_autosave);
|
||||
|
||||
// 에디터 컴포넌트 체크
|
||||
/**
|
||||
* 에디터의 고유 번호 추출 (한 페이지에 여러개의 에디터를 출력하는 경우를 대비)
|
||||
**/
|
||||
if($option->editor_sequence) $editor_sequence = $option->editor_sequence;
|
||||
else {
|
||||
if(!$GLOBALS['_editor_sequence_']) $GLOBALS['_editor_sequence_'] = 1;
|
||||
$editor_sequence = $GLOBALS['_editor_sequence_'] ++;
|
||||
}
|
||||
|
||||
/**
|
||||
* 업로드 활성화시 내부적으로 file 모듈의 환경설정을 이용하여 설정
|
||||
**/
|
||||
if($allow_fileupload) {
|
||||
$oFileModel = &getModel('file');
|
||||
|
||||
// SWFUploader에 세팅할 업로드 설정 구함
|
||||
$file_config = $oFileModel->getUploadConfig();
|
||||
Context::set('file_config',$file_config);
|
||||
|
||||
// 업로드 가능 용량등에 대한 정보를 세팅
|
||||
$upload_status = $oFileModel->getUploadStatus();
|
||||
Context::set('upload_status', $upload_status);
|
||||
|
||||
// upload가능하다고 설정 (내부적으로 캐싱하여 처리)
|
||||
$oFileController = &getController('file');
|
||||
$oFileController->setUploadInfo($editor_sequence, $upload_target_srl);
|
||||
}
|
||||
Context::set('allow_fileupload', $allow_fileupload);
|
||||
|
||||
// 에디터 동작을 위한 editor_sequence값 설정
|
||||
Context::set('editor_sequence', $editor_sequence);
|
||||
|
||||
// 파일 첨부 관련 행동을 하기 위해 문서 번호를 upload_target_srl로 설정
|
||||
// 신규문서일 경우 upload_target_srl=0 이고 첨부파일 관련 동작이 요청될때 이 값이 변경됨
|
||||
Context::set('upload_target_srl', $upload_target_srl);
|
||||
|
||||
// 문서 혹은 댓글의 primary key값을 세팅한다.
|
||||
Context::set('editor_primary_key_name', $option->primary_key_name);
|
||||
|
||||
// 내용을 sync 맞추기 위한 content column name을 세팅한다
|
||||
Context::set('editor_content_key_name', $option->content_key_name);
|
||||
|
||||
/**
|
||||
* 에디터 컴포넌트 체크
|
||||
**/
|
||||
if($enable_component) {
|
||||
if(!Context::get('component_list')) {
|
||||
$component_list = $this->getComponentList();
|
||||
|
|
@ -79,24 +127,24 @@
|
|||
Context::set('enable_component', $enable_component);
|
||||
Context::set('enable_default_component', $enable_default_component);
|
||||
|
||||
// resizable 가능한지 변수 설정
|
||||
/**
|
||||
* resizable 가능한지 변수 설정
|
||||
**/
|
||||
Context::set('enable_resizable', $resizable);
|
||||
|
||||
// 에디터 크기 설정
|
||||
/**
|
||||
* 에디터 세로 크기 설정
|
||||
**/
|
||||
Context::set('editor_height', $editor_height);
|
||||
|
||||
// 템플릿을 미리 컴파일해서 컴파일된 소스를 return
|
||||
/**
|
||||
* 템플릿을 미리 컴파일해서 컴파일된 소스를 하기 위해 스킨의 경로를 설정
|
||||
**/
|
||||
$tpl_path = sprintf('%sskins/%s/', $this->module_path, $skin);
|
||||
$tpl_file = 'editor.html';
|
||||
|
||||
// editor_path를 지정
|
||||
Context::set('editor_path', $tpl_path);
|
||||
|
||||
// 만약 allow_fileupload == true 이면 upload_target_srl에 upload가능하다고 설정
|
||||
if($allow_fileupload) {
|
||||
$oFileController = &getController('file');
|
||||
$oFileController->setUploadEnable($upload_target_srl);
|
||||
}
|
||||
// tpl 파일을 compile한 결과를 return
|
||||
$oTemplate = &TemplateHandler::getInstance();
|
||||
return $oTemplate->compile($tpl_path, $tpl_file);
|
||||
}
|
||||
|
|
@ -104,7 +152,7 @@
|
|||
/**
|
||||
* @brief 자동저장되어 있는 정보를 가져옴
|
||||
**/
|
||||
function getSavedDoc($upload_target_srl) {
|
||||
function getSavedDoc() {
|
||||
// 로그인 회원이면 member_srl, 아니면 ipaddress로 저장되어 있는 문서를 찾음
|
||||
if(Context::get('is_logged')) {
|
||||
$logged_info = Context::get('logged_info');
|
||||
|
|
@ -113,17 +161,19 @@
|
|||
$auto_save_args->ipaddress = $_SERVER['REMOTE_ADDR'];
|
||||
}
|
||||
|
||||
// DB에서 자동저장 데이터 추출
|
||||
$output = executeQuery('editor.getSavedDocument', $auto_save_args);
|
||||
$saved_doc = $output->data;
|
||||
|
||||
// 자동저장한 결과가 없으면 null값 return
|
||||
if(!$saved_doc) return;
|
||||
|
||||
// 원본 글이 저장되어 있지 않은 글일 경우 첨부된 파일이 있으면 현재 글 번호로 옮김
|
||||
$oDocumentModel = &getModel('document');
|
||||
$document = $oDocumentModel->getDocument($saved_doc->document_srl);
|
||||
if($document->document_srl != $saved_doc->document_srl) {
|
||||
// 자동저장 데이터에 문서번호가 있고 이 번호에 파일이 있다면 파일을 모두 이동하고
|
||||
// 해당 문서 번호를 editor_sequence로 세팅함
|
||||
if($saved_doc->document_srl) {
|
||||
$module_srl = Context::get('module_srl');
|
||||
$oFileController = &getController('file');
|
||||
$oFileController->moveFile($saved_doc->document_srl, $module_srl, $upload_target_srl);
|
||||
$oFileController->moveFile($saved_doc->document_srl, $module_srl, $saved_doc->document_srl);
|
||||
}
|
||||
|
||||
return $saved_doc;
|
||||
|
|
@ -132,8 +182,8 @@
|
|||
/**
|
||||
* @brief component의 객체 생성
|
||||
**/
|
||||
function getComponentObject($component, $upload_target_srl = 0) {
|
||||
if(!$this->loaded_component_list[$component][$upload_target_srl]) {
|
||||
function getComponentObject($component, $editor_sequence = 0) {
|
||||
if(!$this->loaded_component_list[$component][$editor_sequence]) {
|
||||
// 해당 컴포넌트의 객체를 생성해서 실행
|
||||
$class_path = sprintf('%scomponents/%s/', $this->module_path, $component);
|
||||
$class_file = sprintf('%s%s.class.php', $class_path, $component);
|
||||
|
|
@ -141,17 +191,17 @@
|
|||
|
||||
// 클래스 파일을 읽은 후 객체 생성
|
||||
require_once($class_file);
|
||||
$eval_str = sprintf('$oComponent = new %s("%s","%s");', $component, $upload_target_srl, $class_path);
|
||||
$eval_str = sprintf('$oComponent = new %s("%s","%s");', $component, $editor_sequence, $class_path);
|
||||
@eval($eval_str);
|
||||
if(!$oComponent) return new Object(-1, sprintf(Context::getLang('msg_component_is_not_founded'), $component));
|
||||
|
||||
// 설정 정보를 추가
|
||||
$component_info = $this->getComponent($component);
|
||||
$oComponent->setInfo($component_info);
|
||||
$this->loaded_component_list[$component][$upload_target_srl] = $oComponent;
|
||||
$this->loaded_component_list[$component][$editor_sequence] = $oComponent;
|
||||
}
|
||||
|
||||
return $this->loaded_component_list[$component][$upload_target_srl];
|
||||
return $this->loaded_component_list[$component][$editor_sequence];
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -21,12 +21,12 @@
|
|||
Context::addCssFile($this->module_path."tpl/css/editor.css");
|
||||
|
||||
// 변수 정리
|
||||
$upload_target_srl = Context::get('upload_target_srl');
|
||||
$editor_sequence = Context::get('editor_sequence ');
|
||||
$component = Context::get('component');
|
||||
|
||||
// component 객체를 받음
|
||||
$oEditorModel = &getModel('editor');
|
||||
$oComponent = &$oEditorModel->getComponentObject($component, $upload_target_srl);
|
||||
$oComponent = &$oEditorModel->getComponentObject($component, $editor_sequence);
|
||||
if(!$oComponent->toBool()) {
|
||||
Context::set('message', sprintf(Context::getLang('msg_component_is_not_founded'), $component));
|
||||
$this->setTemplatePath($this->module_path.'tpl');
|
||||
|
|
|
|||
|
|
@ -8,7 +8,7 @@
|
|||
<script type="text/javascript">//<![CDATA[
|
||||
var editor_path = "{$editor_path}";
|
||||
var auto_saved_msg = "{$lang->msg_auto_saved}";
|
||||
xAddEventListener(window, 'load', function() { editorStart("{$upload_target_srl}", {$enable_resizable}, '{$editor_height}' ) } );
|
||||
xAddEventListener(window, 'load', function() { editorStart("{$editor_sequence}", "{$editor_primary_key_name}", "{$editor_content_key_name}", {$enable_resizable}, '{$editor_height}' ) } );
|
||||
//]]></script>
|
||||
|
||||
<!-- 자동저장용 폼 -->
|
||||
|
|
@ -21,21 +21,21 @@
|
|||
<!-- 에디터 -->
|
||||
<div class="xeEditor">
|
||||
|
||||
<div id="xeEditorOption_{$upload_target_srl}">
|
||||
<div id="xeEditorOption_{$editor_sequence}">
|
||||
|
||||
<!--@if($enable_default_component)-->
|
||||
<!-- 기본 컴포넌트 출력 -->
|
||||
<div class="optionABC">
|
||||
<div class="optionA">
|
||||
<div class="selectGroup">
|
||||
<select onchange="editorChangeFontName(this,'{$upload_target_srl}')" id="editor_font_{$upload_target_srl}">
|
||||
<select onchange="editorChangeFontName(this,'{$editor_sequence}')" id="editor_font_{$editor_sequence}">
|
||||
<option value="">{$lang->edit->fontname}</option>
|
||||
<!--@foreach($lang->edit->fontlist as $key=>$obj)-->
|
||||
<option style="font-family:{$obj}" value="{$obj}">{$obj}</option>
|
||||
<!--@end-->
|
||||
</select>
|
||||
|
||||
<select onchange="editorChangeFontSize(this,'{$upload_target_srl}')" id="editor_fontsize_{$upload_target_srl}">
|
||||
<select onchange="editorChangeFontSize(this,'{$editor_sequence}')" id="editor_fontsize_{$editor_sequence}">
|
||||
<option value="" selected="selected">{$lang->edit->fontsize}</option>
|
||||
<option value="1">8pt</option>
|
||||
<option value="2">10pt</option>
|
||||
|
|
@ -46,7 +46,7 @@
|
|||
<option value="7">36pt</option>
|
||||
</select>
|
||||
|
||||
<select onchange="editorChangeHeader(this,'{$upload_target_srl}')" id="editor_header_{$upload_target_srl}">
|
||||
<select onchange="editorChangeHeader(this,'{$editor_sequence}')" id="editor_header_{$editor_sequence}">
|
||||
<option value="">{$lang->edit->header}</option>
|
||||
<!--@foreach($lang->edit->header_list as $key=>$obj)-->
|
||||
<option value="{$key}">{$obj}</option>
|
||||
|
|
@ -55,31 +55,31 @@
|
|||
</div>
|
||||
|
||||
<div class="buttonGroup">
|
||||
<img src="./images/editor_btn_b.gif" width="23" height="63" title="{$lang->edit->help_bold}" alt="{$lang->edit->help_bold}" id="component_{$upload_target_srl}_Bold" onmouseover="eOptionOver(this)" onmouseout="eOptionOut(this)" />
|
||||
<img src="./images/editor_btn_i.gif" width="23" height="63" title="{$lang->edit->help_italic}" alt="{$lang->edit->help_italic}" id="component_{$upload_target_srl}_Italic" onmouseover="eOptionOver(this)" onmouseout="eOptionOut(this)" />
|
||||
<img src="./images/editor_btn_u.gif" width="23" height="63" title="{$lang->edit->help_underline}" alt="{$lang->edit->help_underline}" id="component_{$upload_target_srl}_Underline" onmouseover="eOptionOver(this)" onmouseout="eOptionOut(this)" />
|
||||
<img src="./images/editor_btn_c.gif" width="23" height="63" title="{$lang->edit->help_fontcolor}" alt="{$lang->edit->help_fontcolor}" id="component_{$upload_target_srl}_colorpicker_text" onmouseover="eOptionOver(this)" onmouseout="eOptionOut(this)" />
|
||||
<img src="./images/editor_btn_bg.gif" width="23" height="63" title="{$lang->edit->help_fontbgcolor}" alt="{$lang->edit->help_fontbgcolor}" id="component_{$upload_target_srl}_colorpicker_bg" onmouseover="eOptionOver(this)" onmouseout="eOptionOut(this)" />
|
||||
<img src="./images/editor_btn_b.gif" width="23" height="63" title="{$lang->edit->help_bold}" alt="{$lang->edit->help_bold}" id="component_{$editor_sequence}_Bold" onmouseover="eOptionOver(this)" onmouseout="eOptionOut(this)" />
|
||||
<img src="./images/editor_btn_i.gif" width="23" height="63" title="{$lang->edit->help_italic}" alt="{$lang->edit->help_italic}" id="component_{$editor_sequence}_Italic" onmouseover="eOptionOver(this)" onmouseout="eOptionOut(this)" />
|
||||
<img src="./images/editor_btn_u.gif" width="23" height="63" title="{$lang->edit->help_underline}" alt="{$lang->edit->help_underline}" id="component_{$editor_sequence}_Underline" onmouseover="eOptionOver(this)" onmouseout="eOptionOut(this)" />
|
||||
<img src="./images/editor_btn_c.gif" width="23" height="63" title="{$lang->edit->help_fontcolor}" alt="{$lang->edit->help_fontcolor}" id="component_{$editor_sequence}_colorpicker_text" onmouseover="eOptionOver(this)" onmouseout="eOptionOut(this)" />
|
||||
<img src="./images/editor_btn_bg.gif" width="23" height="63" title="{$lang->edit->help_fontbgcolor}" alt="{$lang->edit->help_fontbgcolor}" id="component_{$editor_sequence}_colorpicker_bg" onmouseover="eOptionOver(this)" onmouseout="eOptionOut(this)" />
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="optionB">
|
||||
<div class="buttonGroup">
|
||||
<img src="./images/editor_btn_al.gif" width="23" height="63" title="{$lang->edit->help_align_left}" alt="{$lang->edit->help_align_left}" id="component_{$upload_target_srl}_justifyleft" onmouseover="eOptionOver(this)" onmouseout="eOptionOut(this)" />
|
||||
<img src="./images/editor_btn_ac.gif" width="23" height="63" title="{$lang->edit->help_align_center}" alt="{$lang->edit->help_align_center}" id="component_{$upload_target_srl}_justifycenter" onmouseover="eOptionOver(this)" onmouseout="eOptionOut(this)" />
|
||||
<img src="./images/editor_btn_ar.gif" width="23" height="63" title="{$lang->edit->help_align_right}" alt="{$lang->edit->help_align_right}" id="component_{$upload_target_srl}_justifyright" onmouseover="eOptionOver(this)" onmouseout="eOptionOut(this)" />
|
||||
<img src="./images/editor_btn_al.gif" width="23" height="63" title="{$lang->edit->help_align_left}" alt="{$lang->edit->help_align_left}" id="component_{$editor_sequence}_justifyleft" onmouseover="eOptionOver(this)" onmouseout="eOptionOut(this)" />
|
||||
<img src="./images/editor_btn_ac.gif" width="23" height="63" title="{$lang->edit->help_align_center}" alt="{$lang->edit->help_align_center}" id="component_{$editor_sequence}_justifycenter" onmouseover="eOptionOver(this)" onmouseout="eOptionOut(this)" />
|
||||
<img src="./images/editor_btn_ar.gif" width="23" height="63" title="{$lang->edit->help_align_right}" alt="{$lang->edit->help_align_right}" id="component_{$editor_sequence}_justifyright" onmouseover="eOptionOver(this)" onmouseout="eOptionOut(this)" />
|
||||
<!--<img src="./images/editor_btn_aj.gif" width="23" height="63" onmouseover="eOptionOver(this)" onmouseout="eOptionOut(this)" />-->
|
||||
</div>
|
||||
|
||||
<!--
|
||||
<div class="buttonGroup">
|
||||
<img src="./images/editor_btn_od.gif" title="{$lang->edit->help_remove_indent}" alt="{$lang->edit->help_remove_indent}" id="component_{$upload_target_srl}_outdent" width="23" height="63" onmouseover="eOptionOver(this)" onmouseout="eOptionOut(this)" />
|
||||
<img src="./images/editor_btn_id.gif" width="23" height="63" title="{$lang->edit->help_add_indent}" alt="{$lang->edit->help_add_indent}" id="component_{$upload_target_srl}_indent" onmouseover="eOptionOver(this)" onmouseout="eOptionOut(this)" />
|
||||
<img src="./images/editor_btn_od.gif" title="{$lang->edit->help_remove_indent}" alt="{$lang->edit->help_remove_indent}" id="component_{$editor_sequence}_outdent" width="23" height="63" onmouseover="eOptionOver(this)" onmouseout="eOptionOut(this)" />
|
||||
<img src="./images/editor_btn_id.gif" width="23" height="63" title="{$lang->edit->help_add_indent}" alt="{$lang->edit->help_add_indent}" id="component_{$editor_sequence}_indent" onmouseover="eOptionOver(this)" onmouseout="eOptionOut(this)" />
|
||||
</div>
|
||||
|
||||
<div class="buttonGroup">
|
||||
<img src="./images/editor_btn_ol.gif" title="{$lang->edit->help_list_number}" alt="{$lang->edit->help_list_number}" id="component_{$upload_target_srl}_insertorderedlist" width="23" height="63" onmouseover="eOptionOver(this)" onmouseout="eOptionOut(this)" />
|
||||
<img src="./images/editor_btn_ul.gif" title="{$lang->edit->help_list_bullet}" alt="{$lang->edit->help_list_bullet}" id="component_{$upload_target_srl}_insertunorderedlist" width="23" height="63" onmouseover="eOptionOver(this)" onmouseout="eOptionOut(this)" />
|
||||
<img src="./images/editor_btn_ol.gif" title="{$lang->edit->help_list_number}" alt="{$lang->edit->help_list_number}" id="component_{$editor_sequence}_insertorderedlist" width="23" height="63" onmouseover="eOptionOver(this)" onmouseout="eOptionOut(this)" />
|
||||
<img src="./images/editor_btn_ul.gif" title="{$lang->edit->help_list_bullet}" alt="{$lang->edit->help_list_bullet}" id="component_{$editor_sequence}_insertunorderedlist" width="23" height="63" onmouseover="eOptionOver(this)" onmouseout="eOptionOut(this)" />
|
||||
</div>
|
||||
|
||||
<div class="buttonGroup">
|
||||
|
|
@ -102,10 +102,10 @@
|
|||
<!-- 확장 컴포넌트 출력 -->
|
||||
<div class="optionDE">
|
||||
<div class="optionE">
|
||||
<div class="buttonGroup" id="editor_component_{$upload_target_srl}">
|
||||
<div class="buttonGroup" id="editor_component_{$editor_sequence}">
|
||||
<!--@foreach($component_list as $component_name => $component)-->
|
||||
<!--@if(substr($component_name,0,11)!="colorpicker")-->
|
||||
<img src="../../components/{$component_name}/icon.gif" alt="{$component->title}" title="{$component->title}" id="component_{$upload_target_srl}_{$component_name}" onmouseover="eOptionOver(this)" onmouseout="eOptionOut(this)" />
|
||||
<img src="../../components/{$component_name}/icon.gif" alt="{$component->title}" title="{$component->title}" id="component_{$editor_sequence}_{$component_name}" onmouseover="eOptionOver(this)" onmouseout="eOptionOut(this)" />
|
||||
<!--@end-->
|
||||
<!--@end-->
|
||||
</div>
|
||||
|
|
@ -115,50 +115,52 @@
|
|||
</div>
|
||||
|
||||
<!--@if(!$_COOKIE['EditorInfo'])-->
|
||||
<div id="editorInfo_{$upload_target_srl}" class="editorInfo" >
|
||||
<!-- 에디터 안내 출력 -->
|
||||
<div id="editorInfo_{$editor_sequence}" class="editorInfo" >
|
||||
{$lang->about_dblclick_in_editor}
|
||||
<span id="for_ie_help_{$upload_target_srl}" style="display:none">{$lang->edit->help_use_paragrapth}</span>
|
||||
<img src="./images/buttonClose.gif" alt="close" width="13" height="13" class="close" onclick="closeEditorInfo('{$upload_target_srl}'); return false;" />
|
||||
<span id="for_ie_help_{$editor_sequence}" style="display:none">{$lang->edit->help_use_paragrapth}</span>
|
||||
<img src="./images/buttonClose.gif" alt="close" width="13" height="13" class="close" onclick="closeEditorInfo('{$editor_sequence}'); return false;" />
|
||||
</div>
|
||||
<!--@end-->
|
||||
|
||||
<!-- HTML 모드 사용 기능 및 자동저장 메세지 출력용 -->
|
||||
<div class="editor_info">
|
||||
<div class="editor_option">
|
||||
<input type="checkbox" id="use_html_{$upload_target_srl}" value="Y" onclick="editorChangeMode(this, '{$upload_target_srl}');" /> <label for="use_html_{$upload_target_srl}">HTML</label>
|
||||
<input type="checkbox" id="use_html_{$editor_sequence}" value="Y" onclick="editorChangeMode(this, '{$editor_sequence}');" /> <label for="use_html_{$editor_sequence}">HTML</label>
|
||||
</div>
|
||||
<div class="editor_autosaved_message" id="editor_autosaved_message_{$upload_target_srl}"> </div>
|
||||
<div class="editor_autosaved_message" id="editor_autosaved_message_{$editor_sequence}"> </div>
|
||||
</div>
|
||||
|
||||
<div class="editor_iframe_box"><iframe id="editor_iframe_{$upload_target_srl}" frameborder="0" width="100%" height="{$editor_height}" style="background-color:transparent;"></iframe></div>
|
||||
<textarea id="editor_textarea_{$upload_target_srl}" class="editor_iframe_textarea" style="display:none; height:{$editor_height}"></textarea>
|
||||
<!-- 에디터 출력 -->
|
||||
<div class="editor_iframe_box"><iframe id="editor_iframe_{$editor_sequence}" frameborder="0" width="100%" height="{$editor_height}" style="background-color:transparent;"></iframe></div>
|
||||
<textarea id="editor_textarea_{$editor_sequence}" class="editor_iframe_textarea" style="display:none; height:{$editor_height}"></textarea>
|
||||
|
||||
<div class="textAreaDragIndicator"><div class="textAreaDragIndicatorBar" id="editor_drag_bar_{$upload_target_srl}"></div></div>
|
||||
<!-- 에디터 크기 조절 bar -->
|
||||
<div class="textAreaDragIndicator"><div class="textAreaDragIndicatorBar" id="editor_drag_bar_{$editor_sequence}"></div></div>
|
||||
|
||||
<!--@if($allow_fileupload)-->
|
||||
<!-- 첨부파일 영역 -->
|
||||
<!--%import("../../tpl/js/uploader.js")-->
|
||||
<script type="text/javascript">//<![CDATA[
|
||||
var zbxe_session_name = "{session_name()}";
|
||||
var uploader_setting = { "allowed_filesize" : {$file_config->allowed_filesize}, "allowed_filetypes" : "{$file_config->allowed_filetypes}", "allowed_filetypes_description" : "{$file_config->allowed_filetypes}" }
|
||||
editor_upload_init("{$upload_target_srl}");
|
||||
var uploader_setting = { "allowed_filesize" : "{$file_config->allowed_filesize}", "allowed_filetypes" : "{$file_config->allowed_filetypes}", "allowed_filetypes_description" : "{$file_config->allowed_filetypes}" }
|
||||
editor_upload_init("{$editor_sequence}");
|
||||
//]]></script>
|
||||
|
||||
<div class="fileAttach">
|
||||
<input type="hidden" name="upload_target_srl" value="{$upload_target_srl}" />
|
||||
|
||||
<div class="preview" id="preview_uploaded_{$upload_target_srl}">
|
||||
<div class="preview" id="preview_uploaded_{$editor_sequence}">
|
||||
<img src="./images/blank.gif" alt="preview" width="100" height="100" />
|
||||
</div>
|
||||
|
||||
<!-- 파일 업로드 영역 -->
|
||||
<div class="fileListArea">
|
||||
<select id="uploaded_file_list_{$upload_target_srl}" multiple="multiple" size="7" class="fileList" onclick="editor_preview(this, '{$upload_target_srl}');"></select>
|
||||
<span class="file_attach_info" id="uploader_status_{$upload_target_srl}"></span>
|
||||
<select id="uploaded_file_list_{$editor_sequence}" multiple="multiple" size="7" class="fileList" onclick="editor_preview(this, '{$editor_sequence}');"></select>
|
||||
<span class="file_attach_info" id="uploader_status_{$editor_sequence}">{$upload_status}</span>
|
||||
</div>
|
||||
|
||||
<div class="fileUploadControl"><a href="#" onclick="editor_upload_file('{$upload_target_srl}');return false;" class="button"><span>{$lang->edit->upload_file}</span></a></div>
|
||||
<div class="fileUploadControl"><a href="#" onclick="editor_remove_file('{$upload_target_srl}');return false;" class="button"><span>{$lang->edit->delete_selected}</span></a></div>
|
||||
<div class="fileUploadControl"><a href="#" onclick="editor_insert_file('{$upload_target_srl}');return false;" class="button"><span>{$lang->edit->link_file}</span></a></div>
|
||||
<div class="fileUploadControl"><a href="#" onclick="editor_upload_file('{$editor_sequence}');return false;" class="button"><span>{$lang->edit->upload_file}</span></a></div>
|
||||
<div class="fileUploadControl"><a href="#" onclick="editor_remove_file('{$editor_sequence}');return false;" class="button"><span>{$lang->edit->delete_selected}</span></a></div>
|
||||
<div class="fileUploadControl"><a href="#" onclick="editor_insert_file('{$editor_sequence}');return false;" class="button"><span>{$lang->edit->link_file}</span></a></div>
|
||||
|
||||
<div class="clear"></div>
|
||||
</div>
|
||||
|
|
|
|||
|
|
@ -4,193 +4,57 @@
|
|||
* @brief 에디터 관련 스크립트
|
||||
**/
|
||||
|
||||
// iframe의 id prefix
|
||||
var iframe_id = 'editor_iframe_';
|
||||
var textarea_id = 'editor_textarea_';
|
||||
/**
|
||||
* 에디터에서 사용하는 iframe, textarea의 prefix
|
||||
**/
|
||||
var iframe_id = 'editor_iframe_'; ///< 에디터로 사용하는 iframe의 prefix
|
||||
var textarea_id = 'editor_textarea_'; ///< 에디터의 html편집 모드에서 사용하는 textarea의 prefix
|
||||
var editor_mode = new Array(); ///<< 에디터의 html편집 모드 flag 세팅 변수
|
||||
var _editorSyncList = new Array(); ///< 에디터와 form 동기화를 위한 동기화 대상 목록
|
||||
var _autoSaveObj = {fo_obj:null, editor_sequence:0, title:'', content:'', locked:false} ///< 자동저장을 위한 정보를 가진 object
|
||||
var editor_rel_keys = new Array(); ///< 에디터와 각 모듈과의 연동을 위한 key 값을 보관하는 변수
|
||||
|
||||
// upload_target_srl에 대한 form문을 객체로 보관함
|
||||
var editor_form_list = new Array();
|
||||
/**
|
||||
* 에디터 사용시 사용되는 이벤트 연결 함수 호출
|
||||
**/
|
||||
xAddEventListener(window, 'load', _editorSync); ///< 에디터의 동기화를 하는 함수를 window.load시 실행
|
||||
|
||||
// 편집 상태에 대한 체크
|
||||
var editor_mode = new Array();
|
||||
|
||||
// upload_target_srl값에 해당하는 iframe의 object를 return
|
||||
function editorGetIFrame(upload_target_srl) {
|
||||
var obj_id = iframe_id+upload_target_srl;
|
||||
|
||||
/**
|
||||
* 에디터의 상태나 객체를 구하기 위한 함수
|
||||
**/
|
||||
|
||||
// editor_sequence값에 해당하는 iframe의 object를 return
|
||||
function editorGetIFrame(editor_sequence) {
|
||||
var obj_id = iframe_id + editor_sequence;
|
||||
return xGetElementById(obj_id);
|
||||
}
|
||||
|
||||
// upload_target_srl값에 해당하는 textarea object를 return
|
||||
function editorGetTextArea(upload_target_srl) {
|
||||
var obj_id = textarea_id+upload_target_srl;
|
||||
// editor_sequence값에 해당하는 textarea object를 return
|
||||
function editorGetTextArea(editor_sequence) {
|
||||
var obj_id = textarea_id + editor_sequence;
|
||||
return xGetElementById(obj_id);
|
||||
}
|
||||
|
||||
// editor 시작 (upload_target_srl로 iframe객체를 얻어서 쓰기 모드로 전환)
|
||||
function editorStart(upload_target_srl, resizable, editor_height) {
|
||||
if(typeof(resizable)=="undefined"||!resizable) resizable = false;
|
||||
else resizable = true;
|
||||
|
||||
// iframe obj를 찾음
|
||||
var iframe_obj = editorGetIFrame(upload_target_srl);
|
||||
// editor_sequence에 해당하는 form문 구함
|
||||
function editorGetForm(editor_sequence) {
|
||||
var iframe_obj = editorGetIFrame(editor_sequence);
|
||||
if(!iframe_obj) return;
|
||||
iframe_obj.style.width = '100%';
|
||||
|
||||
// 현 에디터를 감싸고 있는 form문을 찾아서 content object를 찾아서 내용 sync
|
||||
var fo_obj = iframe_obj.parentNode;
|
||||
while(fo_obj.nodeName != 'FORM') { fo_obj = fo_obj.parentNode; }
|
||||
|
||||
// saved document에 대한 체크
|
||||
if(typeof(fo_obj._saved_doc_title)!="undefined" ) {
|
||||
var saved_title = fo_obj._saved_doc_title.value;
|
||||
var saved_content = fo_obj._saved_doc_content.value;
|
||||
if(saved_title || saved_content) {
|
||||
if(confirm(fo_obj._saved_doc_message.value)) {
|
||||
fo_obj.title.value = saved_title;
|
||||
fo_obj.content.value = saved_content;
|
||||
} else {
|
||||
editorRemoveSavedDoc();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 구해진 form 객체를 저장
|
||||
editor_form_list[upload_target_srl] = fo_obj;
|
||||
|
||||
// 대상 form의 content object에서 데이터를 구함
|
||||
var content = fo_obj.content.value;
|
||||
if(!content && !xIE4Up) content = "<br />";
|
||||
|
||||
// iframe내의 document object
|
||||
var contentDocument = iframe_obj.contentWindow.document;
|
||||
|
||||
// 기본 내용 작성
|
||||
var contentHtml = ''+
|
||||
'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">'+
|
||||
'<html lang="ko" xmlns="http://www.w3.org/1999/xhtml><head><meta http-equiv="content-type" content="text/html; charset=utf-8"/>'+
|
||||
'<base href="'+request_uri+'" />'+
|
||||
'<link rel="stylesheet" href="'+request_uri+'/common/css/default.css" type="text/css" />'+
|
||||
'<link rel="stylesheet" href="'+request_uri+editor_path+'/css/editor.css" type="text/css" />'+
|
||||
'<style style="text/css">'+
|
||||
'body {margin:0px; height:'+editor_height+'px;}'+
|
||||
'</style>'+
|
||||
'</head><body upload_target_srl="'+upload_target_srl+'">'+
|
||||
content+
|
||||
'</body></html>'+
|
||||
'';
|
||||
contentDocument.designMode = 'on';
|
||||
try {
|
||||
contentDocument.execCommand("undo", false, null);
|
||||
contentDocument.execCommand("useCSS", false, true);
|
||||
} catch (e) {
|
||||
}
|
||||
contentDocument.open("text/html","replace");
|
||||
contentDocument.write(contentHtml);
|
||||
contentDocument.close();
|
||||
|
||||
// 작성시 필요한 이벤트 체크
|
||||
if(xIE4Up) xAddEventListener(contentDocument, 'keydown',editorKeyPress);
|
||||
else xAddEventListener(contentDocument, 'keypress',editorKeyPress);
|
||||
xAddEventListener(contentDocument,'mousedown',editorHideObject);
|
||||
|
||||
// 위젯 감시를 위한 더블클릭 이벤트 걸기 (오페라에 대한 처리는 차후에.. 뭔가 이상함)
|
||||
xAddEventListener(contentDocument,'dblclick',editorSearchComponent);
|
||||
xAddEventListener(document,'dblclick',editorSearchComponent);
|
||||
|
||||
xAddEventListener(document,'mouseup',editorEventCheck);
|
||||
xAddEventListener(document,'mousedown',editorHideObject);
|
||||
|
||||
if(xIE4Up && xGetElementById('for_ie_help_'+upload_target_srl)) {
|
||||
xGetElementById('for_ie_help_'+upload_target_srl).style.display = "block";
|
||||
}
|
||||
|
||||
// 에디터의 내용을 지속적으로 fo_obj.content.value에 입력
|
||||
editorSyncContent(fo_obj.content, upload_target_srl);
|
||||
|
||||
if(typeof(fo_obj._saved_doc_title)!="undefined" ) editorEnableAutoSave(fo_obj, upload_target_srl);
|
||||
|
||||
// 크기 변경 불가일 경우 드래그바 숨김
|
||||
if(resizable == false) xGetElementById("editor_drag_bar_"+upload_target_srl).style.display = "none";
|
||||
|
||||
if(fo_obj.nodeName == 'FORM') return fo_obj;
|
||||
return;
|
||||
}
|
||||
|
||||
// 여러개의 편집기를 예상하여 전역 배열 변수에 form, iframe의 정보를 넣음
|
||||
var _editorSyncList = new Array();
|
||||
function editorSyncContent(obj, upload_target_srl) {
|
||||
_editorSyncList[_editorSyncList.length] = {field:obj, upload_target_srl:upload_target_srl}
|
||||
}
|
||||
|
||||
// 편집기와 폼의 정보를 주기적으로 동기화 시킴
|
||||
function _editorSync() {
|
||||
for(var i=0;i<_editorSyncList.length;i++) {
|
||||
var field = _editorSyncList[i].field;
|
||||
var upload_target_srl = _editorSyncList[i].upload_target_srl;
|
||||
var content = editorGetContent(upload_target_srl);
|
||||
if(typeof(content)=='undefined') continue;
|
||||
field.value = content;
|
||||
}
|
||||
setTimeout(_editorSync, 1000);
|
||||
}
|
||||
xAddEventListener(window, 'load', _editorSync);
|
||||
|
||||
// 자동 저장 기능
|
||||
var _autoSaveObj = {fo_obj:null, upload_target_srl:0, title:'', content:''}
|
||||
function editorEnableAutoSave(fo_obj, upload_target_srl) {
|
||||
var title = fo_obj.title.value;
|
||||
var content = fo_obj.content.value;
|
||||
_autoSaveObj = {"fo_obj":fo_obj, "upload_target_srl":upload_target_srl, "title":title, "content":content};
|
||||
setTimeout(_editorAutoSave, 5000);
|
||||
}
|
||||
|
||||
function _editorAutoSave() {
|
||||
var fo_obj = _autoSaveObj.fo_obj;
|
||||
var upload_target_srl = _autoSaveObj.upload_target_srl;
|
||||
|
||||
if(fo_obj && upload_target_srl) {
|
||||
var title = fo_obj.title.value;
|
||||
var content = editorGetContent(upload_target_srl);
|
||||
if((fo_obj.title && title.trim() != _autoSaveObj.title.trim()) || content.trim() != _autoSaveObj.content.trim()) {
|
||||
var params = new Array();
|
||||
params["document_srl"] = upload_target_srl;
|
||||
params["title"] = title;
|
||||
params["content"] = content;
|
||||
|
||||
_autoSaveObj.title = title;
|
||||
_autoSaveObj.content = content;
|
||||
|
||||
var obj = xGetElementById("editor_autosaved_message_"+upload_target_srl);
|
||||
var oDate = new Date();
|
||||
html = oDate.getHours()+':'+oDate.getMinutes()+' '+auto_saved_msg;
|
||||
xInnerHtml(obj, html);
|
||||
obj.style.display = "block";
|
||||
|
||||
show_waiting_message = false;
|
||||
exec_xml("editor","procEditorSaveDoc", params, _editorAutoSaved);
|
||||
show_waiting_message = true;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
setTimeout(_editorAutoSave, 15000);
|
||||
}
|
||||
|
||||
function _editorAutoSaved(ret_obj) {
|
||||
setTimeout(_editorAutoSave, 15000);
|
||||
return null;
|
||||
}
|
||||
|
||||
function editorRemoveSavedDoc() {
|
||||
exec_xml("editor","procEditorRemoveSavedDoc");
|
||||
}
|
||||
|
||||
// 에디터의 전체 내용 return
|
||||
function editorGetContent(upload_target_srl) {
|
||||
var iframe_obj = editorGetIFrame(upload_target_srl);
|
||||
// 에디터의 전체 내용 return, HTML 편집모드일 경우에 데이터를 이전후 값 return
|
||||
function editorGetContent(editor_sequence) {
|
||||
var iframe_obj = editorGetIFrame(editor_sequence);
|
||||
if(!iframe_obj) return null;
|
||||
|
||||
var html = null;
|
||||
if(editor_mode[upload_target_srl]=='html') {
|
||||
var textarea_obj = editorGetTextArea(upload_target_srl);
|
||||
if(editor_mode[editor_sequence]=='html') {
|
||||
var textarea_obj = editorGetTextArea(editor_sequence);
|
||||
var html = textarea_obj.value;
|
||||
var contentDocument = iframe_obj.contentWindow.document;
|
||||
contentDocument.body.innerHTML = html;
|
||||
|
|
@ -202,8 +66,8 @@ function editorGetContent(upload_target_srl) {
|
|||
}
|
||||
|
||||
// 에디터 내의 선택된 부분의 html 코드를 return
|
||||
function editorGetSelectedHtml(upload_target_srl) {
|
||||
var iframe_obj = editorGetIFrame(upload_target_srl);
|
||||
function editorGetSelectedHtml(editor_sequence) {
|
||||
var iframe_obj = editorGetIFrame(editor_sequence);
|
||||
if(xIE4Up) {
|
||||
var range = iframe_obj.contentWindow.document.selection.createRange();
|
||||
var html = range.htmlText;
|
||||
|
|
@ -219,8 +83,8 @@ function editorGetSelectedHtml(upload_target_srl) {
|
|||
}
|
||||
|
||||
// 에디터 내의 선택된 부분의 NODE를 return
|
||||
function editorGetSelectedNode(upload_target_srl) {
|
||||
var iframe_obj = editorGetIFrame(upload_target_srl);
|
||||
function editorGetSelectedNode(editor_sequence) {
|
||||
var iframe_obj = editorGetIFrame(editor_sequence);
|
||||
if(xIE4Up) {
|
||||
var range = iframe_obj.contentWindow.document.selection.createRange();
|
||||
var div = xCreateElement('div');
|
||||
|
|
@ -235,6 +99,217 @@ function editorGetSelectedNode(upload_target_srl) {
|
|||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* editor 시작 (editor_sequence로 iframe객체를 얻어서 쓰기 모드로 전환)
|
||||
**/
|
||||
function editorStart(editor_sequence, primary_key, content_key, resizable, editor_height) {
|
||||
// resize 가/불가에 대한 체크
|
||||
if(typeof(resizable)=="undefined"||!resizable) resizable = false;
|
||||
else resizable = true;
|
||||
|
||||
// iframe obj를 찾음
|
||||
var iframe_obj = editorGetIFrame(editor_sequence);
|
||||
if(!iframe_obj) return;
|
||||
iframe_obj.style.width = '100%'; ///<< iframe_obj의 가로 크기를 100%로 고정
|
||||
|
||||
// 현 에디터를 감싸고 있는 form문을 찾아서 content object를 찾아서 내용 sync
|
||||
var fo_obj = editorGetForm(editor_sequence);
|
||||
if(!fo_obj) return;
|
||||
|
||||
// 모듈 연관 키 값을 세팅
|
||||
editor_rel_keys[editor_sequence] = new Array();
|
||||
editor_rel_keys[editor_sequence]["primary"] = fo_obj[primary_key];
|
||||
editor_rel_keys[editor_sequence]["content"] = fo_obj[content_key];
|
||||
|
||||
// saved document(자동저장 문서)에 대한 확인
|
||||
if(typeof(fo_obj._saved_doc_title)!="undefined" ) { ///<< _saved_doc_title field가 없으면 자동저장 하지 않음
|
||||
|
||||
var saved_title = fo_obj._saved_doc_title.value;
|
||||
var saved_content = fo_obj._saved_doc_content.value;
|
||||
|
||||
if(saved_title || saved_content) {
|
||||
// 자동저장된 문서 활용여부를 물은 후 사용하지 않는다면 자동저장된 문서 삭제
|
||||
if(confirm(fo_obj._saved_doc_message.value)) {
|
||||
if(typeof(fo_obj.title)!='undefined') fo_obj.title.value = saved_title;
|
||||
editor_rel_keys[editor_sequence]['content'].value = saved_content;
|
||||
} else {
|
||||
editorRemoveSavedDoc();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 대상 form의 content element에서 데이터를 구함
|
||||
var content = editor_rel_keys[editor_sequence]['content'].value;
|
||||
|
||||
// IE가 아니고 내용이 없으면 <br /> 추가 (FF등에서 iframe 선택시 focus를 주기 위한 꽁수)
|
||||
if(!content && !xIE4Up) content = "<br />";
|
||||
|
||||
// iframe내의 document element를 구함
|
||||
var contentDocument = iframe_obj.contentWindow.document;
|
||||
|
||||
/**
|
||||
* 에디터를 위지윅 모드로 만들기 위해 내용 작성 후 designMode 활성화
|
||||
**/
|
||||
var contentHtml = ''+
|
||||
'<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">'+
|
||||
'<html lang="ko" xmlns="http://www.w3.org/1999/xhtml><head><meta http-equiv="content-type" content="text/html; charset=utf-8"/>'+
|
||||
'<base href="'+request_uri+'" />'+
|
||||
'<link rel="stylesheet" href="'+request_uri+'/common/css/default.css" type="text/css" />'+
|
||||
'<link rel="stylesheet" href="'+request_uri+editor_path+'/css/editor.css" type="text/css" />'+
|
||||
'<style style="text/css">'+
|
||||
'body {font-size:9pt;margin:0px; height:'+editor_height+'px;}'+
|
||||
'</style>'+
|
||||
'</head><body editor_sequence="'+editor_sequence+'">'+
|
||||
content+
|
||||
'</body></html>'+
|
||||
'';
|
||||
contentDocument.designMode = 'on';
|
||||
try {
|
||||
contentDocument.execCommand("undo", false, null);
|
||||
contentDocument.execCommand("useCSS", false, true);
|
||||
} catch (e) {
|
||||
}
|
||||
contentDocument.open("text/html","replace");
|
||||
contentDocument.write(contentHtml);
|
||||
contentDocument.close();
|
||||
|
||||
/**
|
||||
* 더블클릭이나 키눌림등의 각종 이벤트에 대해 listener 추가
|
||||
**/
|
||||
// 작성시 필요한 이벤트 체크
|
||||
if(xIE4Up) xAddEventListener(contentDocument, 'keydown',editorKeyPress);
|
||||
else xAddEventListener(contentDocument, 'keypress',editorKeyPress);
|
||||
xAddEventListener(contentDocument,'mousedown',editorHideObject);
|
||||
|
||||
// 위젯 감시를 위한 더블클릭 이벤트 걸기 (오페라에 대한 처리는 차후에.. 뭔가 이상함)
|
||||
xAddEventListener(contentDocument,'dblclick',editorSearchComponent);
|
||||
xAddEventListener(document,'dblclick',editorSearchComponent);
|
||||
xAddEventListener(document,'mouseup',editorEventCheck);
|
||||
xAddEventListener(document,'mousedown',editorHideObject);
|
||||
|
||||
// IE일 경우 ctrl-Enter 안내 문구를 노출
|
||||
if(xIE4Up && xGetElementById('for_ie_help_'+editor_sequence)) {
|
||||
xGetElementById('for_ie_help_'+editor_sequence).style.display = "block";
|
||||
}
|
||||
|
||||
/**
|
||||
* 에디터의 내용을 지속적으로 fo_obj.content의 값과 동기화를 시킴.
|
||||
* 차후 다른 에디터를 사용하더라도 fo_obj.content와 동기화만 된다면 어떤 에디터라도 사용 가능하도록 하기 위해
|
||||
* 별도의 동기화 루틴을 이용함
|
||||
**/
|
||||
editorSyncContent(editor_rel_keys[editor_sequence]['content'], editor_sequence);
|
||||
|
||||
// 자동저장 필드가 있다면 자동 저장 기능 활성화
|
||||
if(typeof(fo_obj._saved_doc_title)!="undefined" ) editorEnableAutoSave(fo_obj, editor_sequence);
|
||||
|
||||
// 크기 변경 불가일 경우 드래그바 숨김
|
||||
if(resizable == false) xGetElementById("editor_drag_bar_"+editor_sequence).style.display = "none";
|
||||
else xGetElementById("editor_drag_bar_"+editor_sequence).style.display = "block";
|
||||
|
||||
// editor_mode를 기본으로 설정
|
||||
editor_mode[editor_sequence] = null;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 에디터와 form문의 동기화를 위한 함수들
|
||||
**/
|
||||
// 여러개의 편집기를 예상하여 전역 배열 변수에 form, iframe의 정보를 넣음
|
||||
function editorSyncContent(obj, editor_sequence) {
|
||||
_editorSyncList[_editorSyncList.length] = {field:obj, editor_sequence:editor_sequence}
|
||||
}
|
||||
|
||||
// 편집기와 폼의 정보를 주기적으로 동기화 시킴
|
||||
function _editorSync() {
|
||||
// 등록된 모든 에디터에 대해 동기화를 시킴
|
||||
for(var i=0;i<_editorSyncList.length;i++) {
|
||||
var field = _editorSyncList[i].field;
|
||||
var editor_sequence = _editorSyncList[i].editor_sequence;
|
||||
var content = editorGetContent(editor_sequence);
|
||||
if(typeof(content)=='undefined') continue;
|
||||
field.value = content;
|
||||
}
|
||||
|
||||
// 1.5초마다 계속 동기화 시킴
|
||||
setTimeout(_editorSync, 1500);
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 자동 저장 기능
|
||||
**/
|
||||
// 자동 저장 활성화 시키는 함수 (5초마다 자동저장)
|
||||
function editorEnableAutoSave(fo_obj, editor_sequence) {
|
||||
var title = fo_obj.title.value;
|
||||
var content = editor_rel_keys[editor_sequence]['content'].value;
|
||||
_autoSaveObj = {"fo_obj":fo_obj, "editor_sequence":editor_sequence, "title":title, "content":content, locked:false};
|
||||
setTimeout(_editorAutoSave, 5000);
|
||||
}
|
||||
|
||||
// ajax를 이용하여 editor.procEditorSaveDoc 호출하여 자동 저장시킴
|
||||
function _editorAutoSave() {
|
||||
var fo_obj = _autoSaveObj.fo_obj;
|
||||
var editor_sequence = _autoSaveObj.editor_sequence;
|
||||
|
||||
// 현재 자동저장중이면 중지
|
||||
if(_autoSaveObj.locked == true) return;
|
||||
|
||||
// 대상이 없으면 자동저장 시키는 기능 자체를 중지
|
||||
if(!fo_obj || typeof(fo_obj.title)=='undefined' || !editor_sequence) return;
|
||||
|
||||
// 자동저장을 위한 준비
|
||||
var title = fo_obj.title.value;
|
||||
var content = editorGetContent(editor_sequence);
|
||||
|
||||
// 내용이 이전에 저장하였던 것과 다르면 자동 저장을 함
|
||||
if(title != _autoSaveObj.title || content != _autoSaveObj.content ) {
|
||||
var params = new Array();
|
||||
|
||||
params["title"] = title;
|
||||
params["content"] = content;
|
||||
params["document_srl"] = editor_rel_keys[editor_sequence]['primary'].value;
|
||||
|
||||
_autoSaveObj.title = title;
|
||||
_autoSaveObj.content = content;
|
||||
|
||||
var obj = xGetElementById("editor_autosaved_message_"+editor_sequence);
|
||||
var oDate = new Date();
|
||||
html = oDate.getHours()+':'+oDate.getMinutes()+' '+auto_saved_msg;
|
||||
xInnerHtml(obj, html);
|
||||
obj.style.display = "block";
|
||||
|
||||
// 현재 자동저장중임을 설정
|
||||
_autoSaveObj.locked = true;
|
||||
|
||||
// 서버 호출 (서버와 교신중이라는 메세지를 보이지 않도록 함)
|
||||
show_waiting_message = false;
|
||||
exec_xml("editor","procEditorSaveDoc", params, function() { _autoSaveObj.locked = false; } );
|
||||
show_waiting_message = true;
|
||||
}
|
||||
|
||||
// 10초마다 동기화를 시킴
|
||||
setTimeout(_editorAutoSave, 10000);
|
||||
}
|
||||
|
||||
// 자동저장된 모든 메세지를 삭제하는 루틴
|
||||
function editorRemoveSavedDoc() {
|
||||
exec_xml("editor","procEditorRemoveSavedDoc");
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 에디터의 세부 설정과 데이터 핸들링을 정의한 함수들
|
||||
**/
|
||||
|
||||
// 에디터에 포커스를 줌
|
||||
function editorFocus(editor_sequence) {
|
||||
var iframe_obj = editorGetIFrame(editor_sequence);
|
||||
iframe_obj.contentWindow.focus();
|
||||
}
|
||||
|
||||
// 에디터 내의 선택된 부분의 html코드를 변경
|
||||
function editorReplaceHTML(iframe_obj, html) {
|
||||
iframe_obj.contentWindow.focus();
|
||||
|
|
@ -259,33 +334,32 @@ function editorReplaceHTML(iframe_obj, html) {
|
|||
}
|
||||
}
|
||||
|
||||
// 에디터에 포커스를 줌
|
||||
function editorFocus(upload_target_srl) {
|
||||
var iframe_obj = editorGetIFrame(upload_target_srl);
|
||||
iframe_obj.contentWindow.focus();
|
||||
}
|
||||
/**
|
||||
* 키 또는 마우스 이벤트 핸들링 정의 함수
|
||||
**/
|
||||
|
||||
// 입력 키에 대한 이벤트 체크
|
||||
function editorKeyPress(evt) {
|
||||
var e = new xEvent(evt);
|
||||
|
||||
// 대상을 구함
|
||||
var obj = e.target;
|
||||
var body_obj = null;
|
||||
if(obj.nodeName == "BODY") body_obj = obj;
|
||||
else body_obj = obj.firstChild.nextSibling;
|
||||
if(!body_obj) return;
|
||||
|
||||
var upload_target_srl = body_obj.getAttribute("upload_target_srl");
|
||||
if(!upload_target_srl) return;
|
||||
// editor_sequence는 에디터의 body에 attribute로 정의되어 있음
|
||||
var editor_sequence = body_obj.getAttribute("editor_sequence");
|
||||
if(!editor_sequence) return;
|
||||
|
||||
// IE에서 enter키를 눌렀을때 P 태그 대신 BR 태그 입력
|
||||
if (xIE4Up && !e.ctrlKey && !e.shiftKey && e.keyCode == 13 && editor_mode[upload_target_srl]!='html') {
|
||||
var iframe_obj = editorGetIFrame(upload_target_srl);
|
||||
if (xIE4Up && !e.ctrlKey && !e.shiftKey && e.keyCode == 13 && editor_mode[editor_sequence]!='html') {
|
||||
var iframe_obj = editorGetIFrame(editor_sequence);
|
||||
if(!iframe_obj) return;
|
||||
var contentDocument = iframe_obj.contentWindow.document;
|
||||
|
||||
var obj = contentDocument.selection.createRange();
|
||||
obj.pasteHTML('<br />');
|
||||
obj.pasteHTML("<br />\n");
|
||||
obj.select();
|
||||
evt.cancelBubble = true;
|
||||
evt.returnValue = false;
|
||||
|
|
@ -294,14 +368,21 @@ function editorKeyPress(evt) {
|
|||
|
||||
// ctrl-S, alt-S 클릭시 submit하기
|
||||
if( e.keyCode == 115 && (e.altKey || e.ctrlKey) ) {
|
||||
var iframe_obj = editorGetIFrame(upload_target_srl);
|
||||
// iframe 에디터를 찾음
|
||||
var iframe_obj = editorGetIFrame(editor_sequence);
|
||||
if(!iframe_obj) return;
|
||||
var contentDocument = iframe_obj.contentWindow.document;
|
||||
|
||||
var fo_obj = iframe_obj.parentNode;
|
||||
while(fo_obj.nodeName != 'FORM') { fo_obj = fo_obj.parentNode; }
|
||||
// 대상 form을 찾음
|
||||
var fo_obj = editorGetForm(editor_sequence);
|
||||
if(!fo_obj) return;
|
||||
|
||||
// 데이터 동기화
|
||||
editor_rel_keys[editor_sequence]['content'].value = editorGetContent(editor_sequence);
|
||||
|
||||
// form문 전송
|
||||
if(fo_obj.onsubmit) fo_obj.onsubmit();
|
||||
|
||||
// 이벤트 중단
|
||||
evt.cancelBubble = true;
|
||||
evt.returnValue = false;
|
||||
xPreventDefault(evt);
|
||||
|
|
@ -311,12 +392,12 @@ function editorKeyPress(evt) {
|
|||
|
||||
// ctrl-b, i, u, s 키에 대한 처리 (파이어폭스에서도 에디터 상태에서 단축키 쓰도록)
|
||||
if (e.ctrlKey) {
|
||||
var iframe_obj = editorGetIFrame(upload_target_srl);
|
||||
// iframe 에디터를 찾음
|
||||
var iframe_obj = editorGetIFrame(editor_sequence);
|
||||
if(!iframe_obj) return;
|
||||
var contentDocument = iframe_obj.contentWindow.document;
|
||||
|
||||
// html 에디터 모드일 경우 이벤트 취소 시킴
|
||||
if(editor_mode[upload_target_srl]=='html') {
|
||||
if(editor_mode[editor_sequence]=='html') {
|
||||
evt.cancelBubble = true;
|
||||
evt.returnValue = false;
|
||||
xPreventDefault(evt);
|
||||
|
|
@ -384,7 +465,64 @@ function editorKeyPress(evt) {
|
|||
}
|
||||
}
|
||||
|
||||
// 에디터 상단의 버튼 클릭시 action 처리 (마우스다운 이벤트 발생시마다 요청이 됨)
|
||||
// 편집 기능 실행
|
||||
function editorDo(command, value, target) {
|
||||
|
||||
var doc = null;
|
||||
|
||||
// target이 object인지 editor_sequence인지에 따라 document를 구함
|
||||
if(typeof(target)=="object") {
|
||||
if(xIE4Up) doc = target.parentElement.document;
|
||||
else doc = target.parentNode;
|
||||
} else {
|
||||
var iframe_obj = editorGetIFrame(target);
|
||||
doc = iframe_obj.contentWindow.document;
|
||||
}
|
||||
|
||||
var editor_sequence = doc.body.getAttribute('editor_sequence');
|
||||
if(editor_mode[editor_sequence]=='html') return;
|
||||
|
||||
// 포커스
|
||||
if(typeof(target)=="object") target.focus();
|
||||
else editorFocus(target);
|
||||
|
||||
// 실행
|
||||
doc.execCommand(command, false, value);
|
||||
|
||||
// 포커스
|
||||
if(typeof(target)=="object") target.focus();
|
||||
else editorFocus(target);
|
||||
}
|
||||
|
||||
// 폰트를 변경
|
||||
function editorChangeFontName(obj,srl) {
|
||||
var value = obj.options[obj.selectedIndex].value;
|
||||
if(!value) return;
|
||||
editorDo('FontName',value,srl);
|
||||
obj.selectedIndex = 0;
|
||||
}
|
||||
|
||||
function editorChangeFontSize(obj,srl) {
|
||||
var value = obj.options[obj.selectedIndex].value;
|
||||
if(!value) return;
|
||||
editorDo('FontSize',value,srl);
|
||||
obj.selectedIndex = 0;
|
||||
}
|
||||
|
||||
function editorChangeHeader(obj,srl) {
|
||||
var value = obj.options[obj.selectedIndex].value;
|
||||
if(!value) return;
|
||||
value = "<"+value+">";
|
||||
editorDo('formatblock',value,srl);
|
||||
obj.selectedIndex = 0;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* 에디터 컴포넌트 구현 부분
|
||||
**/
|
||||
|
||||
// 에디터 상단의 컴포넌트 버튼 클릭시 action 처리 (마우스다운 이벤트 발생시마다 요청이 됨)
|
||||
var editorPrevObj = null;
|
||||
var editorPrevSrl = null;
|
||||
function editorEventCheck(evt) {
|
||||
|
|
@ -395,14 +533,14 @@ function editorEventCheck(evt) {
|
|||
var target_id = e.target.id;
|
||||
if(!target_id) return;
|
||||
|
||||
// upload_target_srl와 component name을 구함 (id가 포맷과 다르면 return)
|
||||
// editor_sequence와 component name을 구함 (id가 포맷과 다르면 return)
|
||||
var info = target_id.split('_');
|
||||
if(info[0]!="component") return;
|
||||
var upload_target_srl = info[1];
|
||||
var editor_sequence = info[1];
|
||||
var component_name = target_id.replace(/^component_([0-9]+)_/,'');
|
||||
if(!upload_target_srl || !component_name) return;
|
||||
if(!editor_sequence || !component_name) return;
|
||||
|
||||
if(editor_mode[upload_target_srl]=='html') return;
|
||||
if(editor_mode[editor_sequence]=='html') return;
|
||||
|
||||
switch(component_name) {
|
||||
|
||||
|
|
@ -420,12 +558,12 @@ function editorEventCheck(evt) {
|
|||
case 'outdent' :
|
||||
case 'insertorderedlist' :
|
||||
case 'insertunorderedlist' :
|
||||
editorDo(component_name, '', upload_target_srl);
|
||||
editorDo(component_name, '', editor_sequence);
|
||||
break;
|
||||
|
||||
// 추가 컴포넌트의 경우 서버에 요청을 시도
|
||||
default :
|
||||
openComponent(component_name, upload_target_srl);
|
||||
openComponent(component_name, editor_sequence);
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
@ -433,11 +571,11 @@ function editorEventCheck(evt) {
|
|||
}
|
||||
|
||||
// 컴포넌트 팝업 열기
|
||||
function openComponent(component_name, upload_target_srl, manual_url) {
|
||||
editorPrevSrl = upload_target_srl;
|
||||
if(editor_mode[upload_target_srl]=='html') return;
|
||||
function openComponent(component_name, editor_sequence, manual_url) {
|
||||
editorPrevSrl = editor_sequence;
|
||||
if(editor_mode[editor_sequence]=='html') return;
|
||||
|
||||
var popup_url = request_uri+"?module=editor&act=dispEditorPopup&upload_target_srl="+upload_target_srl+"&component="+component_name;
|
||||
var popup_url = request_uri+"?module=editor&act=dispEditorPopup&editor_sequence="+editor_sequence+"&component="+component_name;
|
||||
if(typeof(manual_url)!="undefined" && manual_url) popup_url += "&manual_url="+escape(manual_url);
|
||||
|
||||
popopen(popup_url, 'editorComponent');
|
||||
|
|
@ -453,21 +591,21 @@ function editorSearchComponent(evt) {
|
|||
|
||||
// 위젯인지 일단 체크
|
||||
if(obj.getAttribute("widget")) {
|
||||
// upload_target_srl을 찾음
|
||||
// editor_sequence을 찾음
|
||||
var tobj = obj;
|
||||
while(tobj && tobj.nodeName != "BODY") {
|
||||
tobj = xParent(tobj);
|
||||
}
|
||||
if(!tobj || tobj.nodeName != "BODY" || !tobj.getAttribute("upload_target_srl")) {
|
||||
if(!tobj || tobj.nodeName != "BODY" || !tobj.getAttribute("editor_sequence")) {
|
||||
editorPrevNode = null;
|
||||
return;
|
||||
}
|
||||
var upload_target_srl = tobj.getAttribute("upload_target_srl");
|
||||
var editor_sequence = tobj.getAttribute("editor_sequence");
|
||||
var widget = obj.getAttribute("widget");
|
||||
editorPrevNode = obj;
|
||||
|
||||
if(editor_mode[upload_target_srl]=='html') return;
|
||||
popopen(request_uri+"?module=widget&act=dispWidgetGenerateCodeInPage&selected_widget="+widget+"&module_srl="+upload_target_srl,'GenerateCodeInPage');
|
||||
if(editor_mode[editor_sequence]=='html') return;
|
||||
popopen(request_uri+"?module=widget&act=dispWidgetGenerateCodeInPage&selected_widget="+widget+"&module_srl="+editor_sequence,'GenerateCodeInPage');
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
@ -510,19 +648,19 @@ function editorSearchComponent(evt) {
|
|||
return;
|
||||
}
|
||||
|
||||
// upload_target_srl을 찾음
|
||||
// editor_sequence을 찾음
|
||||
var tobj = obj;
|
||||
while(tobj && tobj.nodeName != "BODY") {
|
||||
tobj = xParent(tobj);
|
||||
}
|
||||
if(!tobj || tobj.nodeName != "BODY" || !tobj.getAttribute("upload_target_srl")) {
|
||||
if(!tobj || tobj.nodeName != "BODY" || !tobj.getAttribute("editor_sequence")) {
|
||||
editorPrevNode = null;
|
||||
return;
|
||||
}
|
||||
var upload_target_srl = tobj.getAttribute("upload_target_srl");
|
||||
var editor_sequence = tobj.getAttribute("editor_sequence");
|
||||
|
||||
// 해당 컴포넌트를 찾아서 실행
|
||||
openComponent(editor_component, upload_target_srl);
|
||||
openComponent(editor_component, editor_sequence);
|
||||
}
|
||||
|
||||
// 마우스 클릭시 이전 object정보를 숨김
|
||||
|
|
@ -541,14 +679,15 @@ function editorHideObject(evt) {
|
|||
return;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* HTML 편집 기능
|
||||
* HTML 편집 기능 활성/비활성
|
||||
**/
|
||||
function editorChangeMode(obj, upload_target_srl) {
|
||||
var iframe_obj = editorGetIFrame(upload_target_srl);
|
||||
function editorChangeMode(obj, editor_sequence) {
|
||||
var iframe_obj = editorGetIFrame(editor_sequence);
|
||||
if(!iframe_obj) return;
|
||||
|
||||
var textarea_obj = editorGetTextArea(upload_target_srl);
|
||||
var textarea_obj = editorGetTextArea(editor_sequence);
|
||||
xWidth(textarea_obj, xWidth(iframe_obj.parentNode));
|
||||
xHeight(textarea_obj, xHeight(iframe_obj.parentNode));
|
||||
|
||||
|
|
@ -564,9 +703,9 @@ function editorChangeMode(obj, upload_target_srl) {
|
|||
|
||||
iframe_obj.parentNode.style.display = "none";
|
||||
textarea_obj.style.display = "block";
|
||||
xGetElementById('xeEditorOption_'+upload_target_srl).style.display = "none";
|
||||
xGetElementById('xeEditorOption_'+editor_sequence).style.display = "none";
|
||||
|
||||
editor_mode[upload_target_srl] = 'html';
|
||||
editor_mode[editor_sequence] = 'html';
|
||||
|
||||
// 위지윅 모드 사용시
|
||||
} else {
|
||||
|
|
@ -574,68 +713,12 @@ function editorChangeMode(obj, upload_target_srl) {
|
|||
contentDocument.body.innerHTML = html;
|
||||
iframe_obj.parentNode.style.display = "block";
|
||||
textarea_obj.style.display = "none";
|
||||
xGetElementById('xeEditorOption_'+upload_target_srl).style.display = "block";
|
||||
editor_mode[upload_target_srl] = null;
|
||||
xGetElementById('xeEditorOption_'+editor_sequence).style.display = "block";
|
||||
editor_mode[editor_sequence] = null;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* 편집기능 실행
|
||||
*/
|
||||
|
||||
// 편집 기능 실행
|
||||
function editorDo(command, value, target) {
|
||||
|
||||
var doc = null;
|
||||
|
||||
// target이 object인지 upload_target_srl인지에 따라 document를 구함
|
||||
if(typeof(target)=="object") {
|
||||
if(xIE4Up) doc = target.parentElement.document;
|
||||
else doc = target.parentNode;
|
||||
} else {
|
||||
var iframe_obj = editorGetIFrame(target);
|
||||
doc = iframe_obj.contentWindow.document;
|
||||
}
|
||||
|
||||
var upload_target_srl = doc.body.getAttribute('upload_target_srl');
|
||||
if(editor_mode[upload_target_srl]=='html') return;
|
||||
|
||||
// 포커스
|
||||
if(typeof(target)=="object") target.focus();
|
||||
else editorFocus(target);
|
||||
|
||||
// 실행
|
||||
doc.execCommand(command, false, value);
|
||||
|
||||
// 포커스
|
||||
if(typeof(target)=="object") target.focus();
|
||||
else editorFocus(target);
|
||||
}
|
||||
|
||||
// 폰트를 변경
|
||||
function editorChangeFontName(obj,srl) {
|
||||
var value = obj.options[obj.selectedIndex].value;
|
||||
if(!value) return;
|
||||
editorDo('FontName',value,srl);
|
||||
obj.selectedIndex = 0;
|
||||
}
|
||||
|
||||
function editorChangeFontSize(obj,srl) {
|
||||
var value = obj.options[obj.selectedIndex].value;
|
||||
if(!value) return;
|
||||
editorDo('FontSize',value,srl);
|
||||
obj.selectedIndex = 0;
|
||||
}
|
||||
|
||||
function editorChangeHeader(obj,srl) {
|
||||
var value = obj.options[obj.selectedIndex].value;
|
||||
if(!value) return;
|
||||
value = "<"+value+">";
|
||||
editorDo('formatblock',value,srl);
|
||||
obj.selectedIndex = 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* iframe 세로 크기 조절 드래그 관련
|
||||
**/
|
||||
|
|
@ -708,8 +791,8 @@ function eOptionClick(obj) {
|
|||
}
|
||||
|
||||
// Editor Info Close
|
||||
function closeEditorInfo(upload_target_srl) {
|
||||
xGetElementById('editorInfo_'+upload_target_srl).style.display='none';
|
||||
function closeEditorInfo(editor_sequence) {
|
||||
xGetElementById('editorInfo_'+editor_sequence).style.display='none';
|
||||
var expire = new Date();
|
||||
expire.setTime(expire.getTime()+ (7000 * 24 * 3600000));
|
||||
xSetCookie('EditorInfo', '1', expire);
|
||||
|
|
|
|||
|
|
@ -3,51 +3,40 @@
|
|||
* @version 0.1
|
||||
* @brief 파일 업로드 관련
|
||||
*
|
||||
***********************************************************************************************************************************************
|
||||
*****************************************************************************************************************************
|
||||
* 제로보드XE의 게시물 파일업로드 컴포넌트는 "mmSWFUpload 1.0: Flash upload dialog - http://swfupload.mammon.se/" 를 사용합니다.
|
||||
* - SWFUpload is (c) 2006 Lars Huring and Mammon Media and is released under the MIT License:http://www.opensource.org/licenses/mit-license.php
|
||||
***********************************************************************************************************************************************
|
||||
*****************************************************************************************************************************
|
||||
|
||||
* 감사합니다.
|
||||
**/
|
||||
var uploading_file = false;
|
||||
var uploaded_files = new Array();
|
||||
|
||||
// 업로드를 하기 위한 준비 시작
|
||||
function editor_upload_init(upload_target_srl) {
|
||||
xAddEventListener(window,'load',function() {editor_upload_form_set(upload_target_srl);} );
|
||||
/**
|
||||
* 업로드를 하기 위한 준비 시작
|
||||
* 이 함수는 editor.html 에서 파일 업로드 가능할 경우 호출됨
|
||||
**/
|
||||
// window.load 이벤트일 경우 && 문서 번호가 가상의 번호가 아니면 기존에 저장되어 있을지도 모르는 파일 목록을 가져옴
|
||||
function editor_upload_init(editor_sequence) {
|
||||
xAddEventListener(window,'load',function() { editor_upload_start(editor_sequence);} );
|
||||
}
|
||||
|
||||
// upload_target_srl에 해당하는 form의 action을 iframe으로 변경
|
||||
function editor_upload_form_set(upload_target_srl) {
|
||||
try {
|
||||
document.execCommand('BackgroundImageCache',false,true);
|
||||
} catch(e) { }
|
||||
function editor_upload_get_target_srl(editor_sequence) {
|
||||
return editor_rel_keys[editor_sequence]['primary'].value;
|
||||
}
|
||||
|
||||
// SWFUploader load
|
||||
var uploader_name = "swf_uploader_"+upload_target_srl;
|
||||
var embed_html = "";
|
||||
var flashVars = 'uploadProgressCallback=editor_upload_progress&uploadFileErrorCallback=editor_upload_error_handle&allowedFiletypesDescription='+uploader_setting["allowed_filetypes_description"]+'&autoUpload=true&allowedFiletypes='+uploader_setting["allowed_filetypes"]+'&maximumFilesize='+uploader_setting["allowed_filesize"]+'&uploadQueueCompleteCallback=editor_display_uploaded_file&uploadScript='+escape(request_uri+'?mid='+current_url.getQuery('mid')+'&act=procFileUpload&upload_target_srl='+upload_target_srl+'&PHPSESSID='+xGetCookie(zbxe_session_name));
|
||||
function editor_upload_get_uploader_name(editor_sequence) {
|
||||
return "swf_uploader_"+editor_sequence;
|
||||
|
||||
if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length) {
|
||||
embed_html = '<embed type="application/x-shockwave-flash" src="'+request_uri+'/modules/editor/tpl/images/SWFUpload.swf" width="1" height="1" id="'+uploader_name+'" name="'+uploader_name+'" quality="high" wmode="transparent" menu="false" flashvars="'+flashVars+'" />';
|
||||
} else {
|
||||
embed_html = '<object id="'+uploader_name+'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="1" height="1"><param name="movie" value="'+request_uri+'./modules/editor/tpl/images/SWFUpload.swf" /><param name="bgcolor" value="#000000" /><param name="quality" value="high" /><param name="wmode" value="transparent" /><param name="menu" value="false" /><param name="flashvars" value="'+flashVars+'" /></object>';
|
||||
}
|
||||
}
|
||||
|
||||
if(xIE4Up) {
|
||||
window.document.body.insertAdjacentHTML("afterEnd", "<div style='width:1px;height:1px;position:absolute;top:0px;left:0px'>"+embed_html+"</div>");
|
||||
} else {
|
||||
var dummy = xCreateElement("div");
|
||||
dummy.style.width = "1px";
|
||||
dummy.style.height = "1px";
|
||||
dummy.style.position="absolute";
|
||||
dummy.style.top="0px";
|
||||
dummy.style.left="0px";
|
||||
xInnerHtml(dummy, embed_html);
|
||||
window.document.body.appendChild(dummy);
|
||||
}
|
||||
// 파일 업로드를 위한 기본 준비를 함
|
||||
function editor_upload_start(editor_sequence) {
|
||||
// 캐시 삭제
|
||||
try { document.execCommand('BackgroundImageCache',false,true); } catch(e) { }
|
||||
|
||||
// 임시 iframe을 생성
|
||||
// 임시 iframe을 생성 (공통으로 사용)
|
||||
if(!xGetElementById('tmp_upload_iframe')) {
|
||||
if(xIE4Up) {
|
||||
window.document.body.insertAdjacentHTML("afterEnd", "<iframe id='tmp_upload_iframe' name='tmp_upload_iframe' style='display:none;width:1px;height:1px;position:absolute;top:-10px;left:-10px'></iframe>");
|
||||
|
|
@ -64,41 +53,54 @@ function editor_upload_form_set(upload_target_srl) {
|
|||
}
|
||||
}
|
||||
|
||||
// form의 action 을 변경
|
||||
var field_obj = xGetElementById("uploaded_file_list_"+upload_target_srl);
|
||||
// 첨부파일 목록을 출력하는 select element 구함
|
||||
var field_obj = xGetElementById("uploaded_file_list_"+editor_sequence);
|
||||
if(!field_obj) return;
|
||||
|
||||
var fo_obj = field_obj.parentNode;
|
||||
while(fo_obj.nodeName != 'FORM') { fo_obj = fo_obj.parentNode; }
|
||||
// 에디터를 감싸는 form을 구해 submit target을 임시 iframe으로 변경
|
||||
var fo_obj = editorGetForm(editor_sequence);
|
||||
fo_obj.target = 'tmp_upload_iframe';
|
||||
|
||||
// upload_target_srl에 해당하는 첨부파일 목록을 로드 (procDeleteFile에 file_srl을 보내주지 않으면 삭제시도는 없이 목록만 갱신할 수 있음)
|
||||
var module = "";
|
||||
if(fo_obj["module"]) module = fo_obj.module.value;
|
||||
var mid = "";
|
||||
if(fo_obj["mid"]) mid = fo_obj.mid.value;
|
||||
var document_srl = "";
|
||||
if(fo_obj["document_srl"]) document_srl = fo_obj.document_srl.value;
|
||||
// SWF uploader 생성
|
||||
var uploader_name = editor_upload_get_uploader_name(editor_sequence);
|
||||
var embed_html = "";
|
||||
|
||||
// 기 등록된 파일 표시
|
||||
editor_display_uploaded_file(upload_target_srl);
|
||||
}
|
||||
// 업로드와 관련된 변수 설정 (이 변수들이 그대로 zbxe에 전달됨)
|
||||
var flashVars = ''+
|
||||
'uploadProgressCallback=editor_upload_progress'+
|
||||
'&uploadFileErrorCallback=editor_upload_error_handle'+
|
||||
'&allowedFiletypesDescription='+uploader_setting["allowed_filetypes_description"]+
|
||||
'&autoUpload=true&allowedFiletypes='+uploader_setting["allowed_filetypes"]+
|
||||
'&maximumFilesize='+uploader_setting["allowed_filesize"]+
|
||||
'&uploadQueueCompleteCallback=editor_display_uploaded_file'+
|
||||
'&uploadScript='+escape( request_uri+'?mid='+current_url.getQuery('mid')+
|
||||
'&act=procFileUpload'+
|
||||
'&editor_sequence='+editor_sequence+
|
||||
'&PHPSESSID='+xGetCookie(zbxe_session_name)
|
||||
);
|
||||
|
||||
// upload_target_srl에 등록된 파일 표시
|
||||
var _prev_upload_target_srl = 0;
|
||||
function editor_display_uploaded_file(upload_target_srl) {
|
||||
if(typeof(upload_target_srl)=='undefined'||!upload_target_srl) {
|
||||
if(_prev_upload_target_srl) {
|
||||
upload_target_srl = _prev_upload_target_srl;
|
||||
_prev_upload_target_srl = 0;
|
||||
} else return;
|
||||
// 객체 생성 코드
|
||||
if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length) {
|
||||
embed_html = '<embed type="application/x-shockwave-flash" src="'+request_uri+'/modules/editor/tpl/images/SWFUpload.swf" width="1" height="1" id="'+uploader_name+'" name="'+uploader_name+'" quality="high" wmode="transparent" menu="false" flashvars="'+flashVars+'" />';
|
||||
} else {
|
||||
embed_html = '<object id="'+uploader_name+'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="1" height="1"><param name="movie" value="'+request_uri+'./modules/editor/tpl/images/SWFUpload.swf" /><param name="bgcolor" value="#000000" /><param name="quality" value="high" /><param name="wmode" value="transparent" /><param name="menu" value="false" /><param name="flashvars" value="'+flashVars+'" /></object>';
|
||||
}
|
||||
var url = request_uri + "?act=procFileDelete&upload_target_srl="+upload_target_srl+"&mid="+current_url.getQuery('mid');
|
||||
|
||||
// iframe에 url을 보내버림
|
||||
var iframe_obj = xGetElementById('tmp_upload_iframe');
|
||||
if(!iframe_obj) return;
|
||||
iframe_obj.contentWindow.document.location.href=url;
|
||||
// div dummy 객체를 만들고 SWFUploader 코드를 추가하여 객체 생성
|
||||
var dummy = xCreateElement("div");
|
||||
dummy.style.width = "1px";
|
||||
dummy.style.height = "1px";
|
||||
dummy.style.position="absolute";
|
||||
dummy.style.top="0px";
|
||||
dummy.style.left="0px";
|
||||
window.document.body.appendChild(dummy);
|
||||
xInnerHtml(dummy, embed_html);
|
||||
|
||||
/**
|
||||
* upload_target_srl값이 실제 문서 번호일 경우 이미 등록되 있을지도 모르는 첨부파일 목록을 로드
|
||||
* procDeleteFile에 file_srl을 보내주지 않으면 삭제시도는 없이 목록만 갱신할 수 있음
|
||||
**/
|
||||
editor_display_uploaded_file(editor_sequence);
|
||||
}
|
||||
|
||||
// 파일 업로드 에러 핸들링
|
||||
|
|
@ -122,18 +124,29 @@ function editor_upload_error_handle(errcode,file,msg) {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* 파일 업로드 관련 함수들
|
||||
**/
|
||||
|
||||
// 파일 업로드
|
||||
function editor_upload_file(upload_target_srl) {
|
||||
var swf_uploader = xGetElementById("swf_uploader_"+upload_target_srl);
|
||||
if(!swf_uploader) return;
|
||||
swf_uploader.browse();
|
||||
_prev_upload_target_srl = upload_target_srl;
|
||||
var _prev_editor_sequence; ///< 진행 상태를 표시하기 위해 바로 이전의 에디터 sequence값을 가지고 있음
|
||||
function editor_upload_file(editor_sequence) {
|
||||
// 업로더 객체를 구함
|
||||
var uploader_name = editor_upload_get_uploader_name(editor_sequence);
|
||||
var swf_uploader = xGetElementById(uploader_name);
|
||||
|
||||
try {
|
||||
swf_uploader.browse();
|
||||
_prev_editor_sequence = editor_sequence;
|
||||
} catch(e) {
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// 업로드 진행상태 표시
|
||||
var _progress_start = false;
|
||||
function editor_upload_progress(file, bytesLoaded) {
|
||||
var obj = xGetElementById('uploaded_file_list_'+_prev_upload_target_srl);
|
||||
var obj = xGetElementById('uploaded_file_list_'+_prev_editor_sequence);
|
||||
if(!_progress_start) {
|
||||
while(obj.options.length) {
|
||||
obj.remove(0);
|
||||
|
|
@ -143,7 +156,7 @@ function editor_upload_progress(file, bytesLoaded) {
|
|||
|
||||
var percent = Math.ceil((bytesLoaded / file.size) * 100);
|
||||
var filename = file.name;
|
||||
if(filename.length>15) filename = filename.substr(0,15)+'...';
|
||||
if(filename.length>20) filename = filename.substr(0,20)+'...';
|
||||
|
||||
var text = filename + ' ('+percent+'%)';
|
||||
if(!obj.options.length || obj.options[obj.options.length-1].value != file.id) {
|
||||
|
|
@ -154,34 +167,54 @@ function editor_upload_progress(file, bytesLoaded) {
|
|||
}
|
||||
}
|
||||
|
||||
// 업로드된 파일 목록 비움
|
||||
function editor_upload_clear_list(upload_target_srl) {
|
||||
var obj = xGetElementById('uploaded_file_list_'+upload_target_srl);
|
||||
// upload_target_srl 에 등록된 파일 표시
|
||||
function editor_display_uploaded_file(editor_sequence) {
|
||||
if(typeof(editor_sequence)=='undefined'||!editor_sequence) editor_sequence = _prev_editor_sequence;
|
||||
if(!editor_sequence) return;
|
||||
|
||||
// upload_target_srl이 없으면 무시
|
||||
var upload_target_srl = editor_rel_keys[editor_sequence]['primary'].value;
|
||||
|
||||
// 이미 등록된 전체 파일 목록을 구해옴
|
||||
var url = request_uri + "?act=procFileDelete&editor_sequence="+editor_sequence+"&mid="+current_url.getQuery('mid');
|
||||
|
||||
// iframe에 url을 보내버림
|
||||
var iframe_obj = xGetElementById('tmp_upload_iframe');
|
||||
if(!iframe_obj) return;
|
||||
iframe_obj.contentWindow.document.location.href=url;
|
||||
}
|
||||
|
||||
|
||||
// 업로드된 파일 목록 비움 (단순히 select 객체의 내용을 지우고 미리보기를 제거함)
|
||||
function editor_upload_clear_list(editor_sequence, upload_target_srl) {
|
||||
if(!upload_target_srl || upload_target_srl<1) return;
|
||||
editor_rel_keys[editor_sequence]['primary'].value = upload_target_srl;
|
||||
|
||||
var obj = xGetElementById('uploaded_file_list_'+editor_sequence);
|
||||
while(obj.options.length) {
|
||||
obj.remove(0);
|
||||
}
|
||||
var preview_obj = xGetElementById('preview_uploaded_'+upload_target_srl);
|
||||
var preview_obj = xGetElementById('preview_uploaded_'+editor_sequence);
|
||||
xInnerHtml(preview_obj,'')
|
||||
}
|
||||
|
||||
// 업로드된 파일 정보를 목록에 추가
|
||||
function editor_insert_uploaded_file(upload_target_srl, file_srl, filename, file_size, disp_file_size, uploaded_filename, sid) {
|
||||
var obj = xGetElementById('uploaded_file_list_'+upload_target_srl);
|
||||
if(filename.length>15) filename = filename.substr(0,15)+'...';
|
||||
var text = filename+' ('+disp_file_size+')';
|
||||
// 업로드된 파일 정보를 select 목록에 추가
|
||||
function editor_insert_uploaded_file(editor_sequence, file_srl, filename, file_size, disp_file_size, uploaded_filename, sid) {
|
||||
var obj = xGetElementById('uploaded_file_list_'+editor_sequence);
|
||||
var text = disp_file_size+' - '+filename;
|
||||
var opt_obj = new Option(text, file_srl, true, true);
|
||||
obj.options[obj.options.length] = opt_obj;
|
||||
|
||||
var file_obj = {file_srl:file_srl, filename:filename, file_size:file_size, uploaded_filename:uploaded_filename, sid:sid}
|
||||
uploaded_files[file_srl] = file_obj;
|
||||
|
||||
editor_preview(obj, upload_target_srl);
|
||||
editor_preview(obj, editor_sequence);
|
||||
_progress_start = false;
|
||||
}
|
||||
|
||||
// 파일 목록창에서 클릭 되었을 경우 미리 보기
|
||||
function editor_preview(sel_obj, upload_target_srl) {
|
||||
var preview_obj = xGetElementById('preview_uploaded_'+upload_target_srl);
|
||||
function editor_preview(sel_obj, editor_sequence) {
|
||||
var preview_obj = xGetElementById('preview_uploaded_'+editor_sequence);
|
||||
if(!sel_obj.options.length) {
|
||||
xInnerHtml(preview_obj, '');
|
||||
return;
|
||||
|
|
@ -220,8 +253,8 @@ function editor_preview(sel_obj, upload_target_srl) {
|
|||
}
|
||||
|
||||
// 업로드된 파일 삭제
|
||||
function editor_remove_file(upload_target_srl) {
|
||||
var obj = xGetElementById('uploaded_file_list_'+upload_target_srl);
|
||||
function editor_remove_file(editor_sequence) {
|
||||
var obj = xGetElementById('uploaded_file_list_'+editor_sequence);
|
||||
if(obj.options.length<1) return;
|
||||
|
||||
// 삭제하려는 파일의 정보를 챙김;;
|
||||
|
|
@ -233,6 +266,10 @@ function editor_remove_file(upload_target_srl) {
|
|||
var iframe_obj = xGetElementById('tmp_upload_iframe');
|
||||
if(!iframe_obj) return;
|
||||
|
||||
// upload_target_srl이 가상 번호일 경우 아무 동작 하지 않음
|
||||
var upload_target_srl = editor_rel_keys[editor_sequence]['primary'].value;
|
||||
if(upload_target_srl<1) return;
|
||||
|
||||
for(var i=0;i<obj.options.length;i++) {
|
||||
var sel_obj = obj.options[i];
|
||||
if(!sel_obj.selected) continue;
|
||||
|
|
@ -240,24 +277,25 @@ function editor_remove_file(upload_target_srl) {
|
|||
var file_srl = sel_obj.value;
|
||||
if(!file_srl) continue;
|
||||
|
||||
var url = request_uri+"/?act=procFileDelete&upload_target_srl="+upload_target_srl+"&file_srl="+file_srl+"&mid="+current_url.getQuery('mid');
|
||||
var url = request_uri+"/?act=procFileDelete&editor_sequence="+editor_sequence+"&upload_target_srl="+upload_target_srl+"&file_srl="+file_srl+"&mid="+current_url.getQuery('mid');
|
||||
|
||||
iframe_obj.contentWindow.document.location.href=url;
|
||||
|
||||
xSleep(100);
|
||||
}
|
||||
|
||||
var preview_obj = xGetElementById('preview_uploaded_'+upload_target_srl);
|
||||
var preview_obj = xGetElementById('preview_uploaded_'+editor_sequence);
|
||||
xInnerHtml(preview_obj, "");
|
||||
}
|
||||
|
||||
// 업로드 목록의 선택된 파일을 내용에 추가
|
||||
function editor_insert_file(upload_target_srl) {
|
||||
if(editor_mode[upload_target_srl]=='html') return;
|
||||
var obj = xGetElementById('uploaded_file_list_'+upload_target_srl);
|
||||
function editor_insert_file(editor_sequence) {
|
||||
if(editor_mode[editor_sequence]=='html') return;
|
||||
var obj = xGetElementById('uploaded_file_list_'+editor_sequence);
|
||||
if(obj.options.length<1) return;
|
||||
|
||||
var iframe_obj = editorGetIFrame(upload_target_srl);
|
||||
editorFocus(upload_target_srl);
|
||||
var iframe_obj = editorGetIFrame(editor_sequence);
|
||||
editorFocus(editor_sequence);
|
||||
|
||||
var fo_obj = obj;
|
||||
while(fo_obj.nodeName != 'FORM') { fo_obj = fo_obj.parentNode; }
|
||||
|
|
|
|||
|
|
@ -13,16 +13,24 @@
|
|||
function init() {
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief 에디터에서 첨부파일 업로드
|
||||
**/
|
||||
function procFileUpload() {
|
||||
// 기본적으로 필요한 변수 설정
|
||||
$upload_target_srl = Context::get('upload_target_srl');
|
||||
$editor_sequence = Context::get('editor_sequence');
|
||||
$module_srl = $this->module_srl;
|
||||
|
||||
// 업로드 권한이 없거나 정보가 없을시 종료
|
||||
if(!$_SESSION['upload_enable'][$upload_target_srl]) exit();
|
||||
if(!$_SESSION['upload_info'][$editor_sequence]->enabled) exit();
|
||||
|
||||
// upload_target_srl 구함
|
||||
$upload_target_srl = $_SESSION['upload_info'][$editor_sequence]->upload_target_srl;
|
||||
if(!$upload_target_srl) {
|
||||
$upload_target_srl = getNextSequence();
|
||||
$this->setUploadInfo($editor_sequence, $upload_target_srl);
|
||||
}
|
||||
|
||||
$file_info = Context::get('Filedata');
|
||||
|
||||
|
|
@ -38,23 +46,27 @@
|
|||
**/
|
||||
function procFileDelete() {
|
||||
// 기본적으로 필요한 변수인 upload_target_srl, module_srl을 설정
|
||||
$upload_target_srl = Context::get('upload_target_srl');
|
||||
$editor_sequence = Context::get('editor_sequence');
|
||||
$file_srl = Context::get('file_srl');
|
||||
|
||||
// 업로드 권한이 없거나 정보가 없을시 종료
|
||||
if(!$_SESSION['upload_enable'][$upload_target_srl]) exit();
|
||||
if(!$_SESSION['upload_info'][$editor_sequence]->enabled) exit();
|
||||
|
||||
$upload_target_srl = $_SESSION['upload_info'][$editor_sequence]->upload_target_srl;
|
||||
if(!$upload_target_srl) return;
|
||||
|
||||
if($file_srl) $output = $this->deleteFile($file_srl);
|
||||
|
||||
// 첨부파일의 목록을 java script로 출력
|
||||
$this->printUploadedFileList($upload_target_srl);
|
||||
$this->printUploadedFileList($editor_sequence, $upload_target_srl);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 업로드 가능하다고 세팅
|
||||
**/
|
||||
function setUploadEnable($upload_target_srl) {
|
||||
$_SESSION['upload_enable'][$upload_target_srl] = true;
|
||||
function setUploadInfo($editor_sequence, $upload_target_srl=0) {
|
||||
$_SESSION['upload_info'][$editor_sequence]->enabled = true;
|
||||
$_SESSION['upload_info'][$editor_sequence]->upload_target_srl = $upload_target_srl;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
@ -118,6 +130,7 @@
|
|||
$output->add('file_srl', $args->file_srl);
|
||||
$output->add('file_size', $args->file_size);
|
||||
$output->add('source_filename', $args->source_filename);
|
||||
$output->add('upload_target_srl', $upload_target_srl);
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
|
@ -134,6 +147,8 @@
|
|||
* @brief 첨부파일 삭제
|
||||
**/
|
||||
function deleteFile($file_srl) {
|
||||
if(!$file_srl) return;
|
||||
|
||||
// 파일 정보를 가져옴
|
||||
$args->file_srl = $file_srl;
|
||||
$output = executeQuery('file.getFile', $args);
|
||||
|
|
@ -149,7 +164,7 @@
|
|||
if(!$output->toBool()) return $output;
|
||||
|
||||
// 삭제 성공하면 파일 삭제
|
||||
unlink($uploaded_filename);
|
||||
@unlink($uploaded_filename);
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
|
@ -211,6 +226,9 @@
|
|||
$new_file = $path.md5(crypt(rand(1000000,900000), rand(0,100)));
|
||||
}
|
||||
|
||||
// 이전 대상이 동일하면 그냥 패스
|
||||
if($old_file == $new_file) continue;
|
||||
|
||||
// 디렉토리 생성
|
||||
FileHandler::makeDir($path);
|
||||
|
||||
|
|
@ -230,7 +248,7 @@
|
|||
/**
|
||||
* @brief upload_target_srl을 키로 하는 첨부파일을 찾아서 java script 코드로 return
|
||||
**/
|
||||
function printUploadedFileList($upload_target_srl) {
|
||||
function printUploadedFileList($editor_sequence, $upload_target_srl) {
|
||||
// file의 Model객체 생성
|
||||
$oFileModel = &getModel('file');
|
||||
|
||||
|
|
@ -238,17 +256,6 @@
|
|||
$tmp_file_list = $oFileModel->getFiles($upload_target_srl);
|
||||
$file_count = count($tmp_file_list);
|
||||
|
||||
$logged_info = Context::get('logged_info');
|
||||
if($logged_info->is_admin == 'Y') {
|
||||
//$file_config->allowed_filesize = 1024;
|
||||
//$file_config->allowed_attach_size = 1024;
|
||||
$file_config->allowed_filesize = ini_get('upload_max_filesize');
|
||||
$file_config->allowed_attach_size = ini_get('upload_max_filesize');
|
||||
$file_config->allowed_filetypes = '*.*';
|
||||
} else {
|
||||
$file_config = $oFileModel->getFileConfig();
|
||||
}
|
||||
|
||||
// 루프를 돌면서 $buff 변수에 java script 코드를 생성
|
||||
$buff = "";
|
||||
for($i=0;$i<$file_count;$i++) {
|
||||
|
|
@ -260,21 +267,14 @@
|
|||
}
|
||||
|
||||
// 업로드 상태 표시 작성
|
||||
$upload_status = sprintf(
|
||||
'%s : %s/ %s<br /> %s : %s (%s : %s)',
|
||||
Context::getLang('allowed_attach_size'),
|
||||
FileHandler::filesize($attached_size),
|
||||
FileHandler::filesize($file_config->allowed_attach_size*1024*1024),
|
||||
Context::getLang('allowed_filesize'),
|
||||
FileHandler::filesize($file_config->allowed_filesize*1024*1024),
|
||||
Context::getLang('allowed_filetypes'),
|
||||
$file_config->allowed_filetypes
|
||||
);
|
||||
$upload_status = $oFileModel->getUploadStatus($attached_size);
|
||||
|
||||
// 필요한 정보들 세팅
|
||||
Context::set('upload_target_srl', $upload_target_srl);
|
||||
Context::set('file_list', $file_list);
|
||||
Context::set('upload_status', $upload_status);
|
||||
|
||||
// 업로드 현황을 브라우저로 알리기 위한 javascript 코드 출력하는 템플릿 호출
|
||||
$this->setTemplatePath($this->module_path.'tpl');
|
||||
$this->setTemplateFile('print_uploaded_file_list');
|
||||
}
|
||||
|
|
|
|||
|
|
@ -79,5 +79,42 @@
|
|||
|
||||
return $file_list;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 첨부파일에 대한 설정을 return (관리자/비관리자 자동 구분)
|
||||
**/
|
||||
function getUploadConfig() {
|
||||
$logged_info = Context::get('logged_info');
|
||||
if($logged_info->is_admin == 'Y') {
|
||||
//$file_config->allowed_filesize = 1024;
|
||||
//$file_config->allowed_attach_size = 1024;
|
||||
$file_config->allowed_filesize = ini_get('upload_max_filesize');
|
||||
$file_config->allowed_attach_size = ini_get('upload_max_filesize');
|
||||
$file_config->allowed_filetypes = '*.*';
|
||||
} else {
|
||||
$file_config = $this->getFileConfig();
|
||||
}
|
||||
return $file_config;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 파일 업로드를 위한 관리자/비관리자에 따른 안내문구 return
|
||||
**/
|
||||
function getUploadStatus($attached_size = 0) {
|
||||
$file_config = $this->getUploadConfig();
|
||||
|
||||
// 업로드 상태 표시 작성
|
||||
$upload_status = sprintf(
|
||||
'%s : %s/ %s<br /> %s : %s (%s : %s)',
|
||||
Context::getLang('allowed_attach_size'),
|
||||
FileHandler::filesize($attached_size),
|
||||
FileHandler::filesize($file_config->allowed_attach_size*1024*1024),
|
||||
Context::getLang('allowed_filesize'),
|
||||
FileHandler::filesize($file_config->allowed_filesize*1024*1024),
|
||||
Context::getLang('allowed_filetypes'),
|
||||
$file_config->allowed_filetypes
|
||||
);
|
||||
return $upload_status;
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -1,9 +1,9 @@
|
|||
<script type="text/javascript">
|
||||
parent.editor_upload_clear_list("{$upload_target_srl}");
|
||||
parent.editor_upload_clear_list("{$editor_sequence}","{$upload_target_srl}");
|
||||
|
||||
<!--@foreach($file_list as $key => $file_info)-->
|
||||
parent.editor_insert_uploaded_file({$upload_target_srl}, {$file_info->file_srl}, "{$file_info->source_filename}", "{$file_info->file_size}", "{FileHandler::filesize($file_info->file_size)}", "{$file_info->uploaded_filename}", "{$file_info->sid}");
|
||||
parent.editor_insert_uploaded_file({$editor_sequence}, {$file_info->file_srl}, "{$file_info->source_filename}", "{$file_info->file_size}", "{FileHandler::filesize($file_info->file_size)}", "{$file_info->uploaded_filename}", "{$file_info->sid}");
|
||||
<!--@end-->
|
||||
|
||||
parent.xInnerHtml("uploader_status_{$upload_target_srl}", '{$upload_status}');
|
||||
parent.xInnerHtml("uploader_status_{$editor_sequence}", '{$upload_status}');
|
||||
</script>
|
||||
|
|
|
|||
|
|
@ -83,16 +83,15 @@
|
|||
**/
|
||||
function procMemberAdminInsertConfig() {
|
||||
// 기본 정보를 받음
|
||||
$args = Context::gets('skin','colorset','enable_openid','enable_join','limit_day','redirect_url','content','image_name','image_mark', 'image_name_max_width', 'image_name_max_height','image_mark_max_width','image_mark_max_height');
|
||||
$args = Context::gets('skin','colorset','enable_openid','enable_join','limit_day','redirect_url','agreement','image_name','image_mark', 'image_name_max_width', 'image_name_max_height','image_mark_max_width','image_mark_max_height');
|
||||
if(!$args->skin) $args->skin = "default";
|
||||
if(!$args->colorset) $args->colorset = "white";
|
||||
if($args->enable_join!='Y') $args->enable_join = 'N';
|
||||
if($args->enable_openid!='Y') $args->enable_openid= 'N';
|
||||
if($args->image_name!='Y') $args->image_name = 'N';
|
||||
if($args->image_mark!='Y') $args->image_mark = 'N';
|
||||
if(!trim(strip_tags($args->agreement))) $args->agreement = null;
|
||||
$args->limit_day = (int)$args->limit_day;
|
||||
$args->agreement = $args->content;
|
||||
unset($args->content);
|
||||
|
||||
// module Controller 객체 생성하여 입력
|
||||
$oModuleController = &getController('module');
|
||||
|
|
|
|||
|
|
@ -73,6 +73,8 @@
|
|||
|
||||
// 에디터를 받음
|
||||
$oEditorModel = &getModel('editor');
|
||||
$option->primary_key_name = 'temp_srl';
|
||||
$option->content_key_name = 'agreement';
|
||||
$option->allow_fileupload = false;
|
||||
$option->enable_autosave = false;
|
||||
$option->enable_default_component = true;
|
||||
|
|
@ -112,6 +114,8 @@
|
|||
// 에디터 모듈의 getEditor를 호출하여 서명용으로 세팅
|
||||
if($this->member_info->member_srl) {
|
||||
$oEditorModel = &getModel('editor');
|
||||
$option->primary_key_name = 'member_srl';
|
||||
$option->content_key_name = 'signature';
|
||||
$option->allow_fileupload = false;
|
||||
$option->enable_autosave = false;
|
||||
$option->enable_default_component = true;
|
||||
|
|
|
|||
|
|
@ -112,6 +112,8 @@
|
|||
// 에디터 모듈의 getEditor를 호출하여 서명용으로 세팅
|
||||
if($member_info->member_srl) {
|
||||
$oEditorModel = &getModel('editor');
|
||||
$option->primary_key_name = 'member_srl';
|
||||
$option->content_key_name = 'signature';
|
||||
$option->allow_fileupload = false;
|
||||
$option->enable_autosave = false;
|
||||
$option->enable_default_component = true;
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@
|
|||
<param name="allow_mailing" target="allow_mailing" />
|
||||
<param name="allow_message" target="allow_message" />
|
||||
<param name="email_address" target="email_address" />
|
||||
<param name="signature" target="content" />
|
||||
<param name="signature" target="signature" />
|
||||
</parameter>
|
||||
<response callback_func="completeModify">
|
||||
<tag name="error" />
|
||||
|
|
|
|||
|
|
@ -15,9 +15,8 @@
|
|||
<form id="fo_insert_member" action="./" method="post" onsubmit="return procFilter(this, modify_info)" <!--@if($member_config->image_name=='Y' || $member_config->image_mark=='Y')-->enctype="multipart/form-data"<!--@end-->>
|
||||
<input type="hidden" name="mid" value="{$mid}" />
|
||||
<input type="hidden" name="act" value="" />
|
||||
<input type="hidden" name="document_srl" value="{$document_srl}" />
|
||||
<input type="hidden" name="member_srl" value="{$member_info->member_srl}" />
|
||||
<input type="hidden" name="content" value="{htmlspecialchars($member_info->signature)}" />
|
||||
<input type="hidden" name="signature" value="{htmlspecialchars($member_info->signature)}" />
|
||||
<input type="hidden" name="page" value="{$page}" />
|
||||
|
||||
<table cellspacing="0" class="joinTable <!--@if($extend_form_list)-->typeA<!--@else-->typeB<!--@end-->" >
|
||||
|
|
|
|||
|
|
@ -14,7 +14,7 @@
|
|||
<param name="allow_mailing" target="allow_mailing" />
|
||||
<param name="allow_message" target="allow_message" />
|
||||
<param name="email_address" target="email_address" />
|
||||
<param name="signature" target="content" />
|
||||
<param name="signature" target="signature" />
|
||||
</parameter>
|
||||
<response callback_func="completeModify">
|
||||
<tag name="error" />
|
||||
|
|
|
|||
|
|
@ -15,9 +15,8 @@
|
|||
<form id="fo_insert_member" action="./" method="post" onsubmit="return procFilter(this, modify_info)" <!--@if($member_config->image_name=='Y' || $member_config->image_mark=='Y')-->enctype="multipart/form-data"<!--@end-->>
|
||||
<input type="hidden" name="mid" value="{$mid}" />
|
||||
<input type="hidden" name="act" value="" />
|
||||
<input type="hidden" name="document_srl" value="{$document_srl}" />
|
||||
<input type="hidden" name="member_srl" value="{$member_info->member_srl}" />
|
||||
<input type="hidden" name="content" value="{htmlspecialchars($member_info->signature)}" />
|
||||
<input type="hidden" name="signature" value="{htmlspecialchars($member_info->signature)}" />
|
||||
<input type="hidden" name="page" value="{$page}" />
|
||||
|
||||
<table cellspacing="0" class="memberInfoTable">
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@
|
|||
<param name="is_admin" target="is_admin" />
|
||||
<param name="description" target="description" />
|
||||
<param name="group_srl_list" target="group_srl_list" />
|
||||
<param name="signature" target="content" />
|
||||
<param name="signature" target="signature" />
|
||||
</parameter>
|
||||
<response callback_func="completeInsert">
|
||||
<tag name="error" />
|
||||
|
|
|
|||
|
|
@ -4,7 +4,7 @@
|
|||
<form id="fo_insert_member" action="./" method="get" onsubmit="return procFilter(this, insert)">
|
||||
<input type="hidden" name="page" value="{$page}" />
|
||||
<input type="hidden" name="member_srl" value="{$member_info->member_srl}" />
|
||||
<input type="hidden" name="content" value="{htmlspecialchars($member_info->signature)}" />
|
||||
<input type="hidden" name="signature" value="{htmlspecialchars($member_info->signature)}" />
|
||||
<!--@if($member_info->member_srl)-->
|
||||
<input type="hidden" name="user_id" value="{htmlspecialchars($member_info->user_id)}" />
|
||||
<!--@end-->
|
||||
|
|
|
|||
|
|
@ -3,7 +3,8 @@
|
|||
<!--#include("header.html")-->
|
||||
|
||||
<form action="./" method="get" onsubmit="return procFilter(this, insert_config)">
|
||||
<input type="hidden" name="content" value="{htmlspecialchars($config->agreement)}" />
|
||||
<input type="hidden" name="temp_srl" value="" />
|
||||
<input type="hidden" name="agreement" value="{htmlspecialchars($config->agreement)}" />
|
||||
|
||||
<table cellspacing="0" class="tableType2 gap1">
|
||||
<col width="150" />
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue