NOISSUE PHP 5.4 이상 호환성 개선.

This commit is contained in:
bnu 2013-11-30 17:35:22 +09:00
parent 742af78932
commit 41ff8ace3b
32 changed files with 365 additions and 113 deletions

View file

@ -19,6 +19,7 @@ class pollAdminController extends poll
*/
function procPollAdminInsertConfig()
{
$config = new stdClass;
$config->skin = Context::get('skin');
$config->colorset = Context::get('colorset');
@ -66,6 +67,7 @@ class pollAdminController extends poll
$oPollAdminModel = &getAdminModel('poll');
//$columnList = array('comment_srl');
$args = new stdClass;
$args->pollIndexSrlList = array($poll_index_srl);
$args->list_count = 100;
@ -86,6 +88,9 @@ class pollAdminController extends poll
*/
function deletePollTitle($poll_index_srl)
{
$args = new stdClass;
$dargs = new stdClass;
$args->poll_index_srl = $poll_index_srl;
$oDB = &DB::getInstance();
@ -137,6 +142,7 @@ class pollAdminController extends poll
*/
function deletePoll($poll_srl)
{
$args = new stdClass;
$args->poll_srl = $poll_srl;
$oDB = &DB::getInstance();

View file

@ -88,9 +88,9 @@ class pollAdminView extends poll
Context::set('page', $output->page);
Context::set('poll_list', $output->data);
Context::set('page_navigation', $output->page_navigation);
Context::set('module_list', $module_list);
Context::set('module_list', $module_list);
$security = new Security();
$security = new Security();
$security->encodeHTML('poll_list..title', 'poll_list..nick_name');
// Set a template
$this->setTemplatePath($this->module_path.'tpl');
@ -114,7 +114,7 @@ class pollAdminView extends poll
// Set the skin colorset once the configurations is completed
Context::set('colorset_list', $skin_list[$config->skin]->colorset);
$security = new Security();
$security = new Security();
$security->encodeHTML('config..');
$security->encodeHTML('skin_list..title');
$security->encodeHTML('colorset_list..name','colorset_list..title');
@ -133,17 +133,21 @@ class pollAdminView extends poll
$this->setLayoutFile("popup_layout");
// Draw results
$args = new stdClass();
$args->poll_srl = Context::get('poll_srl');
$args->poll_index_srl = Context::get('poll_index_srl');
$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 = new stdClass();
$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');
if(!$output->data)
{
return $this->stop('msg_poll_not_exists');
}
$tmp = &$poll->poll[$args->poll_index_srl];
$tmp->title = $output->data->title;

View file

@ -16,6 +16,8 @@ class poll extends ModuleObject
$oModuleController = &getController('module');
// Set the default skin
$oModuleController = &getController('module');
$config = new stdClass;
$config->skin = 'default';
$config->colorset = 'normal';
$oModuleController->insertModuleConfig('poll', $config);

View file

@ -20,10 +20,15 @@ class pollController extends poll
function procInsert()
{
$stop_date = Context::get('stop_date');
if($stop_date < date("Ymd")) $stop_date = date("YmdHis", $_SERVER['REQUEST_TIME']+60*60*24*365);
if($stop_date < date("Ymd"))
{
$stop_date = date("YmdHis", $_SERVER['REQUEST_TIME']+60*60*24*365);
}
$logged_info = Context::get('logged_info');
$vars = Context::getRequestVars();
$args = new stdClass;
foreach($vars as $key => $val)
{
if(strpos($key,'tidx')) continue;
@ -50,15 +55,17 @@ class pollController extends poll
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 = new stdClass;
$poll_args->poll_srl = $poll_srl;
$poll_args->member_srl = $member_srl;
$poll_args->list_order = $poll_srl*-1;
@ -70,10 +77,12 @@ class pollController extends poll
$oDB->rollback();
return $output;
}
// Individual poll registration
foreach($args->poll as $key => $val)
{
unset($title_args);
$title_args = new stdClass;
$title_args->poll_srl = $poll_srl;
$title_args->poll_index_srl = getNextSequence();
$title_args->title = $val->title;
@ -88,10 +97,12 @@ class pollController extends poll
$oDB->rollback();
return $output;
}
// Add the individual survey items
foreach($val->item as $k => $v)
{
unset($item_args);
$item_args = new stdClass;
$item_args->poll_srl = $poll_srl;
$item_args->poll_index_srl = $title_args->poll_index_srl;
$item_args->title = $v;

View file

@ -19,6 +19,7 @@ class pollModel extends poll
*/
function isPolled($poll_srl)
{
$args = new stdClass;
$args->poll_srl = $poll_srl;
if(Context::get('is_logged'))
@ -41,12 +42,14 @@ class pollModel extends poll
*/
function getPollHtml($poll_srl, $style = '', $skin = 'default')
{
$args = new stdClass;
$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 '';
$poll = new stdClass;
$poll->style = $style;
$poll->poll_count = (int)$output->data->poll_count;
$poll->stop_date = $output->data->stop_date;
@ -55,8 +58,11 @@ class pollModel extends poll
$output = executeQuery('poll.getPollTitle', $args, $columnList);
if(!$output->data) return;
if(!is_array($output->data)) $output->data = array($output->data);
$poll->poll = array();
foreach($output->data as $key => $val)
{
$poll->poll[$val->poll_index_srl] = new stdClass;
$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;
@ -94,11 +100,13 @@ class pollModel extends poll
*/
function getPollResultHtml($poll_srl, $skin = 'default')
{
$args = new stdClass;
$args->poll_srl = $poll_srl;
// Get the information related to the survey
$output = executeQuery('poll.getPoll', $args);
if(!$output->data) return '';
$poll = new stdClass;
$poll->style = $style;
$poll->poll_count = (int)$output->data->poll_count;
$poll->stop_date = $output->data->stop_date;
@ -107,8 +115,11 @@ class pollModel extends poll
$output = executeQuery('poll.getPollTitle', $args, $columnList);
if(!$output->data) return;
if(!is_array($output->data)) $output->data = array($output->data);
$poll->poll = array();
foreach($output->data as $key => $val)
{
$poll->poll[$val->poll_index_srl] = new stdClass;
$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;