mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-07 10:41:40 +09:00
#452 설문조사 에디터 컴포넌트로 설문조사 추가시 스킨을 선택할 수 있도록 변경. simple설문조사 스킨 추가
git-svn-id: http://xe-core.googlecode.com/svn/sandbox@4111 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
f4cde76683
commit
9650a4a22b
16 changed files with 303 additions and 79 deletions
|
|
@ -23,6 +23,11 @@
|
||||||
* @brief popup window요청시 popup window에 출력할 내용을 추가하면 된다
|
* @brief popup window요청시 popup window에 출력할 내용을 추가하면 된다
|
||||||
**/
|
**/
|
||||||
function getPopupContent() {
|
function getPopupContent() {
|
||||||
|
// 설문조사 스킨을 구함
|
||||||
|
$oModuleModel = &getModel('module');
|
||||||
|
$skin_list = $oModuleModel->getSkins("./modules/poll/");
|
||||||
|
Context::set('skin_list', $skin_list);
|
||||||
|
|
||||||
// 템플릿을 미리 컴파일해서 컴파일된 소스를 return
|
// 템플릿을 미리 컴파일해서 컴파일된 소스를 return
|
||||||
$tpl_path = $this->component_path.'tpl';
|
$tpl_path = $this->component_path.'tpl';
|
||||||
$tpl_file = 'popup.html';
|
$tpl_file = 'popup.html';
|
||||||
|
|
@ -39,6 +44,8 @@
|
||||||
**/
|
**/
|
||||||
function transHTML($xml_obj) {
|
function transHTML($xml_obj) {
|
||||||
$poll_srl = $xml_obj->attrs->poll_srl;
|
$poll_srl = $xml_obj->attrs->poll_srl;
|
||||||
|
$skin = $xml_obj->attrs->skin;
|
||||||
|
if(!$skin) $skin = 'default';
|
||||||
|
|
||||||
preg_match('/width([^[:digit:]]+)([0-9]+)/i',$xml_obj->attrs->style,$matches);
|
preg_match('/width([^[:digit:]]+)([0-9]+)/i',$xml_obj->attrs->style,$matches);
|
||||||
$width = $matches[2];
|
$width = $matches[2];
|
||||||
|
|
@ -47,7 +54,7 @@
|
||||||
|
|
||||||
// poll model 객체 생성해서 html 얻어와서 return
|
// poll model 객체 생성해서 html 얻어와서 return
|
||||||
$oPollModel = &getModel('poll');
|
$oPollModel = &getModel('poll');
|
||||||
return $oPollModel->getPollHtml($poll_srl, $style);
|
return $oPollModel->getPollHtml($poll_srl, $style, $skin);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,19 @@
|
||||||
@charset "utf-8";
|
@charset "utf-8";
|
||||||
@import url(../../../../../modules/admin/tpl/css/admin.css);
|
@import url(../../../../../modules/admin/tpl/css/admin.css);
|
||||||
|
|
||||||
.pollButton { clear:both; margin:.5em 0 0 0; height:20px; }
|
.display_date { cursor:pointer; width:80px; float:left; border:1px solid; border-color:#a6a6a6 #d8d8d8 #d8d8d8 #a6a6a6; height:1em; padding:3px; font-family:tahoma; }
|
||||||
.pollButton label { vertical-align:middle; color:#888888; }
|
|
||||||
|
.adminTable { margin-bottom:0 !important; }
|
||||||
|
|
||||||
|
.pollButton { clear:both; overflow:hidden; border:1px solid #E3E3E2; border-top:none; background-color:#FAF8F4; padding:4px; }
|
||||||
|
.pollButton .fl { padding:5px 0 0 10px; color:#AAAAAA; }
|
||||||
|
.pollButton .fl label { vertical-align:middle; color:#888888; }
|
||||||
|
.pollButton .fr { padding:5px 10px 0 0; color:#AAAAAA; }
|
||||||
|
.pollButton .fr a { color:#444444; text-decoration:none; font-weight:bold;}
|
||||||
|
.pollButton .fr a.delPoll { color:red; font-weight:normal;}
|
||||||
|
|
||||||
li { list-style:none; margin-right:5px; float:left; color:#666666}
|
li { list-style:none; margin-right:5px; float:left; color:#666666}
|
||||||
li a { text-decoration:none; color:#666666;}
|
li a { text-decoration:none; color:#666666;}
|
||||||
|
|
||||||
|
#popFooter .fl { margin-left:10px; }
|
||||||
|
#popFooter .fr { margin-right:10px; }
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,18 @@
|
||||||
<!--%import("filter/insert_poll.xml")-->
|
<!--%import("filter/insert_poll.xml")-->
|
||||||
<!--%import("../lang")-->
|
<!--%import("../lang")-->
|
||||||
|
|
||||||
|
<!-- calendar -->
|
||||||
|
<!--%import("../../../../../common/js/calendar.js",optimized=false)-->
|
||||||
|
<!--@if($lang_type == 'ko')-->
|
||||||
|
<!--%import("../../../../../common/js/calendar-ko.js",optimized=false)-->
|
||||||
|
<!--@else-->
|
||||||
|
<!--%import("../../../../../common/js/calendar-en.js",optimized=false)-->
|
||||||
|
<!--@end-->
|
||||||
|
<!--%import("../../../../../common/js/calendar-setup.js",optimized=false)-->
|
||||||
|
<!--%import("../../../../../common/css/calendar-system.css",optimized=false)-->
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
<script type="text/javascript">
|
<script type="text/javascript">
|
||||||
var msg_poll_cannot_modify = "{$lang->msg_poll_cannot_modify}";
|
var msg_poll_cannot_modify = "{$lang->msg_poll_cannot_modify}";
|
||||||
</script>
|
</script>
|
||||||
|
|
@ -16,6 +28,7 @@
|
||||||
<input type="hidden" name="method" value="insertPoll" />
|
<input type="hidden" name="method" value="insertPoll" />
|
||||||
<input type="hidden" name="poll_srl" value="" />
|
<input type="hidden" name="poll_srl" value="" />
|
||||||
<input type="hidden" name="editor_sequence" value="{$editor_sequence}" />
|
<input type="hidden" name="editor_sequence" value="{$editor_sequence}" />
|
||||||
|
<input type="hidden" name="stop_date" id="stop_date" value="{date("Ymd",time()+60*60*24*30)}" />
|
||||||
|
|
||||||
<div id="popBody">
|
<div id="popBody">
|
||||||
|
|
||||||
|
|
@ -25,30 +38,20 @@
|
||||||
<tr>
|
<tr>
|
||||||
<th scope="row">{$lang->poll_stop_date}</th>
|
<th scope="row">{$lang->poll_stop_date}</th>
|
||||||
<td>
|
<td>
|
||||||
<ul class="buttonLeft nospace">
|
<div class="display_date" id="display_date">{date("Y-m-d",time()+60*60*24*30)}</div>
|
||||||
<li>
|
<script type="text/javascript">
|
||||||
<select name="stop_year">
|
Calendar.setup( { firstDay : 0, inputField : "stop_date", ifFormat : "%Y%m%d", displayArea : "display_date", daFormat : "%Y-%m-%d"});
|
||||||
<!--@for($i=date("Y");$i<date("Y")+10;$i++)-->
|
</script>
|
||||||
<option value="{$i}">{$i}</option>
|
</td>
|
||||||
<!--@end-->
|
</tr>
|
||||||
</select>
|
<tr>
|
||||||
</li>
|
<th scope="row">{$lang->skin}</th>
|
||||||
<li>
|
<td>
|
||||||
<select name="stop_month">
|
<select name="skin">
|
||||||
<!--@for($i=1;$i<=12;$i++)-->
|
<!--@foreach($skin_list as $skin=>$skin_info)-->
|
||||||
<option value="{$i}" <!--@if($i==date("m", time()+60*60*24*30))-->selected="selected"<!--@end-->>{$i}</option>
|
<option value="{$skin}">{$skin_info->title} (skin by {$skin_info->maker->name})</option>
|
||||||
<!--@end-->
|
<!--@end-->
|
||||||
</select>
|
</select>
|
||||||
</li>
|
|
||||||
<li>
|
|
||||||
<select name="stop_day">
|
|
||||||
<!--@for($i=1;$i<=31;$i++)-->
|
|
||||||
<option value="{$i}" <!--@if($i==date("d", time()+60*60*24*30))-->selected="selected"<!--@end-->>{$i}</option>
|
|
||||||
<!--@end-->
|
|
||||||
</select>
|
|
||||||
</li>
|
|
||||||
<li><a href="#" onclick="doPollAdd(); return false;">{$lang->cmd_add_poll}</a></li>
|
|
||||||
</ul>
|
|
||||||
</td>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
</table>
|
</table>
|
||||||
|
|
@ -76,25 +79,29 @@
|
||||||
</table>
|
</table>
|
||||||
|
|
||||||
<div class="pollButton clear">
|
<div class="pollButton clear">
|
||||||
<ul class="fl">
|
<div class="fl">
|
||||||
<li><a href="#" onclick="doPollAddItem(this); return false;">{$lang->cmd_add_item}</a></li>
|
<label>{$lang->poll_chk_count}</label>
|
||||||
</ul>
|
<input type="text" name="checkcount_tidx" value="1" size="1" class="inputTypeText" />
|
||||||
<ul class="fr">
|
</div>
|
||||||
<li><a href="#" onclick="doPollDelete(this); return false;">{$lang->cmd_del_poll}</a></li>
|
<div class="fr">
|
||||||
</ul>
|
<a href="#" onclick="doPollDelete(this); return false;" class="delPoll">{$lang->cmd_del_poll}</a> |
|
||||||
<ul class="fr">
|
<a href="#" onclick="doPollAddItem(this); return false;">{$lang->cmd_add_item}</a>
|
||||||
<li><label>{$lang->poll_chk_count}</label></li>
|
</div>
|
||||||
<li><input type="text" name="checkcount_tidx" value="1" size="1" class="inputTypeText" /></li>
|
<div class="clear"></div>
|
||||||
</ul>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div id="popFooter" class="tCenter">
|
<div id="popFooter" class="tCenter clear">
|
||||||
<span class="button"><input type="submit" value="{$lang->cmd_submit}" /></span>
|
<div class="fl">
|
||||||
<a href="#" onclick="window.close(); return false;" class="button"><span>{$lang->cmd_close}</span></a>
|
<a href="#" onclick="doPollAdd(); return false;" class="button"><span>{$lang->cmd_add_poll}</span></a>
|
||||||
<a href="#" onclick="winopen('./?module=editor&act=dispEditorComponentInfo&component_name={$component_info->component_name}','ComponentInfo','left=10,top=10,width=10,height=10,resizable=no,scrollbars=no,toolbars=no');return false;" class="button"><span>{$lang->about_component}</span></a>
|
</div>
|
||||||
|
<div class="fr">
|
||||||
|
<span class="button"><input type="submit" value="{$lang->cmd_submit}" /></span>
|
||||||
|
<a href="#" onclick="window.close(); return false;" class="button"><span>{$lang->cmd_close}</span></a>
|
||||||
|
<a href="#" onclick="winopen('./?module=editor&act=dispEditorComponentInfo&component_name={$component_info->component_name}','ComponentInfo','left=10,top=10,width=10,height=10,resizable=no,scrollbars=no,toolbars=no');return false;" class="button"><span>{$lang->about_component}</span></a>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -33,10 +33,13 @@ function setPoll() {
|
||||||
function completeInsertPoll(ret_obj) {
|
function completeInsertPoll(ret_obj) {
|
||||||
if(typeof(opener)=="undefined") return null;
|
if(typeof(opener)=="undefined") return null;
|
||||||
|
|
||||||
|
var fo_obj = xGetElementById('fo_component');
|
||||||
|
var skin = fo_obj.skin.options[fo_obj.skin.selectedIndex].value;
|
||||||
|
|
||||||
var poll_srl = ret_obj["poll_srl"];
|
var poll_srl = ret_obj["poll_srl"];
|
||||||
if(!poll_srl) return null;
|
if(!poll_srl) return null;
|
||||||
|
|
||||||
var text = "<img src=\"./common/tpl/images/blank.gif\" poll_srl=\""+poll_srl+"\" editor_component=\"poll_maker\" style=\"width:400px;height:300px;border:2px dotted #4371B9;background:url(./modules/editor/components/poll_maker/tpl/poll_maker_component.gif) no-repeat center;\" />";
|
var text = "<img src=\"./common/tpl/images/blank.gif\" poll_srl=\""+poll_srl+"\" editor_component=\"poll_maker\" skin=\""+skin+"\" style=\"width:400px;height:300px;border:2px dotted #4371B9;background:url(./modules/editor/components/poll_maker/tpl/poll_maker_component.gif) no-repeat center;\" />";
|
||||||
|
|
||||||
alert(ret_obj['message']);
|
alert(ret_obj['message']);
|
||||||
|
|
||||||
|
|
@ -79,7 +82,7 @@ function doPollAdd() {
|
||||||
* 항목 삭제
|
* 항목 삭제
|
||||||
**/
|
**/
|
||||||
function doPollDelete(obj) {
|
function doPollDelete(obj) {
|
||||||
var pobj = obj.parentNode.parentNode.parentNode.parentNode;
|
var pobj = obj.parentNode.parentNode.parentNode;
|
||||||
var tmp_arr = pobj.id.split('_');
|
var tmp_arr = pobj.id.split('_');
|
||||||
var index = tmp_arr[1];
|
var index = tmp_arr[1];
|
||||||
if(index==1) return;
|
if(index==1) return;
|
||||||
|
|
@ -103,7 +106,7 @@ function doPollDelete(obj) {
|
||||||
* 새 항목 추가
|
* 새 항목 추가
|
||||||
**/
|
**/
|
||||||
function doPollAddItem(obj) {
|
function doPollAddItem(obj) {
|
||||||
var tbl = xPrevSib(obj.parentNode.parentNode.parentNode);
|
var tbl = xPrevSib(obj.parentNode.parentNode);
|
||||||
var tbody = tbl.lastChild;
|
var tbody = tbl.lastChild;
|
||||||
var tmp = tbody.firstChild;
|
var tmp = tbody.firstChild;
|
||||||
var source = null;
|
var source = null;
|
||||||
|
|
|
||||||
|
|
@ -24,12 +24,8 @@
|
||||||
$upload_target_srl = $_SESSION['upload_info'][$editor_sequence]->upload_target_srl;
|
$upload_target_srl = $_SESSION['upload_info'][$editor_sequence]->upload_target_srl;
|
||||||
if(!$upload_target_srl) $upload_target_srl = getNextSequence();
|
if(!$upload_target_srl) $upload_target_srl = getNextSequence();
|
||||||
|
|
||||||
$stop_year = Context::get('stop_year');
|
$stop_date = Context::get('stop_date');
|
||||||
$stop_month = Context::get('stop_month');
|
if($stop_date < date("Ymd")) $stop_date = date("YmdHis", time()+60*60*24*365);
|
||||||
$stop_day = Context::get('stop_day');
|
|
||||||
|
|
||||||
$stop_date = sprintf('%04d%02d%02d235959', $stop_year, $stop_month, $stop_day);
|
|
||||||
if($stop_date < date("YmdHis")) $stop_date = date("YmdHis", time()+60*60*24*365);
|
|
||||||
|
|
||||||
$vars = Context::getRequestVars();
|
$vars = Context::getRequestVars();
|
||||||
foreach($vars as $key => $val) {
|
foreach($vars as $key => $val) {
|
||||||
|
|
@ -111,17 +107,6 @@
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 작성자의 정보를 로그로 남김
|
|
||||||
/*
|
|
||||||
$log_args->poll_srl = $poll_srl;
|
|
||||||
$log_args->member_srl = $member_srl;
|
|
||||||
$output = executeQuery('poll.insertPollLog', $log_args);
|
|
||||||
if(!$output->toBool()) {
|
|
||||||
$oDB->rollback();
|
|
||||||
return $output;
|
|
||||||
}
|
|
||||||
*/
|
|
||||||
|
|
||||||
$oDB->commit();
|
$oDB->commit();
|
||||||
|
|
||||||
$this->add('poll_srl', $poll_srl);
|
$this->add('poll_srl', $poll_srl);
|
||||||
|
|
@ -198,9 +183,11 @@
|
||||||
**/
|
**/
|
||||||
function procPollViewResult() {
|
function procPollViewResult() {
|
||||||
$poll_srl = Context::get('poll_srl');
|
$poll_srl = Context::get('poll_srl');
|
||||||
|
$skin = Context::get('skin');
|
||||||
|
if(!$skin || !is_dir('./modules/poll/skins/'.$skin)) $skin = 'default';
|
||||||
|
|
||||||
$oPollModel = &getModel('poll');
|
$oPollModel = &getModel('poll');
|
||||||
$tpl = $oPollModel->getPollResultHtml($poll_srl);
|
$tpl = $oPollModel->getPollResultHtml($poll_srl, $skin);
|
||||||
|
|
||||||
$this->add('poll_srl', $poll_srl);
|
$this->add('poll_srl', $poll_srl);
|
||||||
$this->add('tpl',$tpl);
|
$this->add('tpl',$tpl);
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,6 @@
|
||||||
* @brief 이미 설문 조사를 하였는지 검사하는 함수
|
* @brief 이미 설문 조사를 하였는지 검사하는 함수
|
||||||
**/
|
**/
|
||||||
function isPolled($poll_srl) {
|
function isPolled($poll_srl) {
|
||||||
|
|
||||||
$args->poll_srl = $poll_srl;
|
$args->poll_srl = $poll_srl;
|
||||||
|
|
||||||
if(Context::get('is_logged')) {
|
if(Context::get('is_logged')) {
|
||||||
|
|
@ -35,7 +34,7 @@
|
||||||
* @brief 설문조사의 html데이터를 return
|
* @brief 설문조사의 html데이터를 return
|
||||||
* 설문조사에 응하였는지에 대한 체크를 한 후 결과를 return
|
* 설문조사에 응하였는지에 대한 체크를 한 후 결과를 return
|
||||||
**/
|
**/
|
||||||
function getPollHtml($poll_srl, $style = '') {
|
function getPollHtml($poll_srl, $style = '', $skin = 'default') {
|
||||||
|
|
||||||
$args->poll_srl = $poll_srl;
|
$args->poll_srl = $poll_srl;
|
||||||
|
|
||||||
|
|
@ -64,7 +63,7 @@
|
||||||
$poll->poll_srl = $poll_srl;
|
$poll->poll_srl = $poll_srl;
|
||||||
|
|
||||||
// 종료일이 지났으면 무조건 결과만
|
// 종료일이 지났으면 무조건 결과만
|
||||||
if($poll->stop_date > date("YmdHis")) {
|
if($poll->stop_date > date("Ymd")) {
|
||||||
if($this->isPolled($poll_srl)) $tpl_file = "result";
|
if($this->isPolled($poll_srl)) $tpl_file = "result";
|
||||||
else $tpl_file = "form";
|
else $tpl_file = "form";
|
||||||
} else {
|
} else {
|
||||||
|
|
@ -72,13 +71,10 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
Context::set('poll',$poll);
|
Context::set('poll',$poll);
|
||||||
|
Context::set('skin',$skin);
|
||||||
|
|
||||||
// 기본 설정의 스킨, 컬러셋 설정
|
// 기본 설정의 스킨, 컬러셋 설정
|
||||||
$oModuleModel = &getModel('module');
|
$tpl_path = sprintf("%sskins/%s/", $this->module_path, $skin);
|
||||||
$poll_config = $oModuleModel->getModuleConfig('poll');
|
|
||||||
if(!$poll_config->skin) $poll_config->skin = 'default';
|
|
||||||
Context::set('poll_config', $poll_config);
|
|
||||||
$tpl_path = sprintf("%sskins/%s/", $this->module_path, $poll_config->skin);
|
|
||||||
|
|
||||||
$oTemplate = &TemplateHandler::getInstance();
|
$oTemplate = &TemplateHandler::getInstance();
|
||||||
return $oTemplate->compile($tpl_path, $tpl_file);
|
return $oTemplate->compile($tpl_path, $tpl_file);
|
||||||
|
|
@ -87,7 +83,7 @@
|
||||||
/**
|
/**
|
||||||
* @brief 결과 html을 return
|
* @brief 결과 html을 return
|
||||||
**/
|
**/
|
||||||
function getPollResultHtml($poll_srl) {
|
function getPollResultHtml($poll_srl, $skin = 'default') {
|
||||||
$args->poll_srl = $poll_srl;
|
$args->poll_srl = $poll_srl;
|
||||||
|
|
||||||
// 해당 설문조사에 대한 내용을 조사
|
// 해당 설문조사에 대한 내용을 조사
|
||||||
|
|
@ -119,11 +115,7 @@
|
||||||
Context::set('poll',$poll);
|
Context::set('poll',$poll);
|
||||||
|
|
||||||
// 기본 설정의 스킨, 컬러셋 설정
|
// 기본 설정의 스킨, 컬러셋 설정
|
||||||
$oModuleModel = &getModel('module');
|
$tpl_path = sprintf("%sskins/%s/", $this->module_path, $skin);
|
||||||
$poll_config = $oModuleModel->getModuleConfig('poll');
|
|
||||||
if(!$poll_config->skin) $poll_config->skin = 'default';
|
|
||||||
Context::set('poll_config', $poll_config);
|
|
||||||
$tpl_path = sprintf("%sskins/%s/", $this->module_path, $poll_config->skin);
|
|
||||||
|
|
||||||
$oTemplate = &TemplateHandler::getInstance();
|
$oTemplate = &TemplateHandler::getInstance();
|
||||||
return $oTemplate->compile($tpl_path, $tpl_file);
|
return $oTemplate->compile($tpl_path, $tpl_file);
|
||||||
|
|
|
||||||
|
|
@ -11,6 +11,7 @@
|
||||||
<form action="./" method="get" onsubmit="return doPoll(this)">
|
<form action="./" method="get" onsubmit="return doPoll(this)">
|
||||||
<input type="hidden" name="poll_srl" value="{$poll->poll_srl}" />
|
<input type="hidden" name="poll_srl" value="{$poll->poll_srl}" />
|
||||||
<input type="hidden" name="poll_srl_indexes" value="" />
|
<input type="hidden" name="poll_srl_indexes" value="" />
|
||||||
|
<input type="hidden" name="skin" value="{$skin}" />
|
||||||
|
|
||||||
<table cellspacing="0" class="poll_table">
|
<table cellspacing="0" class="poll_table">
|
||||||
<col width="7" />
|
<col width="7" />
|
||||||
|
|
@ -23,7 +24,7 @@
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td class="title" colspan="3">
|
<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>
|
</td>
|
||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
|
|
@ -66,7 +67,7 @@
|
||||||
<tr>
|
<tr>
|
||||||
<td colspan="3" class="poll_button">
|
<td colspan="3" class="poll_button">
|
||||||
<div>
|
<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>
|
<span class="button"><input type="submit" value="{$lang->cmd_apply_poll}" class="poll_button" /></span>
|
||||||
</div>
|
</div>
|
||||||
</td>
|
</td>
|
||||||
|
|
|
||||||
|
|
@ -51,10 +51,13 @@ function completePoll(ret_obj) {
|
||||||
}
|
}
|
||||||
|
|
||||||
/* 설문 미리 보기 */
|
/* 설문 미리 보기 */
|
||||||
function doPollViewResult(poll_srl) {
|
function doPollViewResult(poll_srl, skin) {
|
||||||
var params = new Array();
|
var params = new Array();
|
||||||
params['poll_srl'] = poll_srl;
|
params['poll_srl'] = poll_srl;
|
||||||
|
|
||||||
|
if(typeof(skin)=='undefined') skin = 'default';
|
||||||
|
params['skin'] = skin;
|
||||||
|
|
||||||
var response_tags = new Array('error','message','poll_srl', 'tpl');
|
var response_tags = new Array('error','message','poll_srl', 'tpl');
|
||||||
|
|
||||||
exec_xml('poll','procPollViewResult', params, completePoll, response_tags);
|
exec_xml('poll','procPollViewResult', params, completePoll, response_tags);
|
||||||
|
|
|
||||||
BIN
modules/poll/skins/simple/css/.poll.css.swp
Normal file
BIN
modules/poll/skins/simple/css/.poll.css.swp
Normal file
Binary file not shown.
26
modules/poll/skins/simple/css/poll.css
Normal file
26
modules/poll/skins/simple/css/poll.css
Normal 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; }
|
||||||
10
modules/poll/skins/simple/filter/poll.xml
Normal file
10
modules/poll/skins/simple/filter/poll.xml
Normal 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>
|
||||||
61
modules/poll/skins/simple/form.html
Normal file
61
modules/poll/skins/simple/form.html
Normal 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>
|
||||||
BIN
modules/poll/skins/simple/images/color_bar.png
Executable file
BIN
modules/poll/skins/simple/images/color_bar.png
Executable file
Binary file not shown.
|
After Width: | Height: | Size: 328 B |
64
modules/poll/skins/simple/js/poll.js
Normal file
64
modules/poll/skins/simple/js/poll.js
Normal 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);
|
||||||
|
}
|
||||||
36
modules/poll/skins/simple/result.html
Normal file
36
modules/poll/skins/simple/result.html
Normal 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>
|
||||||
16
modules/poll/skins/simple/skin.xml
Normal file
16
modules/poll/skins/simple/skin.xml
Normal 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>
|
||||||
Loading…
Add table
Add a link
Reference in a new issue