mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-22 04:39:55 +09:00
Author name update.
NHN developers@xpressengine.com http://xpressengine.com/ git-svn-id: http://xe-core.googlecode.com/svn/sandbox@7676 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
7d1fa86e5c
commit
8f385a592b
603 changed files with 67379 additions and 67522 deletions
|
|
@ -1,142 +1,142 @@
|
|||
<?php
|
||||
/**
|
||||
* @class pollModel
|
||||
* @author zero (zero@nzeo.com)
|
||||
* @brief poll 모듈의 model class
|
||||
**/
|
||||
|
||||
class pollModel extends poll {
|
||||
|
||||
/**
|
||||
* @brief 초기화
|
||||
**/
|
||||
function init() {
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 이미 설문 조사를 하였는지 검사하는 함수
|
||||
**/
|
||||
function isPolled($poll_srl) {
|
||||
$args->poll_srl = $poll_srl;
|
||||
|
||||
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 설문조사의 html데이터를 return
|
||||
* 설문조사에 응하였는지에 대한 체크를 한 후 결과를 return
|
||||
**/
|
||||
function getPollHtml($poll_srl, $style = '', $skin = 'default') {
|
||||
|
||||
$args->poll_srl = $poll_srl;
|
||||
|
||||
// 해당 설문조사에 대한 내용을 조사
|
||||
$output = executeQuery('poll.getPoll', $args);
|
||||
if(!$output->data) return '';
|
||||
|
||||
$poll->style = $style;
|
||||
$poll->poll_count = (int)$output->data->poll_count;
|
||||
$poll->stop_date = $output->data->stop_date;
|
||||
|
||||
$output = executeQuery('poll.getPollTitle', $args);
|
||||
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;
|
||||
}
|
||||
|
||||
$output = executeQuery('poll.getPollItem', $args);
|
||||
foreach($output->data as $key => $val) {
|
||||
$poll->poll[$val->poll_index_srl]->item[] = $val;
|
||||
}
|
||||
|
||||
$poll->poll_srl = $poll_srl;
|
||||
|
||||
// 종료일이 지났으면 무조건 결과만
|
||||
if($poll->stop_date > date("Ymd")) {
|
||||
if($this->isPolled($poll_srl)) $tpl_file = "result";
|
||||
else $tpl_file = "form";
|
||||
} else {
|
||||
$tpl_file = "result";
|
||||
}
|
||||
|
||||
Context::set('poll',$poll);
|
||||
Context::set('skin',$skin);
|
||||
|
||||
// 기본 설정의 스킨, 컬러셋 설정
|
||||
$tpl_path = sprintf("%sskins/%s/", $this->module_path, $skin);
|
||||
|
||||
$oTemplate = &TemplateHandler::getInstance();
|
||||
return $oTemplate->compile($tpl_path, $tpl_file);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 결과 html을 return
|
||||
**/
|
||||
function getPollResultHtml($poll_srl, $skin = 'default') {
|
||||
$args->poll_srl = $poll_srl;
|
||||
|
||||
// 해당 설문조사에 대한 내용을 조사
|
||||
$output = executeQuery('poll.getPoll', $args);
|
||||
if(!$output->data) return '';
|
||||
|
||||
$poll->style = $style;
|
||||
$poll->poll_count = (int)$output->data->poll_count;
|
||||
$poll->stop_date = $output->data->stop_date;
|
||||
|
||||
$output = executeQuery('poll.getPollTitle', $args);
|
||||
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;
|
||||
}
|
||||
|
||||
$output = executeQuery('poll.getPollItem', $args);
|
||||
foreach($output->data as $key => $val) {
|
||||
$poll->poll[$val->poll_index_srl]->item[] = $val;
|
||||
}
|
||||
|
||||
$poll->poll_srl = $poll_srl;
|
||||
|
||||
$tpl_file = "result";
|
||||
|
||||
Context::set('poll',$poll);
|
||||
|
||||
// 기본 설정의 스킨, 컬러셋 설정
|
||||
$tpl_path = sprintf("%sskins/%s/", $this->module_path, $skin);
|
||||
|
||||
$oTemplate = &TemplateHandler::getInstance();
|
||||
return $oTemplate->compile($tpl_path, $tpl_file);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 선택된 설문조사 - 스킨의 컬러셋을 return
|
||||
**/
|
||||
function getPollGetColorsetList() {
|
||||
$skin = Context::get('skin');
|
||||
|
||||
$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);
|
||||
}
|
||||
}
|
||||
?>
|
||||
<?php
|
||||
/**
|
||||
* @class pollModel
|
||||
* @author NHN (developers@xpressengine.com)
|
||||
* @brief poll 모듈의 model class
|
||||
**/
|
||||
|
||||
class pollModel extends poll {
|
||||
|
||||
/**
|
||||
* @brief 초기화
|
||||
**/
|
||||
function init() {
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 이미 설문 조사를 하였는지 검사하는 함수
|
||||
**/
|
||||
function isPolled($poll_srl) {
|
||||
$args->poll_srl = $poll_srl;
|
||||
|
||||
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 설문조사의 html데이터를 return
|
||||
* 설문조사에 응하였는지에 대한 체크를 한 후 결과를 return
|
||||
**/
|
||||
function getPollHtml($poll_srl, $style = '', $skin = 'default') {
|
||||
|
||||
$args->poll_srl = $poll_srl;
|
||||
|
||||
// 해당 설문조사에 대한 내용을 조사
|
||||
$output = executeQuery('poll.getPoll', $args);
|
||||
if(!$output->data) return '';
|
||||
|
||||
$poll->style = $style;
|
||||
$poll->poll_count = (int)$output->data->poll_count;
|
||||
$poll->stop_date = $output->data->stop_date;
|
||||
|
||||
$output = executeQuery('poll.getPollTitle', $args);
|
||||
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;
|
||||
}
|
||||
|
||||
$output = executeQuery('poll.getPollItem', $args);
|
||||
foreach($output->data as $key => $val) {
|
||||
$poll->poll[$val->poll_index_srl]->item[] = $val;
|
||||
}
|
||||
|
||||
$poll->poll_srl = $poll_srl;
|
||||
|
||||
// 종료일이 지났으면 무조건 결과만
|
||||
if($poll->stop_date > date("Ymd")) {
|
||||
if($this->isPolled($poll_srl)) $tpl_file = "result";
|
||||
else $tpl_file = "form";
|
||||
} else {
|
||||
$tpl_file = "result";
|
||||
}
|
||||
|
||||
Context::set('poll',$poll);
|
||||
Context::set('skin',$skin);
|
||||
|
||||
// 기본 설정의 스킨, 컬러셋 설정
|
||||
$tpl_path = sprintf("%sskins/%s/", $this->module_path, $skin);
|
||||
|
||||
$oTemplate = &TemplateHandler::getInstance();
|
||||
return $oTemplate->compile($tpl_path, $tpl_file);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 결과 html을 return
|
||||
**/
|
||||
function getPollResultHtml($poll_srl, $skin = 'default') {
|
||||
$args->poll_srl = $poll_srl;
|
||||
|
||||
// 해당 설문조사에 대한 내용을 조사
|
||||
$output = executeQuery('poll.getPoll', $args);
|
||||
if(!$output->data) return '';
|
||||
|
||||
$poll->style = $style;
|
||||
$poll->poll_count = (int)$output->data->poll_count;
|
||||
$poll->stop_date = $output->data->stop_date;
|
||||
|
||||
$output = executeQuery('poll.getPollTitle', $args);
|
||||
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;
|
||||
}
|
||||
|
||||
$output = executeQuery('poll.getPollItem', $args);
|
||||
foreach($output->data as $key => $val) {
|
||||
$poll->poll[$val->poll_index_srl]->item[] = $val;
|
||||
}
|
||||
|
||||
$poll->poll_srl = $poll_srl;
|
||||
|
||||
$tpl_file = "result";
|
||||
|
||||
Context::set('poll',$poll);
|
||||
|
||||
// 기본 설정의 스킨, 컬러셋 설정
|
||||
$tpl_path = sprintf("%sskins/%s/", $this->module_path, $skin);
|
||||
|
||||
$oTemplate = &TemplateHandler::getInstance();
|
||||
return $oTemplate->compile($tpl_path, $tpl_file);
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 선택된 설문조사 - 스킨의 컬러셋을 return
|
||||
**/
|
||||
function getPollGetColorsetList() {
|
||||
$skin = Context::get('skin');
|
||||
|
||||
$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);
|
||||
}
|
||||
}
|
||||
?>
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue