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

This commit is contained in:
zero 2007-04-06 04:30:59 +00:00
parent 6a9de5caca
commit 3e493a87d8
7 changed files with 65 additions and 63 deletions

View file

@ -5,13 +5,13 @@
* @brief 위지윅에디터(editor) 모듈 > 설문조사 컴포넌트의 언어팩
**/
$lang->survey_title = "제목";
$lang->survey_item = "항목";
$lang->survey_stop_date = "종료 일자";
$lang->survey_chk_count = "선택항목 수";
$lang->poll_title = "제목";
$lang->poll_item = "항목";
$lang->poll_stop_date = "종료 일자";
$lang->poll_chk_count = "선택항목 수";
$lang->cmd_add_survey = "설문 추가";
$lang->cmd_del_survey = "설문 제거";
$lang->cmd_add_poll = "설문 추가";
$lang->cmd_del_poll = "설문 제거";
$lang->cmd_add_item = "항목 추가";
$lang->cmd_null_item = "설문조사로 등록할 값이 없습니다.\n다시 설정해주세요";

View file

@ -22,7 +22,7 @@
/**
* @brief 팝업창에서 설문 작성 완료후 저장을 누를때
**/
function insertSurvey() {
function insertPoll() {
Context::loadLang($this->component_path.'lang');
$stop_year = Context::get('stop_year');
$stop_month = Context::get('stop_month');
@ -38,11 +38,11 @@
$tmp_arr = explode('_',$key);
$survey_index = $tmp_arr[1];
$poll_index = $tmp_arr[1];
if($tmp_arr[0]=='title') $tmp_args[$survey_index]->title = $val;
else if($tmp_arr[0]=='checkcount') $tmp_args[$survey_index]->checkcount = $val;
else if($tmp_arr[0]=='item') $tmp_args[$survey_index]->item[] = $val;
if($tmp_arr[0]=='title') $tmp_args[$poll_index]->title = $val;
else if($tmp_arr[0]=='checkcount') $tmp_args[$poll_index]->checkcount = $val;
else if($tmp_arr[0]=='item') $tmp_args[$poll_index]->item[] = $val;
}
foreach($tmp_args as $key => $val) {
@ -52,9 +52,11 @@
if(!count($args)) return new Object(-1, 'cmd_null_item');
$survey_srl = getNextSequence();
$poll_srl = getNextSequence();
$this->add('survey_srl', $survey_srl);
// DB 에 입력
$this->add('poll_srl', $poll_srl);
}
/**

View file

@ -0,0 +1,9 @@
<filter name="insert_poll" module="editor" act="procEditorCall" confirm_msg_code="confirm_submit">
<form />
<parameter />
<response callback_func="completeInsertPoll">
<tag name="error" />
<tag name="message" />
<tag name="poll_srl" />
</response>
</filter>

View file

@ -1,9 +0,0 @@
<filter name="insert_survey" module="editor" act="procEditorCall" confirm_msg_code="confirm_submit">
<form />
<parameter />
<response callback_func="completeInsertSurvey">
<tag name="error" />
<tag name="message" />
<tag name="survey_srl" />
</response>
</filter>

View file

@ -18,7 +18,7 @@
text-align:center;
}
.survey_header {
.poll_header {
border:1px solid #888888;
background-color:#EFEFEF;
margin:5px;
@ -26,7 +26,7 @@
font-weight:bold;
}
.survey_box {
.poll_box {
border:1px solid #888888;
height:140px;
margin:5px;

View file

@ -1,18 +1,18 @@
<!--%import("popup.js")-->
<!--%import("popup.css")-->
<!--%import("filter/insert_survey.xml")-->
<!--%import("filter/insert_poll.xml")-->
<!--%import("../lang")-->
<form action="./" method="post" id="fo_component" onSubmit="procFilter(this, insert_survey); return false;">
<form action="./" method="post" id="fo_component" onSubmit="procFilter(this, insert_poll); return false;">
<input type="hidden" name="component" value="{$component_info->component_name}" />
<input type="hidden" name="method" value="insertSurvey" />
<input type="hidden" name="survey_srl" value="" />
<input type="hidden" name="method" value="insertPoll" />
<input type="hidden" name="poll_srl" value="" />
<div class="editor_window">
<div class="editor_title">{$component_info->title} ver. {$component_info->version} <a href="#" onclick="popopen('./?module=editor&amp;act=dispEditorComponentInfo&amp;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} :
<div class="poll_header">
{$lang->poll_stop_date} :
<select name="stop_year">
<!--@for($i=date("Y");$i<date("Y")+10;$i++)-->
<option value="{$i}">{$i}</option>
@ -28,35 +28,35 @@
<option value="{$i}" <!--@if($i==date("d"))-->selected="true"<!--@end-->>{$i}</option>
<!--@end-->
</select>
<input type="button" class="editor_button" value="{$lang->cmd_add_survey}" onclick="doSurveyAdd(); return false;" />
<input type="button" class="editor_button" value="{$lang->cmd_add_poll}" onclick="doPollAdd(); return false;" />
</div>
<div id="survey_source" class="survey_box" style="display:none">
<div id="poll_source" class="poll_box" style="display:none">
<div class="title_box">
<div class="header">{$lang->survey_title}</div>
<div class="header">{$lang->poll_title}</div>
<div class="body"><input type="text" name="title_tidx" class="editor_input" /></div>
</div>
<div class="item_box">
<div class="sub_header">{$lang->survey_item} 1</div>
<div class="sub_header">{$lang->poll_item} 1</div>
<div class="body"><input type="text" name="item_tidx_1" class="editor_input" /></div>
</div>
<div class="item_box">
<div class="sub_header">{$lang->survey_item} 2</div>
<div class="sub_header">{$lang->poll_item} 2</div>
<div class="body"><input type="text" name="item_tidx_2" class="editor_input" /></div>
</div>
<div class="item_box">
<div class="sub_header">{$lang->survey_item} 3</div>
<div class="sub_header">{$lang->poll_item} 3</div>
<div class="body"><input type="text" name="item_tidx_3" 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><input type="button" value="{$lang->cmd_del_poll}" class="editor_button" onclick="doPollDelete(this); return false;" /></div>
<div><input type="button" value="{$lang->cmd_add_item}" class="editor_button" onclick="doPollAddItem(this); return false;" /></div>
<div>
- {$lang->survey_chk_count} : <input type="text" name="checkcount_tidx" value="1" class="editor_small_input" />
- {$lang->poll_chk_count} : <input type="text" name="checkcount_tidx" value="1" class="editor_small_input" />
</div>
</div>
</div>

View file

@ -2,17 +2,17 @@
* popup으로 열렸을 경우 부모창의 위지윅에디터에 select된 block이 있는지 체크하여
* 있으면 가져와서 원하는 곳에 삽입
**/
var survey_index = 1;
function setSurvey() {
var poll_index = 1;
function setPoll() {
var obj = xCreateElement("div");
var source = xGetElementById("survey_source");
var source = xGetElementById("poll_source");
var html = xInnerHtml(source);
html = html.replace(/tidx/g, survey_index);
html = html.replace(/tidx/g, poll_index);
xInnerHtml(obj, html);
obj.id = "survey_"+survey_index;
obj.className = "survey_box";
obj.id = "poll_"+poll_index;
obj.className = "poll_box";
obj.style.display = "block";
source.parentNode.insertBefore(obj, source);
@ -21,13 +21,13 @@ function setSurvey() {
/**
* 부모창의 위지윅에디터에 데이터를 삽입
**/
function completeInsertSurvey(ret_obj) {
function completeInsertPoll(ret_obj) {
if(typeof(opener)=="undefined") return null;
var survey_srl = ret_obj["survey_srl"];
if(!survey_srl) return null;
var poll_srl = ret_obj["poll_srl"];
if(!poll_srl) return null;
var text = "<img src=\"./common/tpl/images/blank.gif\" survey_srl=\""+survey_srl+"\" editor_component=\"poll\" class=\"editor_component_output\" style=\"width:100%;\" />";
var text = "<img src=\"./common/tpl/images/blank.gif\" poll_srl=\""+poll_srl+"\" editor_component=\"poll\" class=\"editor_component_output\" style=\"width:100%;\" />";
var iframe_obj = opener.editorGetIFrame(opener.editorPrevSrl)
opener.editorReplaceHTML(iframe_obj, text);
@ -38,23 +38,23 @@ function completeInsertSurvey(ret_obj) {
return null;
}
xAddEventListener(window, "load", setSurvey);
xAddEventListener(window, "load", setPoll);
/**
* 설문 추가
**/
function doSurveyAdd() {
function doPollAdd() {
var obj = xCreateElement("div");
var source = xGetElementById("survey_source");
if(survey_index+1>3) return null;
survey_index++;
var source = xGetElementById("poll_source");
if(poll_index+1>3) return null;
poll_index++;
var html = xInnerHtml(source);
html = html.replace(/tidx/g, survey_index);
html = html.replace(/tidx/g, poll_index);
xInnerHtml(obj, html);
obj.id = "survey_"+survey_index;
obj.className = "survey_box";
obj.id = "poll_"+poll_index;
obj.className = "poll_box";
obj.style.display = "block";
source.parentNode.insertBefore(obj, source);
@ -67,7 +67,7 @@ function doSurveyAdd() {
/**
* 항목 삭제
**/
function doSurveyDelete(obj) {
function doPollDelete(obj) {
var pobj = obj.parentNode.parentNode.parentNode;
var tmp_arr = pobj.id.split('_');
var index = tmp_arr[1];
@ -75,15 +75,15 @@ function doSurveyDelete(obj) {
pobj.parentNode.removeChild(pobj);
var obj_list = xGetElementsByClassName('survey_box');
var obj_list = xGetElementsByClassName('poll_box');
for(var i=0;i<obj_list.length;i++) {
var nobj = obj_list[i];
if(nobj.id == 'survey_source') continue;
if(nobj.id == 'poll_source') continue;
var tmp_arr = nobj.id.split('_');
var index = tmp_arr[1];
nobj.id = 'survey_'+(i+1);
nobj.id = 'poll_'+(i+1);
}
survey_index = i-1;
poll_index = i-1;
setFixedPopupSize();
}
@ -91,7 +91,7 @@ function doSurveyDelete(obj) {
/**
* 항목 추가
**/
function doSurveyAddItem(obj) {
function doPollAddItem(obj) {
var pobj = obj.parentNode.parentNode;
var source = xPrevSib(pobj);
var new_obj = xCreateElement("div");