mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-09 19:51:42 +09:00
블로그 모듈의 기본 스킨들에서 댓글의 에디터도 위지윅 에디터로 대체하였음.
기본 board모듈의 스킨은 filter/insert.xml에서 document_srl을 제거해야 함.
git-svn-id: http://xe-core.googlecode.com/svn/sandbox@2572 201d5d3c-b55e-5fd7-737f-ddc643e51545
90 lines
2.9 KiB
PHP
90 lines
2.9 KiB
PHP
<?php
|
|
/**
|
|
* @class editor
|
|
* @author zero (zero@nzeo.com)
|
|
* @brief editor 모듈의 controller class
|
|
**/
|
|
|
|
class editorController extends editor {
|
|
|
|
/**
|
|
* @brief 초기화
|
|
**/
|
|
function init() {
|
|
}
|
|
|
|
/**
|
|
* @brief 자동 저장
|
|
**/
|
|
function procEditorSaveDoc() {
|
|
|
|
$this->deleteSavedDoc();
|
|
|
|
$args->document_srl = Context::get('document_srl');
|
|
$args->content = Context::get('content');
|
|
$args->title = Context::get('title');
|
|
|
|
if(Context::get('is_logged')) {
|
|
$logged_info = Context::get('logged_info');
|
|
$args->member_srl = $logged_info->member_srl;
|
|
} else {
|
|
$args->ipaddress = $_SERVER['REMOTE_ADDR'];
|
|
}
|
|
|
|
// 저장
|
|
$output = executeQuery('editor.insertSavedDoc', $args);
|
|
$this->setMessage('msg_auto_saved');
|
|
}
|
|
|
|
/**
|
|
* @brief 자동저장된 문서 삭제
|
|
**/
|
|
function procEditorRemoveSavedDoc() {
|
|
$oEditorController = &getController('editor');
|
|
$oEditorController->deleteSavedDoc();
|
|
}
|
|
|
|
/**
|
|
* @brief 컴포넌트에서 ajax요청시 해당 컴포넌트의 method를 실행
|
|
**/
|
|
function procEditorCall() {
|
|
$component = Context::get('component');
|
|
$method = Context::get('method');
|
|
if(!$component) return new Object(-1, sprintf(Context::getLang('msg_component_is_not_founded'), $component));
|
|
|
|
$oEditorModel = &getModel('editor');
|
|
$oComponent = &$oEditorModel->getComponentObject($component);
|
|
if(!$oComponent->toBool()) return $oComponent;
|
|
|
|
if(!method_exists($oComponent, $method)) return new Object(-1, sprintf(Context::getLang('msg_component_is_not_founded'), $component));
|
|
|
|
//$output = call_user_method($method, $oComponent);
|
|
$output = call_user_func(array($oComponent, $method));
|
|
if((is_a($output, 'Object') || is_subclass_of($output, 'Object')) && !$output->toBool()) return $output;
|
|
|
|
$this->setError($oComponent->getError());
|
|
$this->setMessage($oComponent->getMessage());
|
|
|
|
$vars = $oComponent->getVariables();
|
|
if(count($vars)) {
|
|
foreach($vars as $key=>$val) $this->add($key, $val);
|
|
}
|
|
}
|
|
|
|
/**
|
|
* @brief 자동 저장된 글을 삭제
|
|
* 현재 접속한 사용자를 기준
|
|
**/
|
|
function deleteSavedDoc() {
|
|
if(Context::get('is_logged')) {
|
|
$logged_info = Context::get('logged_info');
|
|
$args->member_srl = $logged_info->member_srl;
|
|
} else {
|
|
$args->ipaddress = $_SERVER['REMOTE_ADDR'];
|
|
}
|
|
|
|
// 일단 이전 저장본 삭제
|
|
executeQuery('editor.deleteSavedDoc', $args);
|
|
}
|
|
}
|
|
?>
|