mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-05 09:41:40 +09:00
git-svn-id: http://xe-core.googlecode.com/svn/trunk@505 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
e470227071
commit
adb02c1c24
11 changed files with 124 additions and 8 deletions
12
classes/editor/EditorHandler.class.php
Normal file
12
classes/editor/EditorHandler.class.php
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
<?php
|
||||
/**
|
||||
* @class EditorHandler
|
||||
* @author zero (zero@nzeo.com)
|
||||
* @brief addon을 호출하여 실행
|
||||
**/
|
||||
|
||||
class EditorHandler extends Object {
|
||||
|
||||
}
|
||||
|
||||
?>
|
||||
|
|
@ -3,7 +3,6 @@
|
|||
* @class PluginHandler
|
||||
* @author zero (zero@nzeo.com)
|
||||
* @brief addon을 호출하여 실행
|
||||
* @todo 미구현
|
||||
**/
|
||||
|
||||
class PluginHandler {
|
||||
|
|
|
|||
|
|
@ -20,6 +20,8 @@ function exec_xml(module, act, params, callback_func, response_tags, callback_fu
|
|||
|
||||
var waiting_obj = document.getElementById("waitingforserverresponse");
|
||||
waiting_obj.style.visibility = "visible";
|
||||
xTop(waiting_obj, xScrollTop()+20);
|
||||
xLeft(waiting_obj, xScrollLeft()+20);
|
||||
oXml.request(xml_response_filter, oXml, callback_func, response_tags, callback_func_arg, fo_obj);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -49,6 +49,7 @@
|
|||
require_once("./classes/file/FileHandler.class.php");
|
||||
require_once("./classes/object/Object.class.php");
|
||||
require_once("./classes/plugin/PluginHandler.class.php");
|
||||
require_once("./classes/editor/EditorHandler.class.php");
|
||||
require_once("./classes/module/ModuleObject.class.php");
|
||||
require_once("./classes/module/ModuleHandler.class.php");
|
||||
require_once("./classes/display/DisplayHandler.class.php");
|
||||
|
|
|
|||
43
modules/editor/components/urllink/urllink.class.php
Normal file
43
modules/editor/components/urllink/urllink.class.php
Normal file
|
|
@ -0,0 +1,43 @@
|
|||
<?php
|
||||
/**
|
||||
* @class urllink
|
||||
* @author zero (zero@nzeo.com)
|
||||
* @brief 에디터에서 url링크하는 기능 제공. 단순 팝업.
|
||||
**/
|
||||
|
||||
class urllink extends EditorHandler {
|
||||
|
||||
// upload_target_srl 는 에디터에서 필수로 달고 다녀야 함....
|
||||
var $upload_target_srl = 0;
|
||||
|
||||
/**
|
||||
* @brief upload_target_srl 설정;
|
||||
**/
|
||||
function urllink($upload_target_srl) {
|
||||
$this->upload_target_srl = $upload_target_srl;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 에디터에서 처음 요청을 받을 경우 실행이 되는 부분이다.
|
||||
* execute의 경우 2가지 경우가 생긴다.
|
||||
* 직접 에디터 아래의 component area로 삽입할 html 코드를 만드는 것과 popup 윈도우를 띄우는 것인데
|
||||
* popup윈도우를 띄울 경우는 getPopupContent() 이라는 method가 실행이 되니 구현하여 놓아야 한다
|
||||
**/
|
||||
function execute() {
|
||||
|
||||
$url = sprintf('./?module=editor&act=dispPopup&target_srl=%s&component=urllink', $this->upload_target_srl);
|
||||
|
||||
$this->add('tpl', '');
|
||||
$this->add('open_window', 'Y');
|
||||
$this->add('popup_url', $url);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief popup window요청시 다시 call이 될 method. popup window에 출력할 내용을 추가하면 된다
|
||||
**/
|
||||
function getPopupContent() {
|
||||
return "haha";
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
|
|
@ -3,5 +3,6 @@
|
|||
<grants />
|
||||
<actions>
|
||||
<action name="dispComponent" type="view" standalone="true" />
|
||||
<action name="dispPopup" type="view" standalone="true" />
|
||||
</actions>
|
||||
</module>
|
||||
|
|
|
|||
|
|
@ -27,5 +27,21 @@
|
|||
function moduleUpdate() {
|
||||
return new Object();
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief component의 객체 생성
|
||||
**/
|
||||
function getComponentObject($component, $upload_target_srl) {
|
||||
// 해당 컴포넌트의 객체를 생성해서 실행
|
||||
$class_file = sprintf('%scomponents/%s/%s.class.php', $this->module_path, $component, $component);
|
||||
if(!file_exists($class_file)) return new Object(-1, sprintf(Context::getLang('msg_component_is_not_founded'), $component));
|
||||
|
||||
require_once($class_file);
|
||||
$eval_str = sprintf('$oComponent = new %s("%s");', $component, $upload_target_srl);
|
||||
@eval($eval_str);
|
||||
if(!$oComponent) return new Object(-1, sprintf(Context::getLang('msg_component_is_not_founded'), $component));
|
||||
|
||||
return $oComponent;
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -38,20 +38,49 @@
|
|||
}
|
||||
|
||||
/**
|
||||
* @brief 팝업 출력 출력
|
||||
* @brief 컴포넌트 실행하여 결과 return
|
||||
**/
|
||||
function dispComponent() {
|
||||
$component = Context::get('compile');
|
||||
// 변수 정리
|
||||
$component = Context::get('component');
|
||||
$upload_target_srl = Context::get('upload_target_srl');
|
||||
|
||||
$open_window = 'Y';
|
||||
$popup_url = "http://www.nzeo.com";
|
||||
// component 객체를 받음
|
||||
$oComponent = &$this->getComponentObject($component, $upload_target_srl);
|
||||
if(!$oComponent->toBool()) return $oComponent;
|
||||
|
||||
// 컴포넌트 실행
|
||||
$oComponent->execute();
|
||||
|
||||
$this->add('component', $component);
|
||||
$this->add('upload_target_srl', $upload_target_srl);
|
||||
$this->add('open_window', $open_window);
|
||||
$this->add('popup_url', $popup_url);
|
||||
$this->add('tpl', $oComponent->get('tpl'));
|
||||
$this->add('open_window', $oComponent->get('open_window'));
|
||||
$this->add('popup_url', $oComponent->get('popup_url'));
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 컴포넌트의 팝업 출력을 요청을 받는 action
|
||||
**/
|
||||
function dispPopup() {
|
||||
// 변수 정리
|
||||
$component = Context::get('component');
|
||||
$upload_target_srl = Context::get('upload_target_srl');
|
||||
|
||||
// component 객체를 받음
|
||||
$oComponent = &$this->getComponentObject($component, $upload_target_srl);
|
||||
if(!$oComponent->toBool()) return $oComponent;
|
||||
|
||||
// 컴포넌트의 popup url을 출력하는 method실행후 결과를 받음
|
||||
$popup_content = $oComponent->getPopupContent();
|
||||
Context::set('popup_content', $popup_content);
|
||||
|
||||
// 레이아웃을 popup_layout으로 설정
|
||||
$this->setLayoutFile('popup_layout');
|
||||
|
||||
// 템플릿 지정
|
||||
$this->setTemplatePath($this->module_path.'tpl');
|
||||
$this->setTemplateFile('popup');
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
|
|
|||
9
modules/editor/lang/ko.lang.php
Normal file
9
modules/editor/lang/ko.lang.php
Normal file
|
|
@ -0,0 +1,9 @@
|
|||
<?php
|
||||
/**
|
||||
* @file modules/editor/lang/ko.lang.php
|
||||
* @author zero <zero@nzeo.com>
|
||||
* @brief 위지윅에디터(editor) 모듈의 기본 언어팩
|
||||
**/
|
||||
|
||||
$lang->msg_component_is_not_founded = '%s 에디터 컴포넌트를 찾을 수 없습니다';
|
||||
?>
|
||||
|
|
@ -76,14 +76,17 @@
|
|||
<input type="hidden" name="act" value="procUploadFile" />
|
||||
|
||||
<div class="editor_uploader_box">
|
||||
|
||||
<!-- 파일 업로드 영역 -->
|
||||
<div class="editor_uploader">
|
||||
<select id='uploaded_file_list_{$upload_target_srl}' size='9' class="uploaded_file_list" onclick="editor_preview(this, '{$upload_target_srl}')"></select><br />
|
||||
<input type="file" name="file" onchange="editor_file_upload(this, '{$upload_target_srl}')" value="{$lang->edit->upload}" /><br />
|
||||
<input type="button" value="{$lang->edit->delete_selected}" onclick="editor_remove_file('{$upload_target_srl}');return false;" />
|
||||
<input type="button" value="{$lang->edit->link_selected}" onclick="editor_insert_file('{$upload_target_srl}');return false;" />
|
||||
</div>
|
||||
<div id="editor_component_area_{$upload_target_srl}" class="editor_component">
|
||||
|
||||
<!-- 컴포넌트 노출 영역 -->
|
||||
<div id="editor_component_area_{$upload_target_srl}" class="editor_component">
|
||||
<div id="uploaded_file_preview_box_{$upload_target_srl}" class="uploaded_file_preview_box"></div>
|
||||
<div>
|
||||
<div class="editor_align_icon">
|
||||
|
|
|
|||
1
modules/editor/tpl/popup.html
Normal file
1
modules/editor/tpl/popup.html
Normal file
|
|
@ -0,0 +1 @@
|
|||
{$popup_content}
|
||||
Loading…
Add table
Add a link
Reference in a new issue