mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-14 00:39:57 +09:00
git-svn-id: http://xe-core.googlecode.com/svn/trunk@988 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
aeb1d32bf2
commit
7b5e44ea20
14 changed files with 368 additions and 25 deletions
BIN
modules/editor/components/poll/icon.gif
Normal file
BIN
modules/editor/components/poll/icon.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1 KiB |
8
modules/editor/components/poll/info.xml
Normal file
8
modules/editor/components/poll/info.xml
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<component version="0.1">
|
||||
<title xml:lang="ko">설문조사 컴포넌트</title>
|
||||
<author email_address="zero@zeroboard.com" link="http://www.zeroboard.com" date="2007. 2. 28">
|
||||
<name xml:lang="ko">제로</name>
|
||||
<description xml:lang="ko">글 작성시에 설문조사를 첨부하실 수 있습니다. 설문조사 컴포넌트는 설문조사 모듈의 설정에 영향을 받습니다.</description>
|
||||
</author>
|
||||
</component>
|
||||
16
modules/editor/components/poll/lang/ko.lang.php
Normal file
16
modules/editor/components/poll/lang/ko.lang.php
Normal file
|
|
@ -0,0 +1,16 @@
|
|||
<?php
|
||||
/**
|
||||
* @file /modules/editor/components/urllink/lang/ko.lang.php
|
||||
* @author zero <zero@nzeo.com>
|
||||
* @brief 위지윅에디터(editor) 모듈 > 설문조사 컴포넌트의 언어팩
|
||||
**/
|
||||
|
||||
$lang->survey_title = "제목";
|
||||
$lang->survey_item = "항목";
|
||||
$lang->survey_stop_date = "종료 일자";
|
||||
$lang->survey_chk_count = "선택항목 수";
|
||||
|
||||
$lang->cmd_add_survey = "설문 추가";
|
||||
$lang->cmd_del_survey = "설문 제거";
|
||||
$lang->cmd_add_item = "항목 추가";
|
||||
?>
|
||||
36
modules/editor/components/poll/poll.class.php
Normal file
36
modules/editor/components/poll/poll.class.php
Normal file
|
|
@ -0,0 +1,36 @@
|
|||
<?php
|
||||
/**
|
||||
* @class poll
|
||||
* @author zero (zero@nzeo.com)
|
||||
* @brief 에디터에서 url링크하는 기능 제공.
|
||||
**/
|
||||
|
||||
class poll extends EditorHandler {
|
||||
|
||||
// upload_target_srl 는 에디터에서 필수로 달고 다녀야 함....
|
||||
var $upload_target_srl = 0;
|
||||
var $component_path = '';
|
||||
|
||||
/**
|
||||
* @brief upload_target_srl과 컴포넌트의 경로를 받음
|
||||
**/
|
||||
function poll($upload_target_srl, $component_path) {
|
||||
$this->upload_target_srl = $upload_target_srl;
|
||||
$this->component_path = $component_path;
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief popup window요청시 popup window에 출력할 내용을 추가하면 된다
|
||||
**/
|
||||
function getPopupContent() {
|
||||
// 템플릿을 미리 컴파일해서 컴파일된 소스를 return
|
||||
$tpl_path = $this->component_path.'tpl';
|
||||
$tpl_file = 'popup.html';
|
||||
|
||||
require_once("./classes/template/TemplateHandler.class.php");
|
||||
$oTemplate = new TemplateHandler();
|
||||
return $oTemplate->compile($tpl_path, $tpl_file);
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
122
modules/editor/components/poll/tpl/popup.css
Normal file
122
modules/editor/components/poll/tpl/popup.css
Normal file
|
|
@ -0,0 +1,122 @@
|
|||
@charset "utf-8";
|
||||
|
||||
.editor_window {
|
||||
width:500px;
|
||||
clear:both;
|
||||
}
|
||||
|
||||
.editor_title {
|
||||
font-size:10pt;
|
||||
font-weight:bold;
|
||||
clear:both;
|
||||
height:20px;
|
||||
background-color:#555555;
|
||||
color:#EFEFEF;
|
||||
vertical-align:middle;
|
||||
padding-top:5px;
|
||||
border-bottom:1px solid #000000;
|
||||
text-align:center;
|
||||
}
|
||||
|
||||
.survey_header {
|
||||
border:1px solid #888888;
|
||||
background-color:#EFEFEF;
|
||||
margin:5px;
|
||||
padding:5px;
|
||||
font-weight:bold;
|
||||
}
|
||||
|
||||
.survey_box {
|
||||
border:1px solid #888888;
|
||||
height:140px;
|
||||
margin:5px;
|
||||
padding:5px;
|
||||
}
|
||||
|
||||
.title_box {
|
||||
background-color:#EFEFEF;
|
||||
border:1px solid #DDDDDD;
|
||||
padding-top:4px;
|
||||
height:22px;
|
||||
clear:both;
|
||||
}
|
||||
|
||||
.item_box {
|
||||
height:22px;
|
||||
clear:both;
|
||||
padding-top:3px;
|
||||
margin-bottom:3px;
|
||||
border-bottom:1px solid #DDDDDD;
|
||||
}
|
||||
|
||||
.header {
|
||||
float:left;
|
||||
width:60px;
|
||||
clear:left;
|
||||
text-align:left;
|
||||
font-weight:bold;
|
||||
font-size:9pt;
|
||||
padding:2px 0px 0px 20px;
|
||||
height:20px;
|
||||
}
|
||||
|
||||
.sub_header {
|
||||
float:left;
|
||||
width:60px;
|
||||
clear:left;
|
||||
text-align:left;
|
||||
font-size:9pt;
|
||||
padding:2px 0px 0px 20px;
|
||||
height:20px;
|
||||
}
|
||||
|
||||
.body {
|
||||
float:left;
|
||||
text-align:left;
|
||||
font-size:9pt;
|
||||
height:20px;
|
||||
}
|
||||
|
||||
.sub_button_area {
|
||||
padding:3px 20px 3px 0px;
|
||||
clear:both;
|
||||
height:25px;
|
||||
}
|
||||
|
||||
.sub_button_area div {
|
||||
float:left;
|
||||
padding-right:10px;
|
||||
margin-right:10px;
|
||||
height:20px;
|
||||
}
|
||||
|
||||
.editor_input {
|
||||
width:335px;
|
||||
border:1px solid #AAAAAA;
|
||||
font-size:9pt;
|
||||
height:13px;
|
||||
}
|
||||
|
||||
.editor_small_input {
|
||||
width:50px;
|
||||
border:1px solid #AAAAAA;
|
||||
font-size:9pt;
|
||||
height:13px;
|
||||
}
|
||||
|
||||
|
||||
.editor_button_area {
|
||||
border-top:1px solid #AAAAAA;
|
||||
text-align:center;
|
||||
background-color:#EEEEEE;
|
||||
padding:10px 0px 2px 0px;
|
||||
clear:both;
|
||||
height:25px;
|
||||
}
|
||||
|
||||
.editor_button {
|
||||
background-color:#FFFFFF;
|
||||
border:1px solid #AAAAAA;
|
||||
height:17px;
|
||||
font-size:9pt;
|
||||
}
|
||||
64
modules/editor/components/poll/tpl/popup.html
Normal file
64
modules/editor/components/poll/tpl/popup.html
Normal file
|
|
@ -0,0 +1,64 @@
|
|||
<!--%import("popup.js")-->
|
||||
<!--%import("popup.css")-->
|
||||
<!--%import("../lang")-->
|
||||
<form action="./" method="get" id="fo_component" onSubmit="return false">
|
||||
<div class="editor_window">
|
||||
<div class="editor_title">{$component_info->title} ver. {$component_info->version} <a href="#" onclick="popopen('./?module=editor&act=dispEditorComponentInfo&component_name={$component_info->component_name}','ComponentInfo');return false;"><img src="../../../tpl/images/about_component.gif" title="{$lang->about_component}" alt="{$lang->about_component}" class="about_component_icon" border="0" /></a></div>
|
||||
|
||||
<div class="survey_header">
|
||||
{$lang->survey_stop_date} :
|
||||
<select name="stop_year">
|
||||
<!--@for($i=date("Y");$i<date("Y")+10;$i++)-->
|
||||
<option value="{$i}">{$i}</option>
|
||||
<!--@end-->
|
||||
</select>
|
||||
<select name="stop_month">
|
||||
<!--@for($i=1;$i<=12;$i++)-->
|
||||
<option value="{$i}" <!--@if($i==date("m"))-->selected="true"<!--@end-->>{$i}</option>
|
||||
<!--@end-->
|
||||
</select>
|
||||
<select name="stop_day">
|
||||
<!--@for($i=1;$i<=31;$i++)-->
|
||||
<option value="{$i}" <!--@if($i==date("d"))-->selected="true"<!--@end-->>{$i}</option>
|
||||
<!--@end-->
|
||||
</select>
|
||||
</div>
|
||||
|
||||
<div id="survey_source" class="survey_box" style="display:none">
|
||||
|
||||
<div class="title_box">
|
||||
<div class="header">{$lang->survey_title}</div>
|
||||
<div class="body"><input type="text" name="title" class="editor_input" /></div>
|
||||
</div>
|
||||
|
||||
<div class="item_box">
|
||||
<div class="sub_header">{$lang->survey_item} 1</div>
|
||||
<div class="body"><input type="text" name="title" class="editor_input" /></div>
|
||||
</div>
|
||||
|
||||
<div class="item_box">
|
||||
<div class="sub_header">{$lang->survey_item} 2</div>
|
||||
<div class="body"><input type="text" name="title" class="editor_input" /></div>
|
||||
</div>
|
||||
|
||||
<div class="item_box">
|
||||
<div class="sub_header">{$lang->survey_item} 3</div>
|
||||
<div class="body"><input type="text" name="title" class="editor_input" /></div>
|
||||
</div>
|
||||
<div class="sub_button_area">
|
||||
<div><input type="button" value="{$lang->cmd_del_survey}" class="editor_button" onclick="doSurveyDelete(this); return false;" /></div>
|
||||
<div><input type="button" value="{$lang->cmd_add_item}" class="editor_button" onclick="doSurveyAddItem(this); return false;" /></div>
|
||||
<div>
|
||||
- {$lang->survey_chk_count} : <input type="text" name="check_count" value="1" class="editor_small_input" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="editor_button_area">
|
||||
<input type="button" class="editor_button" value="{$lang->cmd_add_survey}" onclick="doSurveyAdd(); return false;" />
|
||||
<input type="button" class="editor_button" value="{$lang->cmd_insert}" onclick="insertSurvey(); return false;" />
|
||||
<input type="button" class="editor_button" value="{$lang->cmd_close}" onclick="window.close(); return false;" />
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</form>
|
||||
103
modules/editor/components/poll/tpl/popup.js
Normal file
103
modules/editor/components/poll/tpl/popup.js
Normal file
|
|
@ -0,0 +1,103 @@
|
|||
/**
|
||||
* popup으로 열렸을 경우 부모창의 위지윅에디터에 select된 block이 있는지 체크하여
|
||||
* 있으면 가져와서 원하는 곳에 삽입
|
||||
**/
|
||||
var survey_index = 1;
|
||||
function setSurvey() {
|
||||
var obj = xCreateElement("div");
|
||||
var source = xGetElementById("survey_source");
|
||||
xInnerHtml(obj, xInnerHtml(source));
|
||||
obj.id = "survey_"+survey_index;
|
||||
obj.className = "survey_box";
|
||||
obj.style.display = "block";
|
||||
|
||||
source.parentNode.insertBefore(obj, source);
|
||||
}
|
||||
|
||||
/**
|
||||
* 부모창의 위지윅에디터에 데이터를 삽입
|
||||
**/
|
||||
function insertSurvey() {
|
||||
if(typeof(opener)=="undefined") return;
|
||||
|
||||
var iframe_obj = opener.editorGetIFrame(opener.editorPrevSrl)
|
||||
opener.editorReplaceHTML(iframe_obj, link);
|
||||
|
||||
opener.focus();
|
||||
window.close();
|
||||
}
|
||||
|
||||
xAddEventListener(window, "load", setSurvey);
|
||||
|
||||
/**
|
||||
* 새 설문 추가
|
||||
**/
|
||||
function doSurveyAdd() {
|
||||
var obj = xCreateElement("div");
|
||||
var source = xGetElementById("survey_source");
|
||||
if(survey_index+1>3) return null;
|
||||
survey_index++;
|
||||
xInnerHtml(obj, xInnerHtml(source));
|
||||
obj.id = "survey_"+survey_index;
|
||||
obj.className = "survey_box";
|
||||
obj.style.display = "block";
|
||||
|
||||
source.parentNode.insertBefore(obj, source);
|
||||
|
||||
setFixedPopupSize();
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/**
|
||||
* 항목 삭제
|
||||
**/
|
||||
function doSurveyDelete(obj) {
|
||||
var pobj = obj.parentNode.parentNode.parentNode;
|
||||
var tmp_arr = pobj.id.split('_');
|
||||
var index = tmp_arr[1];
|
||||
if(index==1) return;
|
||||
|
||||
pobj.parentNode.removeChild(pobj);
|
||||
|
||||
var obj_list = xGetElementsByClassName('survey_box');
|
||||
for(var i=0;i<obj_list.length;i++) {
|
||||
var nobj = obj_list[i];
|
||||
if(nobj.id == 'survey_source') continue;
|
||||
var tmp_arr = nobj.id.split('_');
|
||||
var index = tmp_arr[1];
|
||||
nobj.id = 'survey_'+(i+1);
|
||||
}
|
||||
survey_index = i-1;
|
||||
|
||||
setFixedPopupSize();
|
||||
}
|
||||
|
||||
/**
|
||||
* 새 항목 추가
|
||||
**/
|
||||
function doSurveyAddItem(obj) {
|
||||
var pobj = obj.parentNode.parentNode;
|
||||
var source = xPrevSib(pobj);
|
||||
var new_obj = xCreateElement("div");
|
||||
var html = xInnerHtml(source);
|
||||
|
||||
var idx_match = html.match(/ ([0-9]+)</i);
|
||||
if(!idx_match) return null;
|
||||
|
||||
var idx = parseInt(idx_match[1],10);
|
||||
html = html.replace( / ([0-9]+)</, ' '+(idx+1)+'<');
|
||||
|
||||
xInnerHtml(new_obj, html);
|
||||
new_obj.className = source.className;
|
||||
|
||||
pobj.parentNode.insertBefore(new_obj, pobj);
|
||||
|
||||
var box_obj = pobj.parentNode;
|
||||
var box_height = xHeight(box_obj);
|
||||
xHeight(box_obj, box_height+29);
|
||||
|
||||
setFixedPopupSize();
|
||||
|
||||
return null;
|
||||
}
|
||||
|
|
@ -157,17 +157,16 @@ function _editorAutoSave() {
|
|||
|
||||
function _editorAutoSaved(ret_obj) {
|
||||
setTimeout(_editorAutoSave, 7000);
|
||||
return null;
|
||||
}
|
||||
|
||||
// 에디터의 전체 내용 return
|
||||
function editorGetContent(upload_target_srl) {
|
||||
var iframe_obj = editorGetIFrame(upload_target_srl);
|
||||
if(!iframe_obj) return;
|
||||
var html = '';
|
||||
if(!iframe_obj) return null;
|
||||
var html = null;
|
||||
html = xInnerHtml(iframe_obj.contentWindow.document.body);
|
||||
if(html) html = html.replace(/^<br>$/i,'');
|
||||
if(!html) return "";
|
||||
|
||||
return html;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -155,7 +155,6 @@ function editor_remove_file(upload_target_srl) {
|
|||
var fo_obj = obj;
|
||||
while(fo_obj.nodeName != 'FORM') { fo_obj = fo_obj.parentNode; }
|
||||
var mid = fo_obj.mid.value;
|
||||
var upload_target_srl = fo_obj.upload_target_srl.value;
|
||||
var url = "./?act=procFileDelete&upload_target_srl="+upload_target_srl+"&file_srl="+file_srl;
|
||||
|
||||
// iframe에 url을 보내버림
|
||||
|
|
@ -192,7 +191,6 @@ function editor_insert_file(upload_target_srl) {
|
|||
var fo_obj = obj;
|
||||
while(fo_obj.nodeName != 'FORM') { fo_obj = fo_obj.parentNode; }
|
||||
var mid = fo_obj.mid.value;
|
||||
var upload_target_srl = fo_obj.upload_target_srl.value;
|
||||
var url = "./?module=file&act=procFileDownload&file_srl="+file_srl+"&sid="+sid;
|
||||
openComponent("url_link", upload_target_srl, url);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue