#452 설문조사 에디터 컴포넌트로 설문조사 추가시 스킨을 선택할 수 있도록 변경. simple설문조사 스킨 추가

git-svn-id: http://xe-core.googlecode.com/svn/sandbox@4111 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
zero 2008-04-16 09:33:49 +00:00
parent f4cde76683
commit 9650a4a22b
16 changed files with 303 additions and 79 deletions

View file

@ -11,6 +11,7 @@
<form action="./" method="get" onsubmit="return doPoll(this)">
<input type="hidden" name="poll_srl" value="{$poll->poll_srl}" />
<input type="hidden" name="poll_srl_indexes" value="" />
<input type="hidden" name="skin" value="{$skin}" />
<table cellspacing="0" class="poll_table">
<col width="7" />
@ -23,7 +24,7 @@
</tr>
<tr>
<td class="title" colspan="3">
{$lang->poll_stop_date} : <strong>{zdate($poll->stop_date, "Y-m-d")}</strong> {zdate($poll->stop_date, "H:i")}
{$lang->poll_stop_date} : <strong>{zdate($poll->stop_date, "Y-m-d")}</strong>
</td>
</tr>
<tr>
@ -66,7 +67,7 @@
<tr>
<td colspan="3" class="poll_button">
<div>
<span class="button"><input type="button" value="{$lang->cmd_view_result}" class="poll_button" onclick="doPollViewResult('{$poll->poll_srl}'); return false;"/></span>
<span class="button"><input type="button" value="{$lang->cmd_view_result}" class="poll_button" onclick="doPollViewResult('{$poll->poll_srl}','{$skin}'); return false;"/></span>
<span class="button"><input type="submit" value="{$lang->cmd_apply_poll}" class="poll_button" /></span>
</div>
</td>

View file

@ -51,10 +51,13 @@ function completePoll(ret_obj) {
}
/* 설문 미리 보기 */
function doPollViewResult(poll_srl) {
function doPollViewResult(poll_srl, skin) {
var params = new Array();
params['poll_srl'] = poll_srl;
if(typeof(skin)=='undefined') skin = 'default';
params['skin'] = skin;
var response_tags = new Array('error','message','poll_srl', 'tpl');
exec_xml('poll','procPollViewResult', params, completePoll, response_tags);

Binary file not shown.

View file

@ -0,0 +1,26 @@
.simple_poll { table-layout:fixed; width:100%; padding:0; border:none;}
.simple_poll td { padding:0; margin:0; }
.simple_poll td.title { text-align:right; }
.simple_poll td .itemDiv { border-top:1px solid #BBBBBB; margin-top:3px; padding:3px 0 3px 0; }
.simple_poll td .title { color:#000000; font-weight:bold; }
.simple_poll td .checkcount { color:#AAAAAA; }
.simple_poll td .item { color:#636363; margin:3px 0 0 10px; }
.simple_poll td .item input { margin:0; padding:0; }
.simple_poll td .barBox { margin-left:10px; position:relative; height:20px; }
.simple_poll td .barBox .bar { margin-right:100px; margin-top:7px; }
.simple_poll td .barBox .status { position:absolute; right:0; top:0; }
.simple_poll td.stopDate { text-align:right; color:#AAAAAA; border-top:1px solid #BBBBBB; padding-top:3px;}
.simple_poll td.stopDate a { color:#AAAAAA; text-decoration:none; }
.simple_poll td.poll_button { text-align:left; border-top:1px solid #BBBBBB; padding-top:3px;}
.simple_poll td.poll_button .poll_button { border:1px solid #EEEEEE; background-color:#AAAAAA; color:#FFFFFF; font-weight:bold; padding:1px 3px 1px 3px; height:20px; }
.simple_poll td.b { background-color:#F6F6F5; height:7px; }
.simple_poll td.b img { width:100%; height:6px; border-bottom:1px solid #E5E5E5; }
.simple_poll td.bb { height:7px; }
.simple_poll td.bb img { width:100%; height:6px; border-bottom:1px solid #E5E5E5; }

View file

@ -0,0 +1,10 @@
<filter name="poll" module="poll" act="procPoll" confirm_msg_code="confirm_poll_submit">
<form />
<parameter />
<response callback_func="completePoll">
<tag name="error" />
<tag name="message" />
<tag name="poll_srl" />
<tag name="tpl" />
</response>
</filter>

View file

@ -0,0 +1,61 @@
<!--%import("filter/poll.xml")-->
<!--%import("js/poll.js")-->
<!--%import("css/poll.css")-->
<script type="text/javascript">
var poll_alert_lang = "{$lang->msg_check_poll_item}";
</script>
<div id="poll_{$poll->poll_srl}" style="{$poll->style}">
<form action="./" method="get" onsubmit="return doPoll(this)">
<input type="hidden" name="poll_srl" value="{$poll->poll_srl}" />
<input type="hidden" name="poll_srl_indexes" value="" />
<input type="hidden" name="skin" value="{$skin}" />
<table cellspacing="0" class="simple_poll">
<tr>
<td colspan="2">
{@ $_key = 0}
<!--@foreach($poll->poll as $poll_srl_index => $val)-->
<div <!--@if($_key>0)-->class="itemDiv"<!--@end-->>
<input type="hidden" name="checkcount_{$poll_srl_index}" value="{$val->checkcount}" />
<div class="title">{$val->title}</div>
<!--@if($val->checkcount>1)-->
<div class="checkcount">({$lang->poll_checkcount} : {$val->checkcount})</div>
<!--@end-->
<!--@foreach($val->item as $item_srl => $item)-->
{@$_idx = $poll->poll_srl.'_'.$poll_srl_index.'_'.$item_srl}
<div class="item">
<!--@if($val->checkcount>1)-->
<input type="checkbox" name="item_{$poll->poll_srl}_{$poll_srl_index}" value="{$item->poll_item_srl}" id="item_{$item->poll_item_srl}" />
<!--@else-->
<input type="radio" name="item_{$poll->poll_srl}_{$poll_srl_index}" value="{$item->poll_item_srl}" id="item_{$item->poll_item_srl}" />
<!--@end-->
<label for="item_{$item->poll_item_srl}">{$item->title}</label>
</div>
</div>
<!--@end-->
{@ $_key++}
<!--@end-->
</td>
</tr>
<tr>
<td class="poll_button">
<input type="submit" value="{$lang->cmd_apply_poll}" class="poll_button" />
</td>
<td class="stopDate">
~<strong>{zdate($poll->stop_date, "Y-m-d")}</strong> (<a href="#" onclick="doPollViewResult('{$poll->poll_srl}','{$skin}'); return false;"/>{$lang->cmd_view_result}</a>)
</td>
</tr>
</tr>
</table>
</form>
</div>

Binary file not shown.

After

Width:  |  Height:  |  Size: 328 B

View file

@ -0,0 +1,64 @@
/* 설문 참여 함수 */
function doPoll(fo_obj) {
var checkcount = new Array();
var item = new Array();
for(var i=0;i<fo_obj.length;i++) {
var obj = fo_obj[i];
if(obj.nodeName != 'INPUT') continue;
var name = obj.name;
if(name.indexOf('checkcount')>-1) {
var t = name.split('_');
var poll_srl_index = parseInt(t[1],10);
checkcount[poll_srl_index] = obj.value;
item[poll_srl_index] = new Array();
} else if(name.indexOf('item_')>-1) {
var t = name.split('_');
var poll_srl = parseInt(t[1],10);
var poll_srl_index = parseInt(t[2],10);
if(obj.checked == true) item[poll_srl_index][item[poll_srl_index].length] = obj.value;
}
}
var poll_srl_indexes = "";
for(var poll_srl_index in checkcount) {
if(!checkcount.hasOwnProperty(poll_srl_index)) continue;
var count = checkcount[poll_srl_index];
var items = item[poll_srl_index];
if(items.length < 1 || count < items.length) {
alert(poll_alert_lang);
return false;
}
poll_srl_indexes += items.join(',')+',';
}
fo_obj.poll_srl_indexes.value = poll_srl_indexes;
procFilter(fo_obj, poll);
return false;
}
/* 설문 조사후 내용을 바꿀 함수 */
function completePoll(ret_obj) {
var poll_srl = ret_obj['poll_srl'];
var tpl = ret_obj['tpl'];
var width = xWidth("poll_"+poll_srl);
xInnerHtml("poll_"+poll_srl, tpl);
xWidth("poll_"+poll_srl, width);
}
/* 설문 미리 보기 */
function doPollViewResult(poll_srl, skin) {
var params = new Array();
params['poll_srl'] = poll_srl;
if(typeof(skin)=='undefined') skin = 'default';
params['skin'] = skin;
var response_tags = new Array('error','message','poll_srl', 'tpl');
exec_xml('poll','procPollViewResult', params, completePoll, response_tags);
}

View file

@ -0,0 +1,36 @@
<!--%import("css/poll.css")-->
<div class="poll_box" style="{$poll->style}">
<table cellspacing="0" class="simple_poll">
<tr>
<td>
{@ $_key = 0}
<!--@foreach($poll->poll as $poll_srl_index => $val)-->
<div <!--@if($_key>0)-->class="itemDiv"<!--@end-->>
<div class="title">{$val->title} ({$val->poll_count})</div>
<!--@foreach($val->item as $item_srl => $item)-->
{@$per = (int)(( $item->poll_count / $val->poll_count)*100) }
<!--@if($per<1)-->{@$per = 1; }<!--@end-->
<div class="item">
{$item->title}
</div>
<div class="barBox">
<div class="bar"><img src="./images/color_bar.png" style="width:{$per}%;height:6px;" alt="bar" /></div>
<div class="status">{$item->poll_count} ({$per}%)</div>
</div>
<div class="clear"></div>
<!--@end-->
</div>
{@ $_key++}
<!--@end-->
</td>
</tr>
</table>
</div>

View file

@ -0,0 +1,16 @@
<?xml version="1.0" encoding="utf-8"?>
<skin>
<title xml:lang="ko">설문조사 간단한 스킨</title>
<maker email_address="zero@zeroboard.com" link="http://www.zeroboard.com" date="2008. 4. 16">
<name xml:lang="ko">제로</name>
<description xml:lang="ko">설문조사 간단한 스킨</description>
</maker>
<colorset>
<color name="normal">
<title xml:lang="ko">기본</title>
<title xml:lang="zh-CN">默认</title>
<title xml:lang="jp">デフォルト</title>
<title xml:lang="en">Default</title>
</color>
</colorset>
</skin>