merge from 1.7.3.5(r13153:r13167)

git-svn-id: http://xe-core.googlecode.com/svn/trunk@13168 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
ngleader 2013-09-29 23:32:39 +00:00
parent cc47d2b247
commit 2d3f149b5a
2042 changed files with 129266 additions and 126243 deletions

View file

@ -9,7 +9,7 @@
<title xml:lang="ru">Опрос</title>
<title xml:lang="zh-TW">投票調查</title>
<title xml:lang="tr">Oylama</title>
<description xml:lang="ko">설문조사 관리 모듈</description>
<description xml:lang="ko">설문조사 관리</description>
<description xml:lang="zh-CN">管理投票调查的模块。</description>
<description xml:lang="jp">アンケート管理モジュール</description>
<description xml:lang="en">This module is for managering polls.</description>

View file

@ -95,7 +95,7 @@
<value xml:lang="vi"><![CDATA[Xem kết quả]]></value>
</item>
<item name="success_poll">
<value xml:lang="ko"><![CDATA[설문에 응하여 주셔서 감사합니다.]]></value>
<value xml:lang="ko"><![CDATA[설문 응답 감사합니다.]]></value>
<value xml:lang="en"><![CDATA[Thank you for joining the poll.]]></value>
<value xml:lang="jp"><![CDATA[アンケート調査へのご応募ありがとうございます。]]></value>
<value xml:lang="zh-CN"><![CDATA[感谢您参与投票。]]></value>
@ -107,7 +107,7 @@
<value xml:lang="vi"><![CDATA[Cảm ơn bạn đã tham gia thăm dò.]]></value>
</item>
<item name="msg_already_poll">
<value xml:lang="ko"><![CDATA[이미 설문조사를 하셨습니다.]]></value>
<value xml:lang="ko"><![CDATA[이미 설문조사를 습니다.]]></value>
<value xml:lang="en"><![CDATA[You already polled!]]></value>
<value xml:lang="jp"><![CDATA[既にアンケート調査に応募しました。]]></value>
<value xml:lang="zh-CN"><![CDATA[不能重复投票!]]></value>
@ -118,7 +118,7 @@
<value xml:lang="tr"><![CDATA[Zaten oylamada bulundunuz!]]></value>
<value xml:lang="vi"><![CDATA[Bạn đã bỏ phiếu rồi!]]></value>
</item>
<item name="msg_cart_is_null">
<item name="msg_poll_is_null">
<value xml:lang="ko"><![CDATA[삭제할 설문을 선택해주세요.]]></value>
<value xml:lang="en"><![CDATA[Please select a poll to delete.]]></value>
<value xml:lang="jp"><![CDATA[削除するアンケートを選択してください。]]></value>
@ -142,6 +142,9 @@
<value xml:lang="tr"><![CDATA[%d oylama silindi.]]></value>
<value xml:lang="vi"><![CDATA[%d đã được xóa.]]></value>
</item>
<item name="confirm_poll_delete">
<value xml:lang="ko"><![CDATA[%s개의 설문을 삭제하시겠습니까?]]></value>
</item>
<item name="msg_check_poll_item">
<value xml:lang="ko"><![CDATA[설문에 응할 항목을 선택하여 주세요. (설문조사 마다 필수 선택항목이 다를 수 있습니다.)]]></value>
<value xml:lang="en"><![CDATA[Please select a poll item to poll.\n(Required poll item(s) may be different in each poll.)]]></value>
@ -155,7 +158,7 @@
<value xml:lang="vi"><![CDATA[Xin hãy chọn những mục để tạo thăm dò.\n(Yêu cầu những mục để tạo thăm dò phải là những mục chưa được tạo.)]]></value>
</item>
<item name="msg_poll_not_exists">
<value xml:lang="ko"><![CDATA[선택하신 설문이 존재하지 않습니다.]]></value>
<value xml:lang="ko"><![CDATA[선택 설문이 존재하지 않습니다.]]></value>
<value xml:lang="en"><![CDATA[The selected poll does not exist.]]></value>
<value xml:lang="jp"><![CDATA[選択したアンケートは存在しません。]]></value>
<value xml:lang="zh-CN"><![CDATA[您选择的问卷不存在!]]></value>
@ -190,7 +193,7 @@
<value xml:lang="tr"><![CDATA[Oylamayı göndermeyi onaylıyor musunuz?]]></value>
<value xml:lang="vi"><![CDATA[Bạn có chắc chắn muốn gửi thăm dò?]]></value>
</item>
<item name="search_target_list" type="array">
<item name="search_poll_target_list" type="array">
<item name="title">
<value xml:lang="ko"><![CDATA[제목]]></value>
<value xml:lang="en"><![CDATA[Title]]></value>
@ -240,16 +243,11 @@
<value xml:lang="jp"><![CDATA[複数選択]]></value>
<value xml:lang="zh-TW"><![CDATA[複選]]></value>
</item>
<item name="poll_manager">
<value xml:lang="ko"><![CDATA[선택한 설문 관리]]></value>
<value xml:lang="en"><![CDATA[Manage selected poll]]></value>
<value xml:lang="jp"><![CDATA[選択したアンケートの管理]]></value>
<value xml:lang="zh-TW"><![CDATA[管理所選投票]]></value>
</item>
<item name="selected_poll">
<value xml:lang="ko"><![CDATA[선택한 설문]]></value>
<value xml:lang="en"><![CDATA[Selected poll]]></value>
<value xml:lang="jp"><![CDATA[選択したアンケート]]></value>
<value xml:lang="zh-TW"><![CDATA[已選擇的投票]]></value>
</item>
</lang>
</lang>

View file

@ -1,159 +1,171 @@
<?php
/**
* @class pollAdminController
* @author NHN (developers@xpressengine.com)
* @brief The admin controller class of the poll module
**/
/**
* @class pollAdminController
* @author NHN (developers@xpressengine.com)
* @brief The admin controller class of the poll module
*/
class pollAdminController extends poll
{
/**
* @brief Initialization
*/
function init()
{
}
class pollAdminController extends poll {
/**
* @brief Save the configurations
*/
function procPollAdminInsertConfig()
{
$config->skin = Context::get('skin');
$config->colorset = Context::get('colorset');
/**
* @brief Initialization
**/
function init() {
}
$oModuleController = &getController('module');
$oModuleController->insertModuleConfig('poll', $config);
/**
* @brief Save the configurations
**/
function procPollAdminInsertConfig() {
$config->skin = Context::get('skin');
$config->colorset = Context::get('colorset');
$this->setMessage('success_updated');
$oModuleController = &getController('module');
$oModuleController->insertModuleConfig('poll', $config);
$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'module', 'admin', 'act', 'dispPollAdminConfig');
$this->setRedirectUrl($returnUrl);
}
$this->setMessage('success_updated');
/**
* @brief Delete the polls selected in the administrator's page
*/
function procPollAdminDeleteChecked()
{
// Display an error no post is selected
$cart = Context::get('cart');
$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'module', 'admin', 'act', 'dispPollAdminConfig');
$this->setRedirectUrl($returnUrl);
}
if(is_array($cart)) $poll_srl_list = $cart;
else $poll_srl_list= explode('|@|', $cart);
/**
* @brief Delete the polls selected in the administrator's page
**/
function procPollAdminDeleteChecked() {
// Display an error no post is selected
$cart = Context::get('cart');
if(is_array($cart)) $poll_srl_list = $cart;
else $poll_srl_list= explode('|@|', $cart);
$poll_count = count($poll_srl_list);
if(!$poll_count) return $this->stop('msg_cart_is_null');
// Delete the post
for($i=0;$i<$poll_count;$i++) {
$poll_index_srl = trim($poll_srl_list[$i]);
if(!$poll_index_srl) continue;
$output = $this->deletePollTitle($poll_index_srl, true);
if(!$output->toBool()) return $output;
}
$this->setMessage( sprintf(Context::getLang('msg_checked_poll_is_deleted'), $poll_count) );
$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'module', 'admin', 'act', 'dispPollAdminList');
$this->setRedirectUrl($returnUrl);
}
function procPollAdminAddCart()
$poll_count = count($poll_srl_list);
if(!$poll_count) return $this->stop('msg_cart_is_null');
// Delete the post
for($i=0;$i<$poll_count;$i++)
{
$poll_index_srl = (int)Context::get('poll_index_srl');
$poll_index_srl = trim($poll_srl_list[$i]);
if(!$poll_index_srl) continue;
$oPollAdminModel = &getAdminModel('poll');
//$columnList = array('comment_srl');
$args->pollIndexSrlList = array($poll_index_srl);
$args->list_count = 100;
$output = $oPollAdminModel->getPollList($args);
if(is_array($output->data))
{
foreach($output->data AS $key=>$value)
{
if($_SESSION['poll_management'][$value->poll_index_srl]) unset($_SESSION['poll_management'][$value->poll_index_srl]);
else $_SESSION['poll_management'][$value->poll_index_srl] = true;
}
}
$output = $this->deletePollTitle($poll_index_srl, true);
if(!$output->toBool()) return $output;
}
/**
* @brief Delete the poll (when several questions are registered in one poll, delete this question)
**/
function deletePollTitle($poll_index_srl)
$this->setMessage( sprintf(Context::getLang('msg_checked_poll_is_deleted'), $poll_count) );
$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'module', 'admin', 'act', 'dispPollAdminList');
$this->setRedirectUrl($returnUrl);
}
function procPollAdminAddCart()
{
$poll_index_srl = (int)Context::get('poll_index_srl');
$oPollAdminModel = &getAdminModel('poll');
//$columnList = array('comment_srl');
$args->pollIndexSrlList = array($poll_index_srl);
$args->list_count = 100;
$output = $oPollAdminModel->getPollList($args);
if(is_array($output->data))
{
$args->poll_index_srl = $poll_index_srl;
$oDB = &DB::getInstance();
$oDB->begin();
$output = executeQueryArray('poll.getPollByDeletePollTitle', $args);
if($output->toBool() && $output->data && $output->data[0]->count == 1)
foreach($output->data AS $key=>$value)
{
$dargs->poll_srl = $output->data[0]->poll_srl;
if($_SESSION['poll_management'][$value->poll_index_srl]) unset($_SESSION['poll_management'][$value->poll_index_srl]);
else $_SESSION['poll_management'][$value->poll_index_srl] = true;
}
}
}
/**
* @brief Delete the poll (when several questions are registered in one poll, delete this question)
*/
function deletePollTitle($poll_index_srl)
{
$args->poll_index_srl = $poll_index_srl;
$oDB = &DB::getInstance();
$oDB->begin();
$output = executeQueryArray('poll.getPollByDeletePollTitle', $args);
if($output->toBool() && $output->data && $output->data[0]->count == 1)
{
$dargs->poll_srl = $output->data[0]->poll_srl;
}
$output = $oDB->executeQuery('poll.deletePollTitle', $args);
if(!$output)
{
$oDB->rollback();
return $output;
}
$output = $oDB->executeQuery('poll.deletePollItem', $args);
if(!$output)
{
$oDB->rollback();
return $output;
}
if($dargs->poll_srl)
{
$output = executeQuery('poll.deletePoll', $dargs);
if(!$output)
{
$oDB->rollback();
return $output;
}
$output = $oDB->executeQuery('poll.deletePollTitle', $args);
if(!$output) {
$oDB->rollback();
return $output;
}
$output = $oDB->executeQuery('poll.deletePollItem', $args);
if(!$output) {
$oDB->rollback();
return $output;
}
if($dargs->poll_srl)
$output = executeQuery('poll.deletePollLog', $dargs);
if(!$output)
{
$output = executeQuery('poll.deletePoll', $dargs);
if(!$output) {
$oDB->rollback();
return $output;
}
$output = executeQuery('poll.deletePollLog', $dargs);
if(!$output) {
$oDB->rollback();
return $output;
}
$oDB->rollback();
return $output;
}
$oDB->commit();
}
$oDB->commit();
return new Object();
}
return new Object();
}
/**
* @brief Delete the poll (delete the entire poll)
**/
function deletePoll($poll_srl) {
$args->poll_srl = $poll_srl;
/**
* @brief Delete the poll (delete the entire poll)
*/
function deletePoll($poll_srl)
{
$args->poll_srl = $poll_srl;
$oDB = &DB::getInstance();
$oDB->begin();
$oDB = &DB::getInstance();
$oDB->begin();
$output = $oDB->executeQuery('poll.deletePoll', $args);
if(!$output) {
$oDB->rollback();
return $output;
}
$output = $oDB->executeQuery('poll.deletePoll', $args);
if(!$output)
{
$oDB->rollback();
return $output;
}
$output = $oDB->executeQuery('poll.deletePollTitle', $args);
if(!$output) {
$oDB->rollback();
return $output;
}
$output = $oDB->executeQuery('poll.deletePollTitle', $args);
if(!$output)
{
$oDB->rollback();
return $output;
}
$output = $oDB->executeQuery('poll.deletePollItem', $args);
if(!$output) {
$oDB->rollback();
return $output;
}
$output = $oDB->executeQuery('poll.deletePollItem', $args);
if(!$output)
{
$oDB->rollback();
return $output;
}
$oDB->commit();
$oDB->commit();
return new Object();
}
}
?>
return new Object();
}
}
/* End of file poll.admin.controller.php */
/* Location: ./modules/poll/poll.admin.controller.php */

View file

@ -1,61 +1,67 @@
<?php
/**
* @class pollAdminModel
* @author NHN (developers@xpressengine.com)
* @brief The admin model class of the poll module
**/
/**
* @class pollAdminModel
* @author NHN (developers@xpressengine.com)
* @brief The admin model class of the poll module
*/
class pollAdminModel extends poll
{
/**
* @brief Initialization
*/
function init()
{
}
class pollAdminModel extends poll {
/**
* @brief Get the list of polls
*/
function getPollList($args)
{
$output = executeQueryArray('poll.getPollList', $args);
if(!$output->toBool()) return $output;
/**
* @brief Initialization
**/
function init() {
}
//if($output->data && !is_array($output->data)) $output->data = array($output->data);
return $output;
}
/**
* @brief Get the list of polls
**/
function getPollList($args) {
$output = executeQueryArray('poll.getPollList', $args);
if(!$output->toBool()) return $output;
/**
* @brief Get the list of polls with member info
*/
function getPollListWithMember($args)
{
$output = executeQueryArray('poll.getPollListWithMember', $args);
if(!$output->toBool()) return $output;
//if($output->data && !is_array($output->data)) $output->data = array($output->data);
return $output;
}
return $output;
}
/**
* @brief Get the list of polls with member info
**/
function getPollListWithMember($args)
/**
* @brief Get the original poll
*/
function getPollAdminTarget()
{
$poll_srl = Context::get('poll_srl');
$upload_target_srl = Context::get('upload_target_srl');
$oDocumentModel = &getModel('document');
$oCommentModel = &getModel('comment');
$oDocument = $oDocumentModel->getDocument($upload_target_srl);
if(!$oDocument->isExists()) $oComment = $oCommentModel->getComment($upload_target_srl);
if($oComment && $oComment->isExists())
{
$output = executeQueryArray('poll.getPollListWithMember', $args);
if(!$output->toBool()) return $output;
return $output;
$this->add('document_srl', $oComment->get('document_srl'));
$this->add('comment_srl', $oComment->get('comment_srl'));
}
/**
* @brief Get the original poll
**/
function getPollAdminTarget() {
$poll_srl = Context::get('poll_srl');
$upload_target_srl = Context::get('upload_target_srl');
$oDocumentModel = &getModel('document');
$oCommentModel = &getModel('comment');
$oDocument = $oDocumentModel->getDocument($upload_target_srl);
if(!$oDocument->isExists()) $oComment = $oCommentModel->getComment($upload_target_srl);
if($oComment && $oComment->isExists()) {
$this->add('document_srl', $oComment->get('document_srl'));
$this->add('comment_srl', $oComment->get('comment_srl'));
} elseif($oDocument->isExists()) {
$this->add('document_srl', $oDocument->get('document_srl'));
} else return new Object(-1, 'msg_not_founded');
}
}
?>
elseif($oDocument->isExists())
{
$this->add('document_srl', $oDocument->get('document_srl'));
}
else return new Object(-1, 'msg_not_founded');
}
}
/* End of file poll.admin.model.php */
/* Location: ./modules/poll/poll.admin.model.php */

View file

@ -1,160 +1,168 @@
<?php
/**
* @class pollAdminView
* @author NHN (developers@xpressengine.com)
* @brief The admin view class of the poll module
**/
/**
* @class pollAdminView
* @author NHN (developers@xpressengine.com)
* @brief The admin view class of the poll module
*/
class pollAdminView extends poll
{
/**
* @brief Initialization
*/
function init()
{
}
class pollAdminView extends poll {
/**
* @brief Administrator's Page
*/
function dispPollAdminList()
{
// Arrange the search options
$search_target = trim(Context::get('search_target'));
$search_keyword = trim(Context::get('search_keyword'));
/**
* @brief Initialization
**/
function init() {
}
/**
* @brief Administrator's Page
**/
function dispPollAdminList() {
// Arrange the search options
$search_target = trim(Context::get('search_target'));
$search_keyword = trim(Context::get('search_keyword'));
if($search_target && $search_keyword) {
switch($search_target) {
case 'title' :
if($search_keyword) $search_keyword = str_replace(' ','%',$search_keyword);
$args->s_title= $search_keyword;
break;
case 'regdate' :
$args->s_regdate = $search_keyword;
break;
case 'ipaddress' :
$args->s_ipaddress= $search_keyword;
break;
}
}
// Options to get a list of pages
$args->page = Context::get('page');
$args->list_count = 50; // The number of posts to show on one page
$args->page_count = 10; // The number of pages to display in the page navigation
$args->sort_index = 'P.list_order'; // Sorting value
// Get the list
$oPollAdminModel = &getAdminModel('poll');
$output = $oPollAdminModel->getPollListWithMember($args);
// check poll type. document or comment
if(is_array($output->data))
$args = new stdClass();
if($search_target && $search_keyword)
{
switch($search_target)
{
$uploadTargetSrlList = array();
foreach($output->data AS $key=>$value)
{
array_push($uploadTargetSrlList, $value->upload_target_srl);
}
case 'title' :
if($search_keyword) $search_keyword = str_replace(' ','%',$search_keyword);
$args->s_title= $search_keyword;
break;
case 'regdate' :
$args->s_regdate = $search_keyword;
break;
case 'ipaddress' :
$args->s_ipaddress= $search_keyword;
break;
}
}
// Options to get a list of pages
$args->page = Context::get('page');
$args->list_count = 50; // The number of posts to show on one page
$args->page_count = 10; // The number of pages to display in the page navigation
$oDocumentModel = &getModel('document');
$targetDocumentOutput = $oDocumentModel->getDocuments($uploadTargetSrlList);
if(!is_array($targetDocumentOutput)) $targetDocumentOutput = array();
$args->sort_index = 'P.list_order'; // Sorting value
$oCommentModel = &getModel('comment');
$columnList = array('comment_srl', 'document_srl');
$targetCommentOutput = $oCommentModel->getComments($uploadTargetSrlList, $columnList);
if(!is_array($targetCommentOutput)) $targetCommentOutput = array();
// Get the list
$oPollAdminModel = &getAdminModel('poll');
$output = $oPollAdminModel->getPollListWithMember($args);
foreach($output->data AS $key=>$value)
{
if(array_key_exists($value->upload_target_srl, $targetDocumentOutput))
$value->document_srl = $value->upload_target_srl;
if(array_key_exists($value->upload_target_srl, $targetCommentOutput))
{
$value->comment_srl = $value->upload_target_srl;
$value->document_srl = $targetCommentOutput[$value->comment_srl]->document_srl;
}
}
// check poll type. document or comment
if(is_array($output->data))
{
$uploadTargetSrlList = array();
foreach($output->data AS $key=>$value)
{
array_push($uploadTargetSrlList, $value->upload_target_srl);
}
// Configure the template variables
Context::set('total_count', $output->total_count);
Context::set('total_page', $output->total_page);
Context::set('page', $output->page);
Context::set('poll_list', $output->data);
Context::set('page_navigation', $output->page_navigation);
Context::set('module_list', $module_list);
$security = new Security();
$security->encodeHTML('poll_list..title');
// Set a template
$this->setTemplatePath($this->module_path.'tpl');
$this->setTemplateFile('poll_list');
}
$oDocumentModel = &getModel('document');
$targetDocumentOutput = $oDocumentModel->getDocuments($uploadTargetSrlList);
if(!is_array($targetDocumentOutput)) $targetDocumentOutput = array();
/**
* @brief Confgure the poll skin and colorset
**/
function dispPollAdminConfig() {
$oModuleModel = &getModel('module');
// Get the configuration information
$config = $oModuleModel->getModuleConfig('poll');
Context::set('config', $config);
// Get the skin information
$skin_list = $oModuleModel->getSkins($this->module_path);
Context::set('skin_list', $skin_list);
$oCommentModel = &getModel('comment');
$columnList = array('comment_srl', 'document_srl');
$targetCommentOutput = $oCommentModel->getComments($uploadTargetSrlList, $columnList);
if(!is_array($targetCommentOutput)) $targetCommentOutput = array();
if(!$skin_list[$config->skin]) $config->skin = "default";
// Set the skin colorset once the configurations is completed
Context::set('colorset_list', $skin_list[$config->skin]->colorset);
$security = new Security();
$security->encodeHTML('config..');
$security->encodeHTML('skin_list..title');
$security->encodeHTML('colorset_list..name','colorset_list..title');
// Set a template
$this->setTemplatePath($this->module_path.'tpl');
$this->setTemplateFile('config');
}
foreach($output->data AS $key=>$value)
{
if(array_key_exists($value->upload_target_srl, $targetDocumentOutput))
$value->document_srl = $value->upload_target_srl;
/**
* @brief Poll Results
**/
function dispPollAdminResult() {
// Popup layout
$this->setLayoutFile("popup_layout");
// Draw results
$args->poll_srl = Context::get('poll_srl');
$args->poll_index_srl = Context::get('poll_index_srl');
if(array_key_exists($value->upload_target_srl, $targetCommentOutput))
{
$value->comment_srl = $value->upload_target_srl;
$value->document_srl = $targetCommentOutput[$value->comment_srl]->document_srl;
}
}
}
$output = executeQuery('poll.getPoll', $args);
if(!$output->data) return $this->stop('msg_poll_not_exists');
$poll->stop_date = $output->data->stop_date;
$poll->poll_count = $output->data->poll_count;
// Configure the template variables
Context::set('total_count', $output->total_count);
Context::set('total_page', $output->total_page);
Context::set('page', $output->page);
Context::set('poll_list', $output->data);
Context::set('page_navigation', $output->page_navigation);
Context::set('module_list', $module_list);
$output = executeQuery('poll.getPollTitle', $args);
if(!$output->data) return $this->stop('msg_poll_not_exists');
$security = new Security();
$security->encodeHTML('poll_list..title', 'poll_list..nick_name');
// Set a template
$this->setTemplatePath($this->module_path.'tpl');
$this->setTemplateFile('poll_list');
}
$poll->poll[$args->poll_index_srl]->title = $output->data->title;
$poll->poll[$args->poll_index_srl]->checkcount = $output->data->checkcount;
$poll->poll[$args->poll_index_srl]->poll_count = $output->data->poll_count;
/**
* @brief Confgure the poll skin and colorset
*/
function dispPollAdminConfig()
{
$oModuleModel = &getModel('module');
// Get the configuration information
$config = $oModuleModel->getModuleConfig('poll');
Context::set('config', $config);
// Get the skin information
$skin_list = $oModuleModel->getSkins($this->module_path);
Context::set('skin_list', $skin_list);
$output = executeQuery('poll.getPollItem', $args);
foreach($output->data as $key => $val) {
$poll->poll[$val->poll_index_srl]->item[] = $val;
}
if(!$skin_list[$config->skin]) $config->skin = "default";
// Set the skin colorset once the configurations is completed
Context::set('colorset_list', $skin_list[$config->skin]->colorset);
$poll->poll_srl = $poll_srl;
$security = new Security();
$security->encodeHTML('config..');
$security->encodeHTML('skin_list..title');
$security->encodeHTML('colorset_list..name','colorset_list..title');
Context::set('poll',$poll);
// Configure the skin and the colorset for the default configuration
$oModuleModel = &getModel('module');
$poll_config = $oModuleModel->getModuleConfig('poll');
Context::set('poll_config', $poll_config);
// Set a template
$this->setTemplatePath($this->module_path.'tpl');
$this->setTemplateFile('config');
}
$this->setTemplatePath($this->module_path.'tpl');
$this->setTemplateFile('result');
}
}
?>
/**
* @brief Poll Results
*/
function dispPollAdminResult()
{
// Popup layout
$this->setLayoutFile("popup_layout");
// Draw results
$args->poll_srl = Context::get('poll_srl');
$args->poll_index_srl = Context::get('poll_index_srl');
$output = executeQuery('poll.getPoll', $args);
if(!$output->data) return $this->stop('msg_poll_not_exists');
$poll->stop_date = $output->data->stop_date;
$poll->poll_count = $output->data->poll_count;
$output = executeQuery('poll.getPollTitle', $args);
if(!$output->data) return $this->stop('msg_poll_not_exists');
$poll->poll[$args->poll_index_srl]->title = $output->data->title;
$poll->poll[$args->poll_index_srl]->checkcount = $output->data->checkcount;
$poll->poll[$args->poll_index_srl]->poll_count = $output->data->poll_count;
$output = executeQuery('poll.getPollItem', $args);
foreach($output->data as $key => $val)
{
$poll->poll[$val->poll_index_srl]->item[] = $val;
}
$poll->poll_srl = $poll_srl;
Context::set('poll',$poll);
// Configure the skin and the colorset for the default configuration
$oModuleModel = &getModel('module');
$poll_config = $oModuleModel->getModuleConfig('poll');
Context::set('poll_config', $poll_config);
$this->setTemplatePath($this->module_path.'tpl');
$this->setTemplateFile('result');
}
}
/* End of file poll.admin.view.php */
/* Location: ./modules/poll/poll.admin.view.php */

View file

@ -1,78 +1,82 @@
<?php
/**
* @class poll
* @author NHN (developers@xpressengine.com)
* @brief The parent class of the poll module
**/
/**
* @class poll
* @author NHN (developers@xpressengine.com)
* @brief The parent class of the poll module
*/
class poll extends ModuleObject
{
/**
* @brief Additional tasks required to accomplish during the installation
*/
function moduleInstall()
{
// Register in the action forward (to use in administrator mode)
$oModuleController = &getController('module');
// Set the default skin
$oModuleController = &getController('module');
$config->skin = 'default';
$config->colorset = 'normal';
$oModuleController->insertModuleConfig('poll', $config);
// 2007.10.17 When deleting posts/comments delete the poll as well
$oModuleController->insertTrigger('document.insertDocument', 'poll', 'controller', 'triggerInsertDocumentPoll', 'after');
$oModuleController->insertTrigger('comment.insertComment', 'poll', 'controller', 'triggerInsertCommentPoll', 'after');
$oModuleController->insertTrigger('document.updateDocument', 'poll', 'controller', 'triggerUpdateDocumentPoll', 'after');
$oModuleController->insertTrigger('comment.updateComment', 'poll', 'controller', 'triggerUpdateCommentPoll', 'after');
$oModuleController->insertTrigger('document.deleteDocument', 'poll', 'controller', 'triggerDeleteDocumentPoll', 'after');
$oModuleController->insertTrigger('comment.deleteComment', 'poll', 'controller', 'triggerDeleteCommentPoll', 'after');
class poll extends ModuleObject {
return new Object();
}
/**
* @brief Additional tasks required to accomplish during the installation
**/
function moduleInstall() {
// Register in the action forward (to use in administrator mode)
$oModuleController = &getController('module');
// Set the default skin
$oModuleController = &getController('module');
$config->skin = 'default';
$config->colorset = 'normal';
$oModuleController->insertModuleConfig('poll', $config);
// 2007.10.17 When deleting posts/comments delete the poll as well
$oModuleController->insertTrigger('document.insertDocument', 'poll', 'controller', 'triggerInsertDocumentPoll', 'after');
$oModuleController->insertTrigger('comment.insertComment', 'poll', 'controller', 'triggerInsertCommentPoll', 'after');
$oModuleController->insertTrigger('document.updateDocument', 'poll', 'controller', 'triggerUpdateDocumentPoll', 'after');
$oModuleController->insertTrigger('comment.updateComment', 'poll', 'controller', 'triggerUpdateCommentPoll', 'after');
$oModuleController->insertTrigger('document.deleteDocument', 'poll', 'controller', 'triggerDeleteDocumentPoll', 'after');
$oModuleController->insertTrigger('comment.deleteComment', 'poll', 'controller', 'triggerDeleteCommentPoll', 'after');
/**
* @brief A method to check if the installation has been successful
*/
function checkUpdate()
{
$oModuleModel = &getModel('module');
// 2007.10.17 When deleting posts/comments delete the poll as well
if(!$oModuleModel->getTrigger('document.insertDocument', 'poll', 'controller', 'triggerInsertDocumentPoll', 'after')) return true;
if(!$oModuleModel->getTrigger('comment.insertComment', 'poll', 'controller', 'triggerInsertCommentPoll', 'after')) return true;
if(!$oModuleModel->getTrigger('document.updateDocument', 'poll', 'controller', 'triggerUpdateDocumentPoll', 'after')) return true;
if(!$oModuleModel->getTrigger('comment.updateComment', 'poll', 'controller', 'triggerUpdateCommentPoll', 'after')) return true;
if(!$oModuleModel->getTrigger('document.deleteDocument', 'poll', 'controller', 'triggerDeleteDocumentPoll', 'after')) return true;
if(!$oModuleModel->getTrigger('comment.deleteComment', 'poll', 'controller', 'triggerDeleteCommentPoll', 'after')) return true;
return new Object();
}
return false;
}
/**
* @brief A method to check if the installation has been successful
**/
function checkUpdate() {
$oModuleModel = &getModel('module');
// 2007.10.17 When deleting posts/comments delete the poll as well
if(!$oModuleModel->getTrigger('document.insertDocument', 'poll', 'controller', 'triggerInsertDocumentPoll', 'after')) return true;
if(!$oModuleModel->getTrigger('comment.insertComment', 'poll', 'controller', 'triggerInsertCommentPoll', 'after')) return true;
if(!$oModuleModel->getTrigger('document.updateDocument', 'poll', 'controller', 'triggerUpdateDocumentPoll', 'after')) return true;
if(!$oModuleModel->getTrigger('comment.updateComment', 'poll', 'controller', 'triggerUpdateCommentPoll', 'after')) return true;
if(!$oModuleModel->getTrigger('document.deleteDocument', 'poll', 'controller', 'triggerDeleteDocumentPoll', 'after')) return true;
if(!$oModuleModel->getTrigger('comment.deleteComment', 'poll', 'controller', 'triggerDeleteCommentPoll', 'after')) return true;
/**
* @brief Execute update
*/
function moduleUpdate()
{
$oModuleModel = &getModel('module');
$oModuleController = &getController('module');
// 2007.10.17 When deleting posts/comments delete the poll as well
if(!$oModuleModel->getTrigger('document.deleteDocument', 'poll', 'controller', 'triggerDeleteDocumentPoll', 'after'))
$oModuleController->insertTrigger('document.deleteDocument', 'poll', 'controller', 'triggerDeleteDocumentPoll', 'after');
if(!$oModuleModel->getTrigger('comment.deleteComment', 'poll', 'controller', 'triggerDeleteCommentPoll', 'after'))
$oModuleController->insertTrigger('comment.deleteComment', 'poll', 'controller', 'triggerDeleteCommentPoll', 'after');
// 2008.04.22 A poll connection to add posts/comments
if(!$oModuleModel->getTrigger('document.insertDocument', 'poll', 'controller', 'triggerInsertDocumentPoll', 'after'))
$oModuleController->insertTrigger('document.insertDocument', 'poll', 'controller', 'triggerInsertDocumentPoll', 'after');
if(!$oModuleModel->getTrigger('comment.insertComment', 'poll', 'controller', 'triggerInsertCommentPoll', 'after'))
$oModuleController->insertTrigger('comment.insertComment', 'poll', 'controller', 'triggerInsertCommentPoll', 'after');
if(!$oModuleModel->getTrigger('document.updateDocument', 'poll', 'controller', 'triggerUpdateDocumentPoll', 'after'))
$oModuleController->insertTrigger('document.updateDocument', 'poll', 'controller', 'triggerUpdateDocumentPoll', 'after');
if(!$oModuleModel->getTrigger('comment.updateComment', 'poll', 'controller', 'triggerUpdateCommentPoll', 'after'))
$oModuleController->insertTrigger('comment.updateComment', 'poll', 'controller', 'triggerUpdateCommentPoll', 'after');
return false;
}
return new Object(0, 'success_updated');
}
/**
* @brief Execute update
**/
function moduleUpdate() {
$oModuleModel = &getModel('module');
$oModuleController = &getController('module');
// 2007.10.17 When deleting posts/comments delete the poll as well
if(!$oModuleModel->getTrigger('document.deleteDocument', 'poll', 'controller', 'triggerDeleteDocumentPoll', 'after'))
$oModuleController->insertTrigger('document.deleteDocument', 'poll', 'controller', 'triggerDeleteDocumentPoll', 'after');
if(!$oModuleModel->getTrigger('comment.deleteComment', 'poll', 'controller', 'triggerDeleteCommentPoll', 'after'))
$oModuleController->insertTrigger('comment.deleteComment', 'poll', 'controller', 'triggerDeleteCommentPoll', 'after');
// 2008.04.22 A poll connection to add posts/comments
if(!$oModuleModel->getTrigger('document.insertDocument', 'poll', 'controller', 'triggerInsertDocumentPoll', 'after'))
$oModuleController->insertTrigger('document.insertDocument', 'poll', 'controller', 'triggerInsertDocumentPoll', 'after');
if(!$oModuleModel->getTrigger('comment.insertComment', 'poll', 'controller', 'triggerInsertCommentPoll', 'after'))
$oModuleController->insertTrigger('comment.insertComment', 'poll', 'controller', 'triggerInsertCommentPoll', 'after');
if(!$oModuleModel->getTrigger('document.updateDocument', 'poll', 'controller', 'triggerUpdateDocumentPoll', 'after'))
$oModuleController->insertTrigger('document.updateDocument', 'poll', 'controller', 'triggerUpdateDocumentPoll', 'after');
if(!$oModuleModel->getTrigger('comment.updateComment', 'poll', 'controller', 'triggerUpdateCommentPoll', 'after'))
$oModuleController->insertTrigger('comment.updateComment', 'poll', 'controller', 'triggerUpdateCommentPoll', 'after');
return new Object(0, 'success_updated');
}
/**
* @brief Re-generate the cache file
**/
function recompileCache() {
}
}
?>
/**
* @brief Re-generate the cache file
*/
function recompileCache()
{
}
}
/* End of file poll.class.php */
/* Location: ./modules/poll/poll.class.php */

View file

@ -1,342 +1,364 @@
<?php
/**
* @class pollController
* @author NHN (developers@xpressengine.com)
* @brief Controller class for poll module
**/
/**
* @class pollController
* @author NHN (developers@xpressengine.com)
* @brief Controller class for poll module
*/
class pollController extends poll
{
/**
* @brief Initialization
*/
function init()
{
}
class pollController extends poll {
/**
* @brief after a qeustion is created in the popup window, register the question during the save time
*/
function procInsert()
{
$stop_date = Context::get('stop_date');
if($stop_date < date("Ymd")) $stop_date = date("YmdHis", time()+60*60*24*365);
/**
* @brief Initialization
**/
function init() {
}
/**
* @brief after a qeustion is created in the popup window, register the question during the save time
**/
function procInsert() {
$stop_date = Context::get('stop_date');
if($stop_date < date("Ymd")) $stop_date = date("YmdHis", time()+60*60*24*365);
$vars = Context::getRequestVars();
foreach($vars as $key => $val) {
if(strpos($key,'tidx')) continue;
if(!preg_match("/^(title|checkcount|item)_/i", $key)) continue;
if(!trim($val)) continue;
$tmp_arr = explode('_',$key);
$poll_index = $tmp_arr[1];
if(Context::get('is_logged')) {
$logged_info = Context::get('logged_info');
// Remove the tag if the it is not the top administrator in the session
if($logged_info->is_admin != 'Y') $val = htmlspecialchars($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) {
if(!$val->checkcount) $val->checkcount = 1;
if($val->title && count($val->item)) $args->poll[] = $val;
}
if(!count($args->poll)) return new Object(-1, 'cmd_null_item');
$args->stop_date = $stop_date;
// Configure the variables
$poll_srl = getNextSequence();
$logged_info = Context::get('logged_info');
$member_srl = $logged_info->member_srl?$logged_info->member_srl:0;
$oDB = &DB::getInstance();
$oDB->begin();
// Register the poll
unset($poll_args);
$poll_args->poll_srl = $poll_srl;
$poll_args->member_srl = $member_srl;
$poll_args->list_order = $poll_srl*-1;
$poll_args->stop_date = $args->stop_date;
$poll_args->poll_count = 0;
$output = executeQuery('poll.insertPoll', $poll_args);
if(!$output->toBool()) {
$oDB->rollback();
return $output;
}
// Individual poll registration
foreach($args->poll as $key => $val) {
unset($title_args);
$title_args->poll_srl = $poll_srl;
$title_args->poll_index_srl = getNextSequence();
$title_args->title = $val->title;
$title_args->checkcount = $val->checkcount;
$title_args->poll_count = 0;
$title_args->list_order = $title_args->poll_index_srl * -1;
$title_args->member_srl = $member_srl;
$title_args->upload_target_srl = $upload_target_srl;
$output = executeQuery('poll.insertPollTitle', $title_args);
if(!$output->toBool()) {
$oDB->rollback();
return $output;
}
// Add the individual survey items
foreach($val->item as $k => $v) {
unset($item_args);
$item_args->poll_srl = $poll_srl;
$item_args->poll_index_srl = $title_args->poll_index_srl;
$item_args->title = $v;
$item_args->poll_count = 0;
$item_args->upload_target_srl = $upload_target_srl;
$output = executeQuery('poll.insertPollItem', $item_args);
if(!$output->toBool()) {
$oDB->rollback();
return $output;
}
}
}
$oDB->commit();
$this->add('poll_srl', $poll_srl);
$this->setMessage('success_registed');
}
/**
* @brief Accept the poll
**/
function procPoll() {
$poll_srl = Context::get('poll_srl');
$poll_srl_indexes = Context::get('poll_srl_indexes');
$tmp_item_srls = explode(',',$poll_srl_indexes);
for($i=0;$i<count($tmp_item_srls);$i++) {
$srl = (int)trim($tmp_item_srls[$i]);
if(!$srl) continue;
$item_srls[] = $srl;
}
// If there is no response item, display an error
if(!count($item_srls)) return new Object(-1, 'msg_check_poll_item');
// Make sure is the poll has already been taken
$oPollModel = &getModel('poll');
if($oPollModel->isPolled($poll_srl)) return new Object(-1, 'msg_already_poll');
$oDB = &DB::getInstance();
$oDB->begin();
$args->poll_srl = $poll_srl;
// Update all poll responses related to the post
$output = executeQuery('poll.updatePoll', $args);
$output = executeQuery('poll.updatePollTitle', $args);
if(!$output->toBool()) {
$oDB->rollback();
return $output;
}
// Record each polls selected items
$args->poll_item_srl = implode(',',$item_srls);
$output = executeQuery('poll.updatePollItems', $args);
if(!$output->toBool()) {
$oDB->rollback();
return $output;
}
// Log the respondent's information
$log_args->poll_srl = $poll_srl;
$logged_info = Context::get('logged_info');
$member_srl = $logged_info->member_srl?$logged_info->member_srl:0;
$log_args->member_srl = $member_srl;
$log_args->ipaddress = $_SERVER['REMOTE_ADDR'];
$output = executeQuery('poll.insertPollLog', $log_args);
if(!$output->toBool()) {
$oDB->rollback();
return $output;
}
$oDB->commit();
$skin = Context::get('skin');
if(!$skin || !is_dir('./modules/poll/skins/'.$skin)) $skin = 'default';
// Get tpl
$tpl = $oPollModel->getPollHtml($poll_srl, '', $skin);
$this->add('poll_srl', $poll_srl);
$this->add('tpl',$tpl);
$this->setMessage('success_poll');
$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'module', 'admin', 'act', 'dispPollAdminConfig');
$this->setRedirectUrl($returnUrl);
}
/**
* @brief Preview the results
**/
function procPollViewResult() {
$poll_srl = Context::get('poll_srl');
$skin = Context::get('skin');
if(!$skin || !is_dir('./modules/poll/skins/'.$skin)) $skin = 'default';
$oPollModel = &getModel('poll');
$tpl = $oPollModel->getPollResultHtml($poll_srl, $skin);
$this->add('poll_srl', $poll_srl);
$this->add('tpl',$tpl);
}
/**
* @brief poll list
**/
function procPollGetList()
$logged_info = Context::get('logged_info');
$vars = Context::getRequestVars();
foreach($vars as $key => $val)
{
if(!Context::get('is_logged')) return new Object(-1,'msg_not_permitted');
$pollSrls = Context::get('poll_srls');
if($pollSrls) $pollSrlList = explode(',', $pollSrls);
if(strpos($key,'tidx')) continue;
if(!preg_match("/^(title|checkcount|item)_/i", $key)) continue;
if(!trim($val)) continue;
global $lang;
if(count($pollSrlList) > 0) {
$oPollAdminModel = &getAdminModel('poll');
$args->pollIndexSrlList = $pollSrlList;
$output = $oPollAdminModel->getPollListWithMember($args);
$pollList = $output->data;
$tmp_arr = explode('_',$key);
if(is_array($pollList))
$poll_index = $tmp_arr[1];
if($logged_info->is_admin != 'Y') $val = htmlspecialchars($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)
{
if(!$val->checkcount) $val->checkcount = 1;
if($val->title && count($val->item)) $args->poll[] = $val;
}
if(!count($args->poll)) return new Object(-1, 'cmd_null_item');
$args->stop_date = $stop_date;
// Configure the variables
$poll_srl = getNextSequence();
$member_srl = $logged_info->member_srl?$logged_info->member_srl:0;
$oDB = &DB::getInstance();
$oDB->begin();
// Register the poll
unset($poll_args);
$poll_args->poll_srl = $poll_srl;
$poll_args->member_srl = $member_srl;
$poll_args->list_order = $poll_srl*-1;
$poll_args->stop_date = $args->stop_date;
$poll_args->poll_count = 0;
$output = executeQuery('poll.insertPoll', $poll_args);
if(!$output->toBool())
{
$oDB->rollback();
return $output;
}
// Individual poll registration
foreach($args->poll as $key => $val)
{
unset($title_args);
$title_args->poll_srl = $poll_srl;
$title_args->poll_index_srl = getNextSequence();
$title_args->title = $val->title;
$title_args->checkcount = $val->checkcount;
$title_args->poll_count = 0;
$title_args->list_order = $title_args->poll_index_srl * -1;
$title_args->member_srl = $member_srl;
$title_args->upload_target_srl = $upload_target_srl;
$output = executeQuery('poll.insertPollTitle', $title_args);
if(!$output->toBool())
{
$oDB->rollback();
return $output;
}
// Add the individual survey items
foreach($val->item as $k => $v)
{
unset($item_args);
$item_args->poll_srl = $poll_srl;
$item_args->poll_index_srl = $title_args->poll_index_srl;
$item_args->title = $v;
$item_args->poll_count = 0;
$item_args->upload_target_srl = $upload_target_srl;
$output = executeQuery('poll.insertPollItem', $item_args);
if(!$output->toBool())
{
foreach($pollList AS $key=>$value)
{
if($value->checkcount == 1) $value->checkName = $lang->single_check;
else $value->checkName = $lang->multi_check;
}
$oDB->rollback();
return $output;
}
}
else
}
$oDB->commit();
$this->add('poll_srl', $poll_srl);
$this->setMessage('success_registed');
}
/**
* @brief Accept the poll
*/
function procPoll()
{
$poll_srl = Context::get('poll_srl');
$poll_srl_indexes = Context::get('poll_srl_indexes');
$tmp_item_srls = explode(',',$poll_srl_indexes);
for($i=0;$i<count($tmp_item_srls);$i++)
{
$srl = (int)trim($tmp_item_srls[$i]);
if(!$srl) continue;
$item_srls[] = $srl;
}
// If there is no response item, display an error
if(!count($item_srls)) return new Object(-1, 'msg_check_poll_item');
// Make sure is the poll has already been taken
$oPollModel = &getModel('poll');
if($oPollModel->isPolled($poll_srl)) return new Object(-1, 'msg_already_poll');
$oDB = &DB::getInstance();
$oDB->begin();
$args->poll_srl = $poll_srl;
// Update all poll responses related to the post
$output = executeQuery('poll.updatePoll', $args);
$output = executeQuery('poll.updatePollTitle', $args);
if(!$output->toBool())
{
$oDB->rollback();
return $output;
}
// Record each polls selected items
$args->poll_item_srl = implode(',',$item_srls);
$output = executeQuery('poll.updatePollItems', $args);
if(!$output->toBool())
{
$oDB->rollback();
return $output;
}
// Log the respondent's information
$log_args->poll_srl = $poll_srl;
$logged_info = Context::get('logged_info');
$member_srl = $logged_info->member_srl?$logged_info->member_srl:0;
$log_args->member_srl = $member_srl;
$log_args->ipaddress = $_SERVER['REMOTE_ADDR'];
$output = executeQuery('poll.insertPollLog', $log_args);
if(!$output->toBool())
{
$oDB->rollback();
return $output;
}
$oDB->commit();
$skin = Context::get('skin');
if(!$skin || !is_dir('./modules/poll/skins/'.$skin)) $skin = 'default';
// Get tpl
$tpl = $oPollModel->getPollHtml($poll_srl, '', $skin);
$this->add('poll_srl', $poll_srl);
$this->add('tpl',$tpl);
$this->setMessage('success_poll');
$returnUrl = Context::get('success_return_url') ? Context::get('success_return_url') : getNotEncodedUrl('', 'module', 'admin', 'act', 'dispPollAdminConfig');
$this->setRedirectUrl($returnUrl);
}
/**
* @brief Preview the results
*/
function procPollViewResult()
{
$poll_srl = Context::get('poll_srl');
$skin = Context::get('skin');
if(!$skin || !is_dir('./modules/poll/skins/'.$skin)) $skin = 'default';
$oPollModel = &getModel('poll');
$tpl = $oPollModel->getPollResultHtml($poll_srl, $skin);
$this->add('poll_srl', $poll_srl);
$this->add('tpl',$tpl);
}
/**
* @brief poll list
*/
function procPollGetList()
{
if(!Context::get('is_logged')) return new Object(-1,'msg_not_permitted');
$pollSrls = Context::get('poll_srls');
if($pollSrls) $pollSrlList = explode(',', $pollSrls);
global $lang;
if(count($pollSrlList) > 0)
{
$oPollAdminModel = &getAdminModel('poll');
$args->pollIndexSrlList = $pollSrlList;
$output = $oPollAdminModel->getPollListWithMember($args);
$pollList = $output->data;
if(is_array($pollList))
{
$pollList = array();
$this->setMessage($lang->no_documents);
foreach($pollList AS $key=>$value)
{
if($value->checkcount == 1) $value->checkName = $lang->single_check;
else $value->checkName = $lang->multi_check;
}
}
}
else
{
$pollList = array();
$this->setMessage($lang->no_documents);
}
$this->add('poll_list', $pollList);
}
$this->add('poll_list', $pollList);
}
/**
* @brief A poll synchronization trigger when a new post is registered
**/
function triggerInsertDocumentPoll(&$obj) {
$this->syncPoll($obj->document_srl, $obj->content);
return new Object();
}
/**
* @brief A poll synchronization trigger when a new post is registered
*/
function triggerInsertDocumentPoll(&$obj)
{
$this->syncPoll($obj->document_srl, $obj->content);
return new Object();
}
/**
* @brief A poll synchronization trigger when a new comment is registered
**/
function triggerInsertCommentPoll(&$obj) {
$this->syncPoll($obj->comment_srl, $obj->content);
return new Object();
}
/**
* @brief A poll synchronization trigger when a new comment is registered
*/
function triggerInsertCommentPoll(&$obj)
{
$this->syncPoll($obj->comment_srl, $obj->content);
return new Object();
}
/**
* @brief A poll synchronization trigger when a post is updated
**/
function triggerUpdateDocumentPoll(&$obj) {
$this->syncPoll($obj->document_srl, $obj->content);
return new Object();
}
/**
* @brief A poll synchronization trigger when a post is updated
*/
function triggerUpdateDocumentPoll(&$obj)
{
$this->syncPoll($obj->document_srl, $obj->content);
return new Object();
}
/**
* @brief A poll synchronization trigger when a comment is updated
**/
function triggerUpdateCommentPoll(&$obj) {
$this->syncPoll($obj->comment_srl, $obj->content);
return new Object();
}
/**
* @brief A poll synchronization trigger when a comment is updated
*/
function triggerUpdateCommentPoll(&$obj)
{
$this->syncPoll($obj->comment_srl, $obj->content);
return new Object();
}
/**
* @brief A poll deletion trigger when a post is removed
**/
function triggerDeleteDocumentPoll(&$obj) {
$document_srl = $obj->document_srl;
if(!$document_srl) return new Object();
// Get the poll
$args->upload_target_srl = $document_srl;
$output = executeQuery('poll.getPollByTargetSrl', $args);
if(!$output->data) return new Object();
/**
* @brief A poll deletion trigger when a post is removed
*/
function triggerDeleteDocumentPoll(&$obj)
{
$document_srl = $obj->document_srl;
if(!$document_srl) return new Object();
// Get the poll
$args = new stdClass();
$args->upload_target_srl = $document_srl;
$output = executeQuery('poll.getPollByTargetSrl', $args);
if(!$output->data) return new Object();
$poll_srl = $output->data->poll_srl;
if(!$poll_srl) return new Object();
$poll_srl = $output->data->poll_srl;
if(!$poll_srl) return new Object();
$args->poll_srl = $poll_srl;
$args->poll_srl = $poll_srl;
$output = executeQuery('poll.deletePoll', $args);
if(!$output->toBool()) return $output;
$output = executeQuery('poll.deletePoll', $args);
if(!$output->toBool()) return $output;
$output = executeQuery('poll.deletePollItem', $args);
if(!$output->toBool()) return $output;
$output = executeQuery('poll.deletePollItem', $args);
if(!$output->toBool()) return $output;
$output = executeQuery('poll.deletePollTitle', $args);
if(!$output->toBool()) return $output;
$output = executeQuery('poll.deletePollTitle', $args);
if(!$output->toBool()) return $output;
$output = executeQuery('poll.deletePollLog', $args);
if(!$output->toBool()) return $output;
$output = executeQuery('poll.deletePollLog', $args);
if(!$output->toBool()) return $output;
return new Object();
}
return new Object();
}
/**
* @brief A poll deletion trigger when a comment is removed
**/
function triggerDeleteCommentPoll(&$obj) {
$comment_srl = $obj->comment_srl;
if(!$comment_srl) return new Object();
// Get the poll
$args->upload_target_srl = $comment_srl;
$output = executeQuery('poll.getPollByTargetSrl', $args);
if(!$output->data) return new Object();
/**
* @brief A poll deletion trigger when a comment is removed
*/
function triggerDeleteCommentPoll(&$obj)
{
$comment_srl = $obj->comment_srl;
if(!$comment_srl) return new Object();
// Get the poll
$args = new stdClass();
$args->upload_target_srl = $comment_srl;
$output = executeQuery('poll.getPollByTargetSrl', $args);
if(!$output->data) return new Object();
$poll_srl = $output->data->poll_srl;
if(!$poll_srl) return new Object();
$poll_srl = $output->data->poll_srl;
if(!$poll_srl) return new Object();
$args->poll_srl = $poll_srl;
$args->poll_srl = $poll_srl;
$output = executeQuery('poll.deletePoll', $args);
if(!$output->toBool()) return $output;
$output = executeQuery('poll.deletePoll', $args);
if(!$output->toBool()) return $output;
$output = executeQuery('poll.deletePollItem', $args);
if(!$output->toBool()) return $output;
$output = executeQuery('poll.deletePollItem', $args);
if(!$output->toBool()) return $output;
$output = executeQuery('poll.deletePollTitle', $args);
if(!$output->toBool()) return $output;
$output = executeQuery('poll.deletePollTitle', $args);
if(!$output->toBool()) return $output;
$output = executeQuery('poll.deletePollLog', $args);
if(!$output->toBool()) return $output;
$output = executeQuery('poll.deletePollLog', $args);
if(!$output->toBool()) return $output;
return new Object();
}
return new Object();
}
/**
* @brief As post content's poll is obtained, synchronize the poll using the document number
**/
function syncPoll($upload_target_srl, $content) {
$match_cnt = preg_match_all('!<img([^\>]*)poll_srl=(["\']?)([0-9]*)(["\']?)([^\>]*?)\>!is',$content, $matches);
for($i=0;$i<$match_cnt;$i++) {
$poll_srl = $matches[3][$i];
/**
* @brief As post content's poll is obtained, synchronize the poll using the document number
*/
function syncPoll($upload_target_srl, $content)
{
$match_cnt = preg_match_all('!<img([^\>]*)poll_srl=(["\']?)([0-9]*)(["\']?)([^\>]*?)\>!is',$content, $matches);
for($i=0;$i<$match_cnt;$i++)
{
$poll_srl = $matches[3][$i];
$args = null;
$args->poll_srl = $poll_srl;
$output = executeQuery('poll.getPoll', $args);
$poll = $output->data;
$args = null;
$args->poll_srl = $poll_srl;
$output = executeQuery('poll.getPoll', $args);
$poll = $output->data;
if($poll->upload_target_srl) continue;
if($poll->upload_target_srl) continue;
$args->upload_target_srl = $upload_target_srl;
$output = executeQuery('poll.updatePollTarget', $args);
$output = executeQuery('poll.updatePollTitleTarget', $args);
$output = executeQuery('poll.updatePollItemTarget', $args);
}
}
}
?>
$args->upload_target_srl = $upload_target_srl;
$output = executeQuery('poll.updatePollTarget', $args);
$output = executeQuery('poll.updatePollTitleTarget', $args);
$output = executeQuery('poll.updatePollItemTarget', $args);
}
}
}
/* End of file poll.controller.php */
/* Location: ./modules/poll/poll.controller.php */

View file

@ -1,138 +1,154 @@
<?php
/**
* @class pollModel
* @author NHN (developers@xpressengine.com)
* @brief The model class for the poll modules
**/
/**
* @class pollModel
* @author NHN (developers@xpressengine.com)
* @brief The model class for the poll modules
*/
class pollModel extends poll
{
/**
* @brief Initialization
*/
function init()
{
}
class pollModel extends poll {
/**
* @brief The function examines if the user has already been polled
*/
function isPolled($poll_srl)
{
$args->poll_srl = $poll_srl;
/**
* @brief Initialization
**/
function init() {
}
if(Context::get('is_logged'))
{
$logged_info = Context::get('logged_info');
$args->member_srl = $logged_info->member_srl;
}
else
{
$args->ipaddress = $_SERVER['REMOTE_ADDR'];
}
$output = executeQuery('poll.getPollLog', $args);
if($output->data->count) return true;
return false;
}
/**
* @brief The function examines if the user has already been polled
**/
function isPolled($poll_srl) {
$args->poll_srl = $poll_srl;
/**
* @brief Return the HTML data of the survey
* Return the result after checking if the poll has responses
*/
function getPollHtml($poll_srl, $style = '', $skin = 'default')
{
$args->poll_srl = $poll_srl;
// Get the information related to the survey
$columnList = array('poll_count', 'stop_date');
$output = executeQuery('poll.getPoll', $args, $columnList);
if(!$output->data) return '';
if(Context::get('is_logged')) {
$logged_info = Context::get('logged_info');
$args->member_srl = $logged_info->member_srl;
} else {
$args->ipaddress = $_SERVER['REMOTE_ADDR'];
}
$output = executeQuery('poll.getPollLog', $args);
if($output->data->count) return true;
return false;
}
$poll->style = $style;
$poll->poll_count = (int)$output->data->poll_count;
$poll->stop_date = $output->data->stop_date;
/**
* @brief Return the HTML data of the survey
* Return the result after checking if the poll has responses
**/
function getPollHtml($poll_srl, $style = '', $skin = 'default') {
$args->poll_srl = $poll_srl;
// Get the information related to the survey
$columnList = array('poll_count', 'stop_date');
$output = executeQuery('poll.getPoll', $args, $columnList);
if(!$output->data) return '';
$columnList = array('poll_index_srl', 'title', 'checkcount', 'poll_count');
$output = executeQuery('poll.getPollTitle', $args, $columnList);
if(!$output->data) return;
if(!is_array($output->data)) $output->data = array($output->data);
foreach($output->data as $key => $val)
{
$poll->poll[$val->poll_index_srl]->title = $val->title;
$poll->poll[$val->poll_index_srl]->checkcount = $val->checkcount;
$poll->poll[$val->poll_index_srl]->poll_count = $val->poll_count;
}
$poll->style = $style;
$poll->poll_count = (int)$output->data->poll_count;
$poll->stop_date = $output->data->stop_date;
$output = executeQuery('poll.getPollItem', $args);
foreach($output->data as $key => $val)
{
$poll->poll[$val->poll_index_srl]->item[] = $val;
}
$columnList = array('poll_index_srl', 'title', 'checkcount', 'poll_count');
$output = executeQuery('poll.getPollTitle', $args, $columnList);
if(!$output->data) return;
if(!is_array($output->data)) $output->data = array($output->data);
foreach($output->data as $key => $val) {
$poll->poll[$val->poll_index_srl]->title = $val->title;
$poll->poll[$val->poll_index_srl]->checkcount = $val->checkcount;
$poll->poll[$val->poll_index_srl]->poll_count = $val->poll_count;
}
$poll->poll_srl = $poll_srl;
// Only ongoing poll results
if($poll->stop_date > date("Ymd"))
{
if($this->isPolled($poll_srl)) $tpl_file = "result";
else $tpl_file = "form";
}
else
{
$tpl_file = "result";
}
$output = executeQuery('poll.getPollItem', $args);
foreach($output->data as $key => $val) {
$poll->poll[$val->poll_index_srl]->item[] = $val;
}
Context::set('poll',$poll);
Context::set('skin',$skin);
// The skin for the default configurations, and the colorset configurations
$tpl_path = sprintf("%sskins/%s/", $this->module_path, $skin);
$poll->poll_srl = $poll_srl;
// Only ongoing poll results
if($poll->stop_date > date("Ymd")) {
if($this->isPolled($poll_srl)) $tpl_file = "result";
else $tpl_file = "form";
} else {
$tpl_file = "result";
}
$oTemplate = &TemplateHandler::getInstance();
return $oTemplate->compile($tpl_path, $tpl_file);
}
Context::set('poll',$poll);
Context::set('skin',$skin);
// The skin for the default configurations, and the colorset configurations
$tpl_path = sprintf("%sskins/%s/", $this->module_path, $skin);
/**
* @brief Return the result's HTML
*/
function getPollResultHtml($poll_srl, $skin = 'default')
{
$args->poll_srl = $poll_srl;
// Get the information related to the survey
$output = executeQuery('poll.getPoll', $args);
if(!$output->data) return '';
$oTemplate = &TemplateHandler::getInstance();
return $oTemplate->compile($tpl_path, $tpl_file);
}
$poll->style = $style;
$poll->poll_count = (int)$output->data->poll_count;
$poll->stop_date = $output->data->stop_date;
/**
* @brief Return the result's HTML
**/
function getPollResultHtml($poll_srl, $skin = 'default') {
$args->poll_srl = $poll_srl;
// Get the information related to the survey
$output = executeQuery('poll.getPoll', $args);
if(!$output->data) return '';
$columnList = array('poll_index_srl', 'checkcount', 'poll_count');
$output = executeQuery('poll.getPollTitle', $args, $columnList);
if(!$output->data) return;
if(!is_array($output->data)) $output->data = array($output->data);
foreach($output->data as $key => $val)
{
$poll->poll[$val->poll_index_srl]->title = $val->title;
$poll->poll[$val->poll_index_srl]->checkcount = $val->checkcount;
$poll->poll[$val->poll_index_srl]->poll_count = $val->poll_count;
}
$poll->style = $style;
$poll->poll_count = (int)$output->data->poll_count;
$poll->stop_date = $output->data->stop_date;
$output = executeQuery('poll.getPollItem', $args);
foreach($output->data as $key => $val)
{
$poll->poll[$val->poll_index_srl]->item[] = $val;
}
$columnList = array('poll_index_srl', 'checkcount', 'poll_count');
$output = executeQuery('poll.getPollTitle', $args, $columnList);
if(!$output->data) return;
if(!is_array($output->data)) $output->data = array($output->data);
foreach($output->data as $key => $val) {
$poll->poll[$val->poll_index_srl]->title = $val->title;
$poll->poll[$val->poll_index_srl]->checkcount = $val->checkcount;
$poll->poll[$val->poll_index_srl]->poll_count = $val->poll_count;
}
$poll->poll_srl = $poll_srl;
$output = executeQuery('poll.getPollItem', $args);
foreach($output->data as $key => $val) {
$poll->poll[$val->poll_index_srl]->item[] = $val;
}
$tpl_file = "result";
$poll->poll_srl = $poll_srl;
Context::set('poll',$poll);
// The skin for the default configurations, and the colorset configurations
$tpl_path = sprintf("%sskins/%s/", $this->module_path, $skin);
$tpl_file = "result";
$oTemplate = &TemplateHandler::getInstance();
return $oTemplate->compile($tpl_path, $tpl_file);
}
/** [TO REVIEW]
* @brief Selected poll - return the colorset of the skin
*/
function getPollGetColorsetList()
{
$skin = Context::get('skin');
Context::set('poll',$poll);
// The skin for the default configurations, and the colorset configurations
$tpl_path = sprintf("%sskins/%s/", $this->module_path, $skin);
$oModuleModel = &getModel('module');
$skin_info = $oModuleModel->loadSkinInfo($this->module_path, $skin);
$oTemplate = &TemplateHandler::getInstance();
return $oTemplate->compile($tpl_path, $tpl_file);
}
/** [TO REVIEW]
* @brief Selected poll - return the colorset of the skin
**/
function getPollGetColorsetList() {
$skin = Context::get('skin');
for($i=0;$i<count($skin_info->colorset);$i++)
{
$colorset = sprintf('%s|@|%s', $skin_info->colorset[$i]->name, $skin_info->colorset[$i]->title);
$colorset_list[] = $colorset;
}
$oModuleModel = &getModel('module');
$skin_info = $oModuleModel->loadSkinInfo($this->module_path, $skin);
for($i=0;$i<count($skin_info->colorset);$i++) {
$colorset = sprintf('%s|@|%s', $skin_info->colorset[$i]->name, $skin_info->colorset[$i]->title);
$colorset_list[] = $colorset;
}
if(count($colorset_list)) $colorsets = implode("\n", $colorset_list);
$this->add('colorset_list', $colorsets);
}
}
?>
if(count($colorset_list)) $colorsets = implode("\n", $colorset_list);
$this->add('colorset_list', $colorsets);
}
}
/* End of file poll.model.php */
/* Location: ./modules/poll/poll.model.php */

View file

@ -1,8 +1,16 @@
<query id="getPollListWithMember" action="select">
<tables>
<table name="poll_title" alias="P" />
<table name="poll" alias="P2" />
<table name="member" alias="M" />
<table name="poll" alias="P2" type="left join">
<conditions>
<condition operation="equal" column="P2.poll_srl" var="P.poll_srl" />
</conditions>
</table>
<table name="member" alias="M" type="left outer join">
<conditions>
<condition operation="equal" column="P2.member_srl" var="M.member_srl" />
</conditions>
</table>
</tables>
<columns>
<column name="P.poll_srl" alias="poll_srl" />
@ -17,15 +25,14 @@
<column name="M.*" />
</columns>
<conditions>
<condition operation="in" column="poll_index_srl" var="pollIndexSrlList" filter="number" pipe="and" />
<group pipe="and">
<condition operation="equal" column="P.member_srl" var="M.member_srl" notnull="notnull" />
<condition operation="equal" column="P2.member_srl" var="M.member_srl" notnull="notnull" pipe="and" />
<condition operation="equal" column="P2.poll_srl" var="P.poll_srl" notnull="notnull" pipe="and" />
<condition operation="in" column="poll_index_srl" var="pollIndexSrlList" filter="number" pipe="and" />
<condition operation="like" column="P.title" var="s_title" pipe="or"/>
<condition operation="like_prefix" column="P.regdate" var="s_regdate" pipe="or" />
<condition operation="like_prefix" column="P.ipaddress" var="s_ipaddress" pipe="or" />
</group>
<condition operation="like" column="P.title" var="s_title" pipe="or"/>
<condition operation="like_prefix" column="P.regdate" var="s_regdate" pipe="or" />
<condition operation="like_prefix" column="P.ipaddress" var="s_ipaddress" pipe="or" />
</conditions>
<navigation>
<index var="sort_index" default="P.list_order" order="asc" />

View file

@ -1,35 +1,27 @@
.poll_table { table-layout:fixed; width:100%; padding:0; border:none;}
.poll_table td { padding:0; margin:0; }
.poll_table td.h { background:url(../images/top_bg.png) repeat-x left top; }
.poll_table td.title { height:28px; background:url(../images/top_title_bg.png) repeat-x left top; padding:0 20px 0 20px;color:#C3C3C4;}
.poll_table td.title strong { color:#FFFFFF; font-weight:bold; }
.poll_table td.l { border-left:1px solid #E5E5E5; }
.poll_table td.r { border-right:1px solid #E5E5E5; }
.poll_table td.poll_content { padding:18px 13px 18px 13px; }
.poll_table td.poll_button { border:1px solid #E5E5E5; border-bottom:none; background-color:#F6F6F5; }
.poll_table td.poll_button div { padding:5px 0 2px 0; text-align:center;}
.poll_table td.b { background-color:#F6F6F5; height:7px; }
.poll_table td.b img { width:100%; height:6px; border-bottom:1px solid #E5E5E5; }
.poll_table td.bb { height:7px; }
.poll_table td.bb img { width:100%; height:6px; border-bottom:1px solid #E5E5E5; }
.poll_table td.poll_content div.title { color:#000000; background-color:#F5F5F5; border-top:2px solid #C1C0BD; border-bottom:2px solid #C1C0BD; font-weight:bold; padding:7px 0 7px 10px; margin-bottom:10px; }
.poll_table td.poll_content div.item_text { color:#636363; padding:0 10px 0 10px; margin-top:10px; }
.poll_table td.poll_content div.item_text strong { font-weight:bold; color:#000000; font-family:; font-size:12px; }
.poll_table td.poll_content table.item_bar_table { width:100%; table-layout:fixed; border-bottom:1px solid #EDEDED; margin-top:10px;}
.poll_table td.poll_content table.noborder { border-bottom:none; margin-bottom:10px;}
.poll_table td.poll_content table.item_bar_table td.bar { padding:0 0 5px 0; background:url(../images/back_bar.png) repeat-x left 4px;}
.poll_table td.poll_content table.item_bar_table td.bar img { width:100%; height:6px; }
.poll_table td.poll_content table.item_bar_table td.status { font-size:.9em; padding-bottom:5px; color:#636363; padding-left:15px; }
.poll_table td.poll_content table.item_bar_table td.status strong { font-weight:bold; color:#58C011; }
.poll_table td.poll_content div.item { color:#636363; border-bottom:1px solid #EDEDED; padding:5px 0 8px 10px; margin-bottom:3px; }
.poll_table td.poll_content div.noborder { border-bottom:none; margin-bottom:10px;}
.poll_table td.poll_content div.checkcount { border-bottom:1px dashed #EDEDED; padding:0 0 8px 10px; margin-bottom:3px; text-align:right; color:#636363; }
.poll_table{table-layout:fixed;width:100%;padding:0;border:none}
.poll_table td{padding:0;margin:0}
.poll_table td.h{background:url(../images/top_bg.png) repeat-x left top}
.poll_table td.title{height:28px;background:url(../images/top_title_bg.png) repeat-x left top;padding:0 20px 0 20px;color:#C3C3C4}
.poll_table td.title strong{color:#FFFFFF;font-weight:bold}
.poll_table td.l{border-left:1px solid #E5E5E5}
.poll_table td.r{border-right:1px solid #E5E5E5}
.poll_table td.poll_content{padding:18px 13px 18px 13px}
.poll_table td.poll_button{border:1px solid #E5E5E5;border-bottom:none;background-color:#F6F6F5}
.poll_table td.poll_button div{padding:5px 0 2px 0;text-align:center}
.poll_table td.b{background-color:#F6F6F5;height:7px}
.poll_table td.b img{width:100%;height:6px;border-bottom:1px solid #E5E5E5}
.poll_table td.bb{height:7px}
.poll_table td.bb img{width:100%;height:6px;border-bottom:1px solid #E5E5E5}
.poll_table td.poll_content div.title{color:#000000;background-color:#F5F5F5;border-top:2px solid #C1C0BD;border-bottom:2px solid #C1C0BD;font-weight:bold;padding:7px 0 7px 10px;margin-bottom:10px}
.poll_table td.poll_content div.item_text{color:#636363;padding:0 10px 0 10px;margin-top:10px}
.poll_table td.poll_content div.item_text strong{font-weight:bold;color:#000000;font-family:;font-size:12px}
.poll_table td.poll_content table.item_bar_table{width:100%;table-layout:fixed;border-bottom:1px solid #EDEDED;margin-top:10px}
.poll_table td.poll_content table.noborder{border-bottom:none;margin-bottom:10px}
.poll_table td.poll_content table.item_bar_table td.bar{padding:0 0 5px 0;background:url(../images/back_bar.png) repeat-x left center}
.poll_table td.poll_content table.item_bar_table td.bar img{width:100%;height:6px}
.poll_table td.poll_content table.item_bar_table td.status{font-size:.9em;padding-bottom:5px;color:#636363;padding-left:15px}
.poll_table td.poll_content table.item_bar_table td.status strong{font-weight:bold;color:#58C011}
.poll_table td.poll_content div.item{color:#636363;border-bottom:1px solid #EDEDED;padding:5px 0 8px 10px;margin-bottom:3px}
.poll_table td.poll_content div.noborder{border-bottom:none;margin-bottom:10px}
.poll_table td.poll_content div.checkcount{border-bottom:1px dashed #EDEDED;padding:0 0 8px 10px;margin-bottom:3px;text-align:right;color:#636363}
.poll_table tr.cap>td{font-size:0;line-height:0;height:7px;overflow:hidden}

View file

@ -1 +1 @@
.poll_table{table-layout:fixed;width:100%;padding:0;border:none}.poll_table td{padding:0;margin:0}.poll_table td.h{background:url(../images/top_bg.png) repeat-x left top}.poll_table td.title{height:28px;background:url(../images/top_title_bg.png) repeat-x left top;padding:0 20px 0 20px;color:#C3C3C4}.poll_table td.title strong{color:#FFFFFF;font-weight:bold}.poll_table td.l{border-left:1px solid #E5E5E5}.poll_table td.r{border-right:1px solid #E5E5E5}.poll_table td.poll_content{padding:18px 13px 18px 13px}.poll_table td.poll_button{border:1px solid #E5E5E5;border-bottom:none;background-color:#F6F6F5}.poll_table td.poll_button div{padding:5px 0 2px 0;text-align:center}.poll_table td.b{background-color:#F6F6F5;height:7px}.poll_table td.b img{width:100%;height:6px;border-bottom:1px solid #E5E5E5}.poll_table td.bb{height:7px}.poll_table td.bb img{width:100%;height:6px;border-bottom:1px solid #E5E5E5}.poll_table td.poll_content div.title{color:#000000;background-color:#F5F5F5;border-top:2px solid #C1C0BD;border-bottom:2px solid #C1C0BD;font-weight:bold;padding:7px 0 7px 10px;margin-bottom:10px}.poll_table td.poll_content div.item_text{color:#636363;padding:0 10px 0 10px;margin-top:10px}.poll_table td.poll_content div.item_text strong{font-weight:bold;color:#000000;font-family:;font-size:12px}.poll_table td.poll_content table.item_bar_table{width:100%;table-layout:fixed;border-bottom:1px solid #EDEDED;margin-top:10px}.poll_table td.poll_content table.noborder{border-bottom:none;margin-bottom:10px}.poll_table td.poll_content table.item_bar_table td.bar{padding:0 0 5px 0;background:url(../images/back_bar.png) repeat-x left 4px}.poll_table td.poll_content table.item_bar_table td.bar img{width:100%;height:6px}.poll_table td.poll_content table.item_bar_table td.status{font-size:.9em;padding-bottom:5px;color:#636363;padding-left:15px}.poll_table td.poll_content table.item_bar_table td.status strong{font-weight:bold;color:#58C011}.poll_table td.poll_content div.item{color:#636363;border-bottom:1px solid #EDEDED;padding:5px 0 8px 10px;margin-bottom:3px}.poll_table td.poll_content div.noborder{border-bottom:none;margin-bottom:10px}.poll_table td.poll_content div.checkcount{border-bottom:1px dashed #EDEDED;padding:0 0 8px 10px;margin-bottom:3px;text-align:right;color:#636363}
.poll_table{table-layout:fixed;width:100%;padding:0;border:0}.poll_table td{padding:0;margin:0}.poll_table td.h{background:url(../images/top_bg.png) repeat-x left top}.poll_table td.title{height:28px;background:url(../images/top_title_bg.png) repeat-x left top;padding:0 20px 0 20px;color:#c3c3c4}.poll_table td.title strong{color:#fff;font-weight:bold}.poll_table td.l{border-left:1px solid #e5e5e5}.poll_table td.r{border-right:1px solid #e5e5e5}.poll_table td.poll_content{padding:18px 13px 18px 13px}.poll_table td.poll_button{border:1px solid #e5e5e5;border-bottom:0;background-color:#f6f6f5}.poll_table td.poll_button div{padding:5px 0 2px 0;text-align:center}.poll_table td.b{background-color:#f6f6f5;height:7px}.poll_table td.b img{width:100%;height:6px;border-bottom:1px solid #e5e5e5}.poll_table td.bb{height:7px}.poll_table td.bb img{width:100%;height:6px;border-bottom:1px solid #e5e5e5}.poll_table td.poll_content div.title{color:#000;background-color:#f5f5f5;border-top:2px solid #c1c0bd;border-bottom:2px solid #c1c0bd;font-weight:bold;padding:7px 0 7px 10px;margin-bottom:10px}.poll_table td.poll_content div.item_text{color:#636363;padding:0 10px 0 10px;margin-top:10px}.poll_table td.poll_content div.item_text strong{font-weight:bold;color:#000;font-family:;font-size:12px}.poll_table td.poll_content table.item_bar_table{width:100%;table-layout:fixed;border-bottom:1px solid #ededed;margin-top:10px}.poll_table td.poll_content table.noborder{border-bottom:0;margin-bottom:10px}.poll_table td.poll_content table.item_bar_table td.bar{padding:0 0 5px 0;background:url(../images/back_bar.png) repeat-x left center}.poll_table td.poll_content table.item_bar_table td.bar img{width:100%;height:6px}.poll_table td.poll_content table.item_bar_table td.status{font-size:.9em;padding-bottom:5px;color:#636363;padding-left:15px}.poll_table td.poll_content table.item_bar_table td.status strong{font-weight:bold;color:#58c011}.poll_table td.poll_content div.item{color:#636363;border-bottom:1px solid #ededed;padding:5px 0 8px 10px;margin-bottom:3px}.poll_table td.poll_content div.noborder{border-bottom:0;margin-bottom:10px}.poll_table td.poll_content div.checkcount{border-bottom:1px dashed #ededed;padding:0 0 8px 10px;margin-bottom:3px;text-align:right;color:#636363}.poll_table tr.cap>td{font-size:0;line-height:0;height:7px;overflow:hidden}

View file

@ -6,13 +6,13 @@
<load target="../../tpl/js/poll.min.js" />
<!--@end-->
<script type="text/javascript">
<script>
var poll_alert_lang = "{$lang->msg_check_poll_item}";
</script>
<div id="poll_{$poll->poll_srl}" style="{$poll->style}">
<div cond="$XE_VALIDATOR_MESSAGE" class="message {$XE_VALIDATOR_MESSAGE_TYPE}">
<div cond="$XE_VALIDATOR_MESSAGE && $XE_VALIDATOR_ID == 'modules/poll/skins/default/form/1'" class="message {$XE_VALIDATOR_MESSAGE_TYPE}">
<p>{$XE_VALIDATOR_MESSAGE}</p>
</div>
<form ruleset="poll" action="./" method="post" onsubmit="return doPoll(this)">
@ -22,19 +22,19 @@
<input type="hidden" name="poll_srl_indexes" value="" />
<input type="hidden" name="skin" value="{$skin}" />
<input type="hidden" name="success_return_url" value="{getRequestUriByServerEnviroment()}" />
<input type="hidden" name="xe_validator_id" value="modules/poll/skins/default/form/1" />
<table cellspacing="0" class="poll_table">
<col width="7" />
<col />
<col width="7" />
<tr>
<tr class="cap">
<td><img src="./images/lh.png" alt="lh" width="7" height="7" /></td>
<td class="h"><img src="./images/blank.gif" height="7" alt="blank" /></td>
<td><img src="./images/rh.png" alt="rh" width="7" height="7" /></td>
</tr>
<tr>
<td class="title" colspan="3">
{$lang->poll_stop_date} : <strong>{zdate($poll->stop_date, "Y-m-d")}</strong>
{$lang->poll_stop_date}: <strong>{zdate($poll->stop_date, "Y-m-d")}</strong>
</td>
</tr>
<tr>
@ -77,12 +77,12 @@
<tr>
<td colspan="3" class="poll_button">
<div>
<span class="btn"><input type="button" value="{$lang->cmd_view_result}" class="poll_button _poll_result _srl_{$poll->poll_srl} _skin_{$skin}" /></span>
<span class="btn"><input type="submit" value="{$lang->cmd_apply_poll}" class="poll_button" /></span>
<input type="button" value="{$lang->cmd_view_result}" class="btn poll_button _poll_result _srl_{$poll->poll_srl} _skin_{$skin}" />
<input type="submit" value="{$lang->cmd_apply_poll}" class="btn poll_button" />
</div>
</td>
</tr>
<tr>
<tr class="cap">
<td class="lb" ><img src="./images/lb.png" alt="lb" width="7" height="7" /></td>
<td class="b"><img src="./images/blank.gif" alt="blank" /></td>
<td class="rb" ><img src="./images/rb.png" alt="rb" width="7" height="7" /></td>

View file

@ -1,23 +1,25 @@
<!--%import("css/poll.css")-->
<load target="css/poll.css" />
<div class="poll_box" style="{$poll->style}">
<div cond="$XE_VALIDATOR_MESSAGE && $XE_VALIDATOR_ID == 'modules/poll/skins/default/form/1'" class="message {$XE_VALIDATOR_MESSAGE_TYPE}">
<p>{$XE_VALIDATOR_MESSAGE}</p>
</div>
<table cellspacing="0" class="poll_table">
<col width="7" />
<col />
<col width="7" />
<tr>
<tr class="cap">
<td><img src="./images/lh.png" alt="lh" width="7" height="7" /></td>
<td class="h"><img src="./images/blank.gif" height="7" alt="blank" /></td>
<td><img src="./images/rh.png" alt="rh" width="7" height="7" /></td>
</tr>
<tr>
<td class="title" colspan="3">
<div class="fl">
{$lang->poll_stop_date} : <strong>{zdate($poll->stop_date, "Y-m-d")}</strong> {zdate($poll->stop_date, "H:i")}
<div style="float:left">
{$lang->poll_stop_date}: <strong>{zdate($poll->stop_date, "Y-m-d")}</strong> {zdate($poll->stop_date, "H:i")}
</div>
<div class="fr">
{$lang->poll_join_count} : <strong>{number_format($poll->poll_count)}</strong>
<div style="float:right">
{$lang->poll_join_count}: <strong>{number_format($poll->poll_count)}</strong>
</div>
</td>
</tr>
@ -55,7 +57,7 @@
</td>
<td class="r"><img src="./images/blank.gif" height="7" alt="blank" /></td>
</tr>
<tr>
<tr class="cap">
<td class="rlb" ><img src="./images/rlb.png" alt="lb" width="7" height="7" /></td>
<td class="bb"><img src="./images/blank.gif" alt="blank" /></td>
<td class="rrb" ><img src="./images/rrb.png" alt="rb" width="7" height="7" /></td>

View file

@ -6,13 +6,13 @@
<load target="../../tpl/js/poll.min.js" />
<!--@end-->
<script type="text/javascript">
<script>
var poll_alert_lang = "{$lang->msg_check_poll_item}";
</script>
<div id="poll_{$poll->poll_srl}" style="{$poll->style}">
<div cond="$XE_VALIDATOR_MESSAGE" class="message {$XE_VALIDATOR_MESSAGE_TYPE}">
<div cond="$XE_VALIDATOR_MESSAGE && $XE_VALIDATOR_ID == 'module/poll/skins/simple/form/1'" class="message {$XE_VALIDATOR_MESSAGE_TYPE}">
<p>{$XE_VALIDATOR_MESSAGE}</p>
</div>
<form action="./" method="post" onsubmit="return doPoll(this)">
@ -22,6 +22,7 @@
<input type="hidden" name="poll_srl_indexes" value="" />
<input type="hidden" name="skin" value="{$skin}" />
<input type="hidden" name="success_return_url" value="{getRequestUriByServerEnviroment()}" />
<input type="hidden" name="xe_validator_id" value="module/poll/skins/simple/form/1" />
<table cellspacing="0" class="simple_poll">
<tr>

View file

@ -1,7 +1,10 @@
<!--%import("css/poll.css")-->
<div style="{$poll->style}">
<div cond="$XE_VALIDATOR_MESSAGE && $XE_VALIDATOR_ID == 'module/poll/skins/simple/form/1'" class="message {$XE_VALIDATOR_MESSAGE_TYPE}">
<p>{$XE_VALIDATOR_MESSAGE}</p>
</div>
<table cellspacing="0" class="simple_poll">
<tr>
<td>

View file

@ -1,38 +1,37 @@
<load target="js/poll_admin.js" usecdn="true" />
<!--#include("./header.html")-->
<div cond="$XE_VALIDATOR_MESSAGE" class="message {$XE_VALIDATOR_MESSAGE_TYPE}">
<div cond="$XE_VALIDATOR_MESSAGE && $XE_VALIDATOR_ID == 'modules/poll/tpl/config/1'" class="message {$XE_VALIDATOR_MESSAGE_TYPE}">
<p>{$XE_VALIDATOR_MESSAGE}</p>
</div>
<form ruleset="insertConfig" action="./" method="post" id="fo_poll">
<input type="hidden" name="module" value="poll" />
<input type="hidden" name="act" value="procPollAdminInsertConfig" />
<div class="table">
<table width="100%" border="1" cellspacing="0">
<tr>
<th scope="col">{$lang->skin}</th>
<td>
<select name="skin" onchange="doDisplaySkinColorset(this);return false;">
<!--@foreach($skin_list as $key => $val)-->
<option value="{$key}" <!--@if($config->skin == $key)-->selected="selected"<!--@end-->>{$val->title} ({htmlspecialchars($key)})</option>
<!--@end-->
</select>
</td>
</tr>
<tr>
<th scope="col">{$lang->colorset}</th>
<td>
<select name="colorset" id="poll_colorset">
<!--@foreach($colorset_list as $key => $val)-->
<option value="{$val->name}" <!--@if($config->colorset == $val->name)-->selected="selected"<!--@end-->>{$val->title} ({$val->name})</option>
<!--@end-->
</select>
</td>
</tr>
</tbody>
</table>
</div>
<input type="hidden" name="xe_validator_id" value="modules/poll/tpl/config/1" />
<table class="x_table x_table-striped x_table-hover">
<tr>
<th scope="col">{$lang->skin}</th>
<td>
<select name="skin" onchange="doDisplaySkinColorset(this);return false;">
<!--@foreach($skin_list as $key => $val)-->
<option value="{$key}" <!--@if($config->skin == $key)-->selected="selected"<!--@end-->>{$val->title} ({htmlspecialchars($key)})</option>
<!--@end-->
</select>
</td>
</tr>
<tr>
<th scope="col">{$lang->colorset}</th>
<td>
<select name="colorset" id="poll_colorset">
<!--@foreach($colorset_list as $key => $val)-->
<option value="{$val->name}" <!--@if($config->colorset == $val->name)-->selected="selected"<!--@end-->>{$val->title} ({$val->name})</option>
<!--@end-->
</select>
</td>
</tr>
</tbody>
</table>
<div class="btnArea">
<span class="btn"><input type="submit" value="{$lang->cmd_registration}" /></span>
<input class="btn" type="submit" value="{$lang->cmd_registration}" />
</div>
</form>

View file

@ -55,50 +55,6 @@ function completeMovePoll(ret_obj, response_tags) {
winopen(url, 'pollTarget');
}
function getPollList()
{
var pollListTable = jQuery('#pollListTable');
var cartList = [];
pollListTable.find(':checkbox[name=cart]').each(function(){
if(this.checked) cartList.push(this.value);
});
var params = new Array();
var response_tags = ['error','message', 'poll_list'];
params["poll_srls"] = cartList.join(",");
exec_xml('poll','procPollGetList',params, completeGetPollList, response_tags);
}
function completeGetPollList(ret_obj, response_tags)
{
var htmlListBuffer = '';
if(ret_obj['poll_list'] == null)
{
htmlListBuffer = '<tr>' +
'<td colspan="3" style="text-align:center;">'+ret_obj['message']+'</td>' +
'</tr>';
}
else
{
var poll_list = ret_obj['poll_list']['item'];
if(!jQuery.isArray(poll_list)) poll_list = [poll_list];
for(var x in poll_list)
{
var objPoll = poll_list[x];
htmlListBuffer += '<tr>' +
'<td class="title">'+objPoll.title+'</td>' +
'<td class="nowr">'+objPoll.poll_count+'</td>' +
'<td class="nowr">'+objPoll.nick_name+'</td>' +
'</tr>' +
'<input type="hidden" name="cart[]" value="'+objPoll.poll_index_srl+'" />';
}
jQuery('#selectedPollCount').html(poll_list.length);
}
jQuery('#pollManageListTable>tbody').html(htmlListBuffer);
}
function checkSearch(form)
{
if(form.search_target.value == '')
@ -112,3 +68,24 @@ function checkSearch(form)
return false;
}
}
jQuery(function ($){
$('#pollList').submit(function(e){
var cnt = $('#pollList tbody :checked').length;
if(cnt == 0)
{
e.stopPropagation();
alert(xe.lang.msg_select_poll);
return false;
}
var msg = xe.lang.confirm_poll_delete.replace("%s", cnt);
if(!confirm(msg))
{
e.stopPropagation();
return false;
}
});
});

View file

@ -1,9 +1 @@
/**
* @file modules/poll/js/poll_admin.js
* @author NHN (developers@xpressengine.com)
* @brief poll 모듈의 관리자용 javascript
**/
function doDisplaySkinColorset(sel,colorset){var skin=sel.options[sel.selectedIndex].value,params=new Array();params.skin=skin;params.colorset=colorset;var response_tags=new Array("error","message","colorset_list");exec_xml("poll","getPollGetColorsetList",params,completeGetSkinColorset,response_tags,params)}
function completeGetSkinColorset(ret_obj,response_tags,params,fo_obj){var sel=get_by_id("fo_poll").poll_colorset,length=sel.options.length,selected_colorset=params.colorset;for(var i=0;i<length;i++)sel.remove(0);var colorset_list=ret_obj.colorset_list.split("\n"),selected_index=0;for(var i=0;i<colorset_list.length;i++){var tmp=colorset_list[i].split("|@|");if(selected_colorset&&selected_colorset==tmp[0])selected_index=i;var opt=new Option(tmp[1],tmp[0],false,false);sel.options.add(opt)};sel.selectedIndex=selected_index}
function doMovePoll(poll_srl,upload_target_srl){var params=new Array();params.poll_srl=poll_srl;params.upload_target_srl=upload_target_srl;var response_tags=new Array('error','message','document_srl','comment_srl');exec_xml('poll','getPollAdminTarget',params,completeMovePoll,response_tags)}
function completeMovePoll(ret_obj,response_tags){var document_srl=ret_obj.document_srl,comment_srl=ret_obj.comment_srl,url=request_uri.setQuery('document_srl',document_srl);if(comment_srl)url=url+'#comment_'+comment_srl;winopen(url,'pollTarget')}
function doDisplaySkinColorset(b,e){var c=b.options[b.selectedIndex].value;var d=new Array();d.skin=c;d.colorset=e;var a=new Array("error","message","colorset_list");exec_xml("poll","getPollGetColorsetList",d,completeGetSkinColorset,a,d);}function completeGetSkinColorset(g,a,f,e){var c=get_by_id("fo_poll").poll_colorset;var d=c.options.length;var l=f.colorset;for(var j=0;j<d;j++){c.remove(0);}var m=g.colorset_list.split("\n");var k=0;for(var j=0;j<m.length;j++){var h=m[j].split("|@|");if(l&&l==h[0]){k=j;}var b=new Option(h[1],h[0],false,false);c.options.add(b);}c.selectedIndex=k;}function doMovePoll(a,b){var d=new Array();d.poll_srl=a;d.upload_target_srl=b;var c=new Array("error","message","document_srl","comment_srl");exec_xml("poll","getPollAdminTarget",d,completeMovePoll,c);}function completeMovePoll(c,d){var e=c.document_srl;var a=c.comment_srl;var b=request_uri.setQuery("document_srl",e);if(a){b=b+"#comment_"+a;}winopen(b,"pollTarget");}function checkSearch(a){if(a.search_target.value==""){alert(xe.lang.msg_empty_search_target);return false;}if(a.search_keyword.value==""){alert(xe.lang.msg_empty_search_keyword);return false;}}jQuery(function(a){a("#pollList").submit(function(c){var b=a("#pollList tbody :checked").length;if(b==0){c.stopPropagation();alert(xe.lang.msg_select_poll);return false;}var d=xe.lang.confirm_poll_delete.replace("%s",b);if(!confirm(d)){c.stopPropagation();return false;}});});

View file

@ -1,131 +1,126 @@
<script type="text/javascript">
<script>
xe.lang.msg_empty_search_target = '{$lang->msg_empty_search_target}';
xe.lang.msg_empty_search_keyword = '{$lang->msg_empty_search_keyword}';
xe.lang.msg_select_poll = '{$lang->msg_poll_is_null}';
xe.lang.confirm_poll_delete = '{$lang->confirm_poll_delete}';
</script>
<load target="js/poll_admin.js" usecdn="true" />
<div cond="$XE_VALIDATOR_MESSAGE" class="message {$XE_VALIDATOR_MESSAGE_TYPE}">
<div class="x_page-header">
<h1>{$lang->poll} <a class="x_icon-question-sign" href="./admin/help/index.html#UMAN_content_poll" target="_blank">{$lang->help}</a></h1>
</div>
<div cond="$XE_VALIDATOR_MESSAGE && $XE_VALIDATOR_ID == 'modules/poll/tpl/poll_list/1'" class="message {$XE_VALIDATOR_MESSAGE_TYPE}">
<p>{$XE_VALIDATOR_MESSAGE}</p>
</div>
<form action="" class="form">
<input type="hidden" name="module" value="poll" />
<h1 class="h1">{$lang->poll}</h1>
<div class="table even">
<table width="100%" border="1" cellspacing="0" id="pollListTable">
<caption>
All({number_format($total_count)})
<span class="side"><span class="btn"><a href="#listManager" class="modalAnchor" onclick="getPollList();">{$lang->poll_manager}...</a></span></span>
</caption>
<thead>
<tr>
<th scope="col" class="text">{$lang->title}</th>
<th scope="col" class="nowr">{$lang->poll_checkcount}</th>
<th scope="col" class="nowr">{$lang->poll_join_count}</th>
<th scope="col" class="nowr">{$lang->author}</th>
<th scope="col" class="nowr">{$lang->regdate}</th>
<th scope="col" class="nowr">{$lang->poll_stop_date}</th>
<th scope="col"><input type="checkbox" data-name="cart"title="Check All" /></th>
</tr>
</thead>
<tfoot>
<tr>
<th scope="col" class="text">{$lang->title}</th>
<th scope="col" class="nowr">{$lang->poll_checkcount}</th>
<th scope="col" class="nowr">{$lang->poll_join_count}</th>
<th scope="col" class="nowr">{$lang->author}</th>
<th scope="col" class="nowr">{$lang->regdate}</th>
<th scope="col" class="nowr">{$lang->poll_stop_date}</th>
<th scope="col"><input type="checkbox" data-name="cart" title="Check All" /></th>
</tr>
</tfoot>
<tbody>
<!--@foreach($poll_list as $no => $val)-->
<tr>
<td class="title"><a href="<!--@if($val->document_srl)-->{getUrl('')}?document_srl={$val->document_srl}<!--@end--><!--@if($val->comment_srl)-->#comment_{$val->comment_srl}<!--@end-->" target="_blank">{$val->title}</a></td>
<td class="nowr"><!--@if($val->checkcount == 1)-->{$lang->single_check}<!--@else-->{$lang->multi_check}<!--@end--></td>
<td class="nowr">{$val->poll_count}</td>
<td class="nowr"><a href="#popup_menu_area" class="member_{$val->member_srl}">{$val->nick_name}</a></td>
<td class="nowr">{zdate($val->poll_regdate,"Y-m-d H:i")}</td>
<td class="nowr">{zdate($val->poll_stop_date,"Y-m-d")}</td>
<td>
<input type="checkbox" name="cart" value="{$val->poll_index_srl}" />
</td>
</tr>
<!--@end-->
</tbody>
</table>
<div class="btnArea">
<span class="btn"><a href="#listManager" class="modalAnchor" onclick="getPollList();">{$lang->poll_manager}...</a></span>
</div>
</div>
</form>
<div class="modal" id="listManager">
<form ruleset="deleteChecked" action="./" method="post" class="fg form">
<input type="hidden" name="module" value="poll" />
<form ruleset="deleteChecked" action="./" method="post" id="pollList">
<input type="hidden" name="act" value="procPollAdminDeleteChecked" />
<input type="hidden" name="page" value="{$page}" />
<h2 class="h2">{$lang->poll_manager}</h2>
<div class="table">
<table width="100%" border="1" cellspacing="0" id="pollManageListTable">
<caption>{$lang->selected_poll} <strong id="selectedPollCount"></strong></caption>
<thead>
<tr>
<th scope="col" class="text">{$lang->title}</th>
<th scope="col">{$lang->poll_join_count}</th>
<th scope="col">{$lang->author}</th>
</tr>
</thead>
<tbody>
</tbody>
</table>
</div>
<div class="btnArea">
<span class="btn"><input type="submit" value="Delete" /></span>
</div>
</form>
</div>
<div class="search">
<form action="" class="pagination">
<input type="hidden" name="error_return_url" value="" />
<input type="hidden" name="module" value="{$module}" />
<input type="hidden" name="act" value="{$act}" />
<input cond="$search_keyword" type="hidden" name="search_keyword" value="{$search_keyword}" />
<input cond="$search_target" type="hidden" name="search_target" value="{$search_target}" />
<a href="{getUrl('page', '')}" class="direction">&laquo; FIRST</a>
<block cond="$page_navigation->first_page + $page_navigation->page_count > $page_navigation->last_page && $page_navigation->page_count != $page_navigation->total_page">
{@$isGoTo = true}
<a href="{getUrl('page', '')}">1</a>
<a href="#goTo" class="tgAnchor" title="{$lang->cmd_go_to_page}">...</a>
</block>
<!--@while($page_no = $page_navigation->getNextPage())-->
{@$last_page = $page_no}
<strong cond="$page_no == $page">{$page_no}</strong>
<a cond="$page_no != $page" href="{getUrl('page', $page_no)}">{$page_no}</a>
<!--@end-->
<block cond="$last_page != $page_navigation->last_page">
{@$isGoTo = true}
<a href="#goTo" class="tgAnchor" title="{$lang->cmd_go_to_page}">...</a>
<a href="{getUrl('page', $page_navigation->last_page)}">{$page_navigation->last_page}</a>
</block>
<a href="{getUrl('page', $page_navigation->last_page)}" class="direction">LAST &raquo;</a>
<span cond="$isGoTo" id="goTo" class="tgContent">
<input name="page" title="{$lang->cmd_go_to_page}" />
<button type="submit">Go</button>
<input type="hidden" name="module" value="poll" />
<input type="hidden" name="xe_validator_id" value="modules/poll/tpl/poll_list/1" />
<table class="x_table x_table-striped x_table-hover" id="pollListTable">
<caption>
<strong>{$lang->all}({number_format($total_count)})</strong>
<span class="x_pull-right">
<input type="submit" class="x_btn _allowFreqSubmit" value="{$lang->delete}" />
</span>
</caption>
<thead>
<tr>
<th scope="col" class="text">{$lang->title}</th>
<th scope="col" class="nowr">{$lang->poll_checkcount}</th>
<th scope="col" class="nowr">{$lang->poll_join_count}</th>
<th scope="col" class="nowr">{$lang->author}</th>
<th scope="col" class="nowr">{$lang->regdate}</th>
<th scope="col" class="nowr">{$lang->poll_stop_date}</th>
<th scope="col"><input type="checkbox" title="Check All" /></th>
</tr>
</thead>
<tbody>
<tr loop="$poll_list => $no,$val">
<td class="title"><a href="<!--@if($val->document_srl)-->{getUrl('')}?document_srl={$val->document_srl}<!--@end--><!--@if($val->comment_srl)-->#comment_{$val->comment_srl}<!--@end-->" target="_blank">{$val->title}</a></td>
<td class="nowr"><!--@if($val->checkcount == 1)-->{$lang->single_check}<!--@else-->{$lang->multi_check}<!--@end--></td>
<td class="nowr">{$val->poll_count}</td>
<td class="nowr"><a href="#popup_menu_area" class="member_{$val->member_srl}">{$val->nick_name}</a></td>
<td class="nowr">{zdate($val->poll_regdate,"Y-m-d H:i")}</td>
<td class="nowr">{zdate($val->poll_stop_date,"Y-m-d")}</td>
<td>
<input type="checkbox" name="cart[]" value="{$val->poll_index_srl}" />
</td>
</tr>
<tr cond="!$poll_list">
<td colspan="7" style="text-align:center">{$lang->no_data}</td>
</tr>
</tbody>
</table>
<span class="x_pull-right">
<input type="submit" class="x_btn _allowFreqSubmit" value="{$lang->delete}" />
</span>
</form>
<form action="./" method="get" onsubmit="return checkSearch(this)">
<form action="./" class="x_pagination x_pull-left" style="margin:0" no-error-return-url="true">
<input type="hidden" name="module" value="{$module}" />
<input type="hidden" name="act" value="{$act}" />
<input type="hidden" name="error_return_url" value="" />
<select name="search_target">
<option value="">{$lang->search_target}</option>
<!--@foreach($lang->search_target_list as $key => $val)-->
<option value="{$key}" <!--@if($search_target==$key)-->selected="selected"<!--@end-->>{$val}</option>
<!--@end-->
</select>
<input type="text" name="search_keyword" value="{htmlspecialchars($search_keyword)}" />
<input type="submit" value="{$lang->cmd_search}" />
<a href="{getUrl('','module',$module,'act',$act)}">{$lang->cmd_cancel}</a>
</form>
</div>
<input cond="$search_keyword" type="hidden" name="search_keyword" value="{$search_keyword}" />
<input cond="$search_target" type="hidden" name="search_target" value="{$search_target}" />
<ul>
<li class="x_disabled"|cond="!$page || $page == 1"><a href="{getUrl('page', '')}">&laquo; {$lang->first_page}</a></li>
<block cond="$page_navigation->first_page != 1 && $page_navigation->first_page + $page_navigation->page_count > $page_navigation->last_page - 1 && $page_navigation->page_count != $page_navigation->total_page">
{@$isGoTo = true}
<li>
<a href="#goTo" data-toggle title="{$lang->cmd_go_to_page}">&hellip;</a>
<span cond="$isGoTo" id="goTo" class="x_input-append">
<input type="number" min="1" max="{$page_navigation->last_page}" required name="page" title="{$lang->cmd_go_to_page}" />
<button type="submit" class="x_add-on">Go</button>
</span>
</li>
</block>
<!--@while($page_no = $page_navigation->getNextPage())-->
{@$last_page = $page_no}
<li class="x_active"|cond="$page_no == $page"><a href="{getUrl('page', $page_no)}">{$page_no}</a></li>
<!--@end-->
<block cond="$last_page != $page_navigation->last_page && $last_page + 1 != $page_navigation->last_page">
{@$isGoTo = true}
<li>
<a href="#goTo" data-toggle title="{$lang->cmd_go_to_page}">&hellip;</a>
<span cond="$isGoTo" id="goTo" class="x_input-append">
<input type="number" min="1" max="{$page_navigation->last_page}" required name="page" title="{$lang->cmd_go_to_page}" />
<button type="submit" class="x_add-on">Go</button>
</span>
</li>
</block>
<li class="x_disabled"|cond="$page == $page_navigation->last_page"><a href="{getUrl('page', $page_navigation->last_page)}" title="{$page_navigation->last_page}">{$lang->last_page} &raquo;</a></li>
</ul>
</form>
<form action="./" method="get" class="search center x_input-append" style="clear:both;padding:10px 0 0 0;margin:0" no-error-return-url="true">
<input type="hidden" name="module" value="{$module}" />
<input type="hidden" name="act" value="{$act}" />
<select name="search_target" title="{$lang->search_target}" style="margin-right:4px">
<option loop="$lang->search_poll_target_list => $key, $val" value="{$key}" selected="selected"|cond="$search_target==$key">{$val}</option>
</select>
<input type="search" name="search_keyword" value="{htmlspecialchars($search_keyword)}" />
<button class="x_btn x_btn-inverse" type="submit">{$lang->cmd_search}</button>
<a class="x_btn" href="{getUrl('','module',$module,'act',$act)}">{$lang->cmd_cancel}</a>
</form>
<script>
jQuery(function($){
// Modal anchor activation
var $docTable = $('#pollListTable');
var $submit = $('#pollList [type="submit"]');
$docTable.find(':checkbox').change(function(){
if($docTable.find('tbody :checked').length == 0){
$submit.addClass('x_disabled');
} else {
$submit.removeClass('x_disabled');
}
}).change();
// Button action
$submit.click(function(){
if($docTable.find('tbody :checked').length == 0){
alert(xe.lang.msg_select_poll);
return false;
}
});
});
</script>