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

This commit is contained in:
zero 2007-03-16 08:36:47 +00:00
parent adb02c1c24
commit f7d06aa737
6 changed files with 65 additions and 82 deletions

View file

@ -0,0 +1,8 @@
<?php
/**
* @file /modules/editor/components/urllink/lang/ko.lang.php
* @author zero <zero@nzeo.com>
* @brief 위지윅에디터(editor) 모듈 > urllink 컴포넌트의 언어팩
**/
?>

View file

@ -0,0 +1,41 @@
<!--%import("urllink.js")-->
<!--%import("../lang")-->
<form action="./" method="get" id="fo" onSubmit="return false">
<div id="zone_AddUrl" class="editor_window">
<table width="380" border="0" cellspacing="1" cellpadding="0">
<col width="50" />
<col width="*" />
<tr>
<td class="editor_field">text</td>
<td><textarea name="text" class="editor_small_textarea"><?=$_REQUEST["title"]?></textarea></td>
</tr>
<tr>
<td class="editor_field">url</td>
<td><input type="text" name="url" class="editor_input" value="<?=$_REQUEST["url"]?>"/></td>
</tr>
<tr>
<td class="editor_field">bold</td>
<td><input type="checkbox" name="bold" value="Y" /></td>
</tr>
<tr>
<td class="editor_field">type</td>
<td>
<select name="link_type">
<option value="">default</option>
<option value="editor_blue_text">blue</option>
<option value="editor_red_text">red</option>
<option value="editor_green_text">green</option>
<option value="editor_yellow_text">yellow</option>
</select>
</td>
</tr>
<tr>
<td colspan="2">
<input type="button" id="manual_url_submit" class="editor_submit" value="Insert" onClick="insertUrl()" />
</td>
</tr>
</table>
</div>
</form>

View file

@ -9,12 +9,14 @@
// upload_target_srl 는 에디터에서 필수로 달고 다녀야 함....
var $upload_target_srl = 0;
var $component_path = '';
/**
* @brief upload_target_srl 설정;
* @brief upload_target_srl컴포넌트의 경로를 받음
**/
function urllink($upload_target_srl) {
function urllink($upload_target_srl, $component_path) {
$this->upload_target_srl = $upload_target_srl;
$this->component_path = $component_path;
}
/**
@ -36,7 +38,13 @@
* @brief popup window요청시 다시 call이 method. popup window에 출력할 내용을 추가하면 된다
**/
function getPopupContent() {
return "haha";
// 템플릿을 미리 컴파일해서 컴파일된 소스를 return
$tpl_path = $this->component_path.'tpl';
$tpl_file = 'urllink.html';
require_once("./classes/template/TemplateHandler.class.php");
$oTemplate = new TemplateHandler();
return $oTemplate->compile($tpl_path, $tpl_file);
}
}

View file

@ -1,77 +0,0 @@
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>add Url</title>
<link rel='stylesheet' href='../css/editor.css' type='text/css' />
<script type='text/javascript' src='../../common/js/x.js'></script>
<script type='text/javascript' src='../../common/js/common.js'></script>
<script type='text/javascript' src='../js/editor.js'></script>
<script type="text/javascript">
function setText() {
if(typeof(opener)=="undefined") return;
var text = opener.editorGetSelectedHtml(opener.editorPrevSrl);
var fo_obj = xGetElementById("fo");
if(fo_obj.text.value) return;
fo_obj.text.value = text;
self.focus();
}
function insertUrl() {
if(typeof(opener)=="undefined") return;
var fo_obj = xGetElementById("fo");
var text = fo_obj.text.value;
var url = fo_obj.url.value;
var link_type = fo_obj.link_type.options[fo_obj.link_type.selectedIndex].value;
if(fo_obj.bold.checked) link_type = "bold "+link_type;
if(text && url) opener.editorInsertUrl(text, url, link_type);
opener.focus();
self.close();
}
xAddEventListener(window, "load", setText);
xAddEventListener(window, 'load', setFixedPopupSize);
</script>
</head>
<body class="editor_pop_body">
<form action="./" method="post" id="fo" onSubmit="return false" style="display:inline">
<div id="zone_AddUrl" class="editor_window">
<table width="380" border="0" cellspacing="1" cellpadding="0">
<col width="50" />
<col width="*" />
<tr>
<td class="editor_field">text</td>
<td><textarea name="text" class="editor_small_textarea"><?=$_REQUEST["title"]?></textarea></td>
</tr>
<tr>
<td class="editor_field">url</td>
<td><input type="text" name="url" class="editor_input" value="<?=$_REQUEST["url"]?>"/></td>
</tr>
<tr>
<td class="editor_field">bold</td>
<td><input type="checkbox" name="bold" value="Y" /></td>
</tr>
<tr>
<td class="editor_field">type</td>
<td>
<select name="link_type">
<option value="">default</option>
<option value="editor_blue_text">blue</option>
<option value="editor_red_text">red</option>
<option value="editor_green_text">green</option>
<option value="editor_yellow_text">yellow</option>
</select>
</td>
</tr>
<tr>
<td colspan="2">
<input type="button" id="manual_url_submit" class="editor_submit" value="Insert" onClick="insertUrl()" />
</td>
</tr>
</table>
</div>
</form>
</body>
</html>

View file

@ -33,11 +33,12 @@
**/
function getComponentObject($component, $upload_target_srl) {
// 해당 컴포넌트의 객체를 생성해서 실행
$class_file = sprintf('%scomponents/%s/%s.class.php', $this->module_path, $component, $component);
$class_path = sprintf('%scomponents/%s/', $this->module_path, $component);
$class_file = sprintf('%s%s.class.php', $class_path, $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_str = sprintf('$oComponent = new %s("%s","%s");', $component, $upload_target_srl, $class_path);
@eval($eval_str);
if(!$oComponent) return new Object(-1, sprintf(Context::getLang('msg_component_is_not_founded'), $component));

View file

@ -231,6 +231,8 @@ function editorEventCheck(evt) {
// 추가 컴포넌트의 경우 서버에 요청을 시도
default :
editorPrevSrl = upload_target_srl;
var params = new Array();
params['component'] = component_name;
params['upload_target_srl'] = upload_target_srl;