mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-07 18:51:41 +09:00
Enhance poll v.2
https://github.com/xetown/xe-core/issues/24 - multilangual support - methods names - some enhancements
This commit is contained in:
parent
563ba0f753
commit
f870b768ac
6 changed files with 54 additions and 16 deletions
|
|
@ -2033,6 +2033,15 @@
|
|||
<value xml:lang="vi"><![CDATA[Ngày gửi]]></value>
|
||||
<value xml:lang="mn"><![CDATA[Оруулсан өдөр]]></value>
|
||||
</item>
|
||||
<item name="anonymous">
|
||||
<value xml:lang="ko"><![CDATA[익명]]></value>
|
||||
<value xml:lang="en"><![CDATA[Anonymous]]></value>
|
||||
<value xml:lang="jp"><![CDATA[匿名]]></value>
|
||||
<value xml:lang="zh-CN"><![CDATA[匿名]]></value>
|
||||
<value xml:lang="zh-TW"><![CDATA[匿名]]></value>
|
||||
<value xml:lang="tr"><![CDATA[Anonim]]></value>
|
||||
<value xml:lang="vi"><![CDATA[Anonymous]]></value>
|
||||
</item>
|
||||
<item name="last_update">
|
||||
<value xml:lang="ko"><![CDATA[최근 수정일]]></value>
|
||||
<value xml:lang="en"><![CDATA[Last Update]]></value>
|
||||
|
|
|
|||
|
|
@ -82,6 +82,30 @@
|
|||
<value xml:lang="en"><![CDATA[Delete last item]]></value>
|
||||
<value xml:lang="jp"><![CDATA[最後の項目削除]]></value>
|
||||
</item>
|
||||
<item name="poll_display_memberinfo">
|
||||
<value xml:lang="ko"><![CDATA[공개 투표]]></value>
|
||||
<value xml:lang="en"><![CDATA[Open ballot]]></value>
|
||||
</item>
|
||||
<item name="poll_display_memberinfo_yes">
|
||||
<value xml:lang="ko"><![CDATA[투표한 사용자 공개]]></value>
|
||||
<value xml:lang="en"><![CDATA[Display who votes]]></value>
|
||||
</item>
|
||||
<item name="poll_display_memberinfo_no">
|
||||
<value xml:lang="ko"><![CDATA[투표한 사용자 비공개]]></value>
|
||||
<value xml:lang="en"><![CDATA[Do not display who votes]]></value>
|
||||
</item>
|
||||
<item name="poll_ableto_additems">
|
||||
<value xml:lang="ko"><![CDATA[항목 추가]]></value>
|
||||
<value xml:lang="en"><![CDATA[Able to add items]]></value>
|
||||
</item>
|
||||
<item name="poll_ableto_additems_yes">
|
||||
<value xml:lang="ko"><![CDATA[항목 추가 가능]]></value>
|
||||
<value xml:lang="en"><![CDATA[Voters can add items]]></value>
|
||||
</item>
|
||||
<item name="poll_ableto_additems_no">
|
||||
<value xml:lang="ko"><![CDATA[항목 추가 금지]]></value>
|
||||
<value xml:lang="en"><![CDATA[Voters cannot add items]]></value>
|
||||
</item>
|
||||
<item name="msg_poll_cannot_modify">
|
||||
<value xml:lang="ko"><![CDATA[설문조사는 수정할 수 없습니다. 삭제 후 다시 생성해야 합니다.]]></value>
|
||||
<value xml:lang="en"><![CDATA[You cannot modify the poll. You need to delete it and create a new one.]]></value>
|
||||
|
|
|
|||
|
|
@ -53,17 +53,17 @@ $(function(){
|
|||
</div>
|
||||
|
||||
<div class="x_control-group">
|
||||
<label class="x_control-label">사용자 공개</label>
|
||||
<label class="x_control-label">{$lang->poll_display_memberinfo}</label>
|
||||
<div class="x_controls">
|
||||
<input type="radio" name="show_vote" value="1" /> 투표한 사용자 공개
|
||||
<input type="radio" name="show_vote" value="0" checked="checked" /> 투표한 사용자 비공개
|
||||
<input type="radio" name="show_vote" value="1" id="poll_display_memberinfo_yes" /> <label class="x_inline" for="poll_display_memberinfo_yes">{$lang->poll_display_memberinfo_yes}</label>
|
||||
<input type="radio" name="show_vote" value="0" checked="checked" id="poll_display_memberinfo_no" /> <label class="x_inline" for="poll_display_memberinfo_no">{$lang->poll_display_memberinfo_no}</label>
|
||||
</div>
|
||||
</div>
|
||||
<div class="x_control-group">
|
||||
<label class="x_control-label">항목 추가</label>
|
||||
<label class="x_control-label">{$lang->poll_ableto_additems}</label>
|
||||
<div class="x_controls">
|
||||
<input type="radio" name="add_item" value="2" /> 항목 추가 가능
|
||||
<input type="radio" name="add_item" value="0" checked="checked" /> 항목 추가 금지
|
||||
<input type="radio" name="add_item" value="2" id="poll_ableto_additems_yes" /> <label class="x_inline" for="poll_ableto_additems_yes">{$lang->poll_ableto_additems_yes}</label>
|
||||
<input type="radio" name="add_item" value="0" checked="checked" id="poll_ableto_additems_no" /> <label class="x_inline" for="poll_ableto_additems_no">{$lang->poll_ableto_additems_no}</label>
|
||||
</div>
|
||||
</div>
|
||||
<div id="poll_source" style="display:none">
|
||||
|
|
|
|||
|
|
@ -115,12 +115,18 @@ class poll extends ModuleObject
|
|||
{
|
||||
}
|
||||
|
||||
function isCangetMemberInfo($type)
|
||||
/**
|
||||
* @brief Check if this poll could display member information
|
||||
*/
|
||||
function checkMemberInfo($type)
|
||||
{
|
||||
return ($type==1 || $type==3);
|
||||
}
|
||||
|
||||
function isCanAddItem($type)
|
||||
/**
|
||||
* @brief Check if the items of this poll could be added by members.
|
||||
*/
|
||||
function isAbletoAddItem($type)
|
||||
{
|
||||
return ($type==2 || $type==3);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -118,7 +118,6 @@ class pollController extends poll
|
|||
$poll_args->poll_type = $vars->show_vote + $vars->add_item;
|
||||
|
||||
$output = executeQuery('poll.insertPoll', $poll_args);
|
||||
debugPrint($output);
|
||||
if(!$output->toBool())
|
||||
{
|
||||
$oDB->rollback();
|
||||
|
|
@ -190,7 +189,7 @@ class pollController extends poll
|
|||
if(!$output->data) return new Object(-1,"poll_no_poll_or_deleted_poll");
|
||||
$type = $output->data->poll_type;
|
||||
|
||||
if(!$this->isCanAddItem($type)) return new Object(-1,"msg_cannot_add_item");
|
||||
if(!$this->isAbletoAddItem($type)) return new Object(-1,"msg_cannot_add_item");
|
||||
|
||||
if($logged_info->is_admin != 'Y')
|
||||
{
|
||||
|
|
|
|||
|
|
@ -65,7 +65,7 @@ class pollModel extends poll
|
|||
}
|
||||
|
||||
$poll->poll_srl = $poll_srl;
|
||||
$caniadditem = $this->isCanAddItem($poll->poll_type) && !!$logged_info->member_srl;
|
||||
$caniadditem = $this->isAbletoAddItem($poll->poll_type) && !!$logged_info->member_srl;
|
||||
|
||||
$oPollModel = getModel('poll');
|
||||
if($oPollModel->isPolled($poll_srl)) $poll->is_polled = 1;
|
||||
|
|
@ -96,7 +96,7 @@ class pollModel extends poll
|
|||
|
||||
$poll = new stdClass();
|
||||
|
||||
if($this->isCangetMemberInfo($type))
|
||||
if($this->checkMemberInfo($type))
|
||||
{
|
||||
$pollvar = new stdClass;
|
||||
$pollvar->poll_srl = $poll_srl;
|
||||
|
|
@ -123,18 +123,18 @@ class pollModel extends poll
|
|||
{
|
||||
if(Context::get('logged_info')->is_admin === "Y")
|
||||
{
|
||||
$ip = (int) str_replace(".","",$value->ip_address);
|
||||
$ip = md5($value->ip_address);
|
||||
$poll->member[$ip] = new stdClass();
|
||||
$poll->member[$ip]->member_srl = 0;
|
||||
$poll->member[$ip]->nick_name = $value->ip_address;
|
||||
$poll->member[$ip]->nick_name = Context::getLang("anonymous") . ' IP: ' . $value->ip_address;
|
||||
$poll->member[$ip]->profile_image = "";
|
||||
}
|
||||
else
|
||||
{
|
||||
$ip = md5(str_replace(".","",$value->ip_address));
|
||||
$ip = md5($value->ip_address);
|
||||
$poll->member[$ip] = new stdClass();
|
||||
$poll->member[$ip]->member_srl = 0;
|
||||
$poll->member[$ip]->nick_name = "Anonymous";
|
||||
$poll->member[$ip]->nick_name = Context::getLang("anonymous");
|
||||
$poll->member[$ip]->profile_image = "";
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue