From c2209ea9b05efc2f8849ed0adc77c34cf47b9dc5 Mon Sep 17 00:00:00 2001 From: zero Date: Fri, 6 Apr 2007 06:01:02 +0000 Subject: [PATCH] git-svn-id: http://xe-core.googlecode.com/svn/trunk@1004 201d5d3c-b55e-5fd7-737f-ddc643e51545 --- .../{poll.class.php => poll_maker.class.php} | 6 +- .../editor/components/poll_maker/tpl/popup.js | 2 +- modules/editor/editor.class.php | 2 +- modules/poll/poll.model.php | 43 +++++++++- modules/poll/queries/getPoll.xml | 11 +++ modules/poll/queries/getPollItem.xml | 11 +++ modules/poll/queries/getPollLog.xml | 13 +++ modules/poll/queries/getPollTitle.xml | 11 +++ modules/poll/tpl/filter/delete_checked.xml | 12 --- modules/poll/tpl/filter/poll.xml | 5 ++ modules/poll/tpl/form.html | 2 + modules/poll/tpl/trackback_list.html | 83 ------------------- 12 files changed, 99 insertions(+), 102 deletions(-) rename modules/editor/components/poll_maker/{poll.class.php => poll_maker.class.php} (92%) create mode 100644 modules/poll/queries/getPoll.xml create mode 100644 modules/poll/queries/getPollItem.xml create mode 100644 modules/poll/queries/getPollLog.xml create mode 100644 modules/poll/queries/getPollTitle.xml delete mode 100644 modules/poll/tpl/filter/delete_checked.xml create mode 100644 modules/poll/tpl/filter/poll.xml create mode 100644 modules/poll/tpl/form.html delete mode 100644 modules/poll/tpl/trackback_list.html diff --git a/modules/editor/components/poll_maker/poll.class.php b/modules/editor/components/poll_maker/poll_maker.class.php similarity index 92% rename from modules/editor/components/poll_maker/poll.class.php rename to modules/editor/components/poll_maker/poll_maker.class.php index 432b7d302..103ebbb2a 100644 --- a/modules/editor/components/poll_maker/poll.class.php +++ b/modules/editor/components/poll_maker/poll_maker.class.php @@ -1,11 +1,11 @@ upload_target_srl = $upload_target_srl; $this->component_path = $component_path; } diff --git a/modules/editor/components/poll_maker/tpl/popup.js b/modules/editor/components/poll_maker/tpl/popup.js index cb9b3f76e..d4fa18087 100644 --- a/modules/editor/components/poll_maker/tpl/popup.js +++ b/modules/editor/components/poll_maker/tpl/popup.js @@ -27,7 +27,7 @@ function completeInsertPoll(ret_obj) { var poll_srl = ret_obj["poll_srl"]; if(!poll_srl) return null; - var text = ""; + var text = ""; alert(ret_obj['message']); diff --git a/modules/editor/editor.class.php b/modules/editor/editor.class.php index 282d3d356..1e7a0d1de 100644 --- a/modules/editor/editor.class.php +++ b/modules/editor/editor.class.php @@ -28,7 +28,7 @@ $oEditorController->insertComponent('url_link',true); $oEditorController->insertComponent('image_link',true); $oEditorController->insertComponent('multimedia_link',true); - $oEditorController->insertComponent('poll',true); + $oEditorController->insertComponent('poll_maker',true); $oEditorController->insertComponent('image_gallery',true); $oEditorController->insertComponent('quotation',true); $oEditorController->insertComponent('table_maker',true); diff --git a/modules/poll/poll.model.php b/modules/poll/poll.model.php index 17126135e..263e7c4bb 100644 --- a/modules/poll/poll.model.php +++ b/modules/poll/poll.model.php @@ -19,9 +19,48 @@ **/ function getPollHtml($poll_srl) { - return "SAdf"; - } + $args->poll_srl = $poll_srl; + // 해당 설문조사에 대한 내용을 조사 + $output = executeQuery('poll.getPoll', $args); + if(!$output->data) return ''; + + $poll->poll_count = (int)$output->data->poll_count; + $poll->stop_date = $output->data->stop_date; + + $output = executeQuery('poll.getPollTitle', $args); + 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; + } + + // 현 사용자가 설문조사에 응하였는지 검사 + $logged_info = Context::get('logged_info'); + $args->member_srl = $logged_info->member_srl; + $output = executeQuery('poll.getPollLog', $args); + if($output->data->count) $poll->poll_date = $output->data->regdate; + else $poll->poll_date = ''; + Context::set('poll', $poll); + + // 응하였다면 결과 html return + if($poll->poll_date) $template_file = "result"; + + // 응하지 않았다면 설문 form html return + else $template_file = "form"; + + $tpl_path = $this->module_path.'tpl'; + $tpl_file = $template_file; + + require_once("./classes/template/TemplateHandler.class.php"); + $oTemplate = new TemplateHandler(); + return $oTemplate->compile($tpl_path, $tpl_file); + } } ?> diff --git a/modules/poll/queries/getPoll.xml b/modules/poll/queries/getPoll.xml new file mode 100644 index 000000000..d3cadae80 --- /dev/null +++ b/modules/poll/queries/getPoll.xml @@ -0,0 +1,11 @@ + + + + + + + + + + + diff --git a/modules/poll/queries/getPollItem.xml b/modules/poll/queries/getPollItem.xml new file mode 100644 index 000000000..d36b46eff --- /dev/null +++ b/modules/poll/queries/getPollItem.xml @@ -0,0 +1,11 @@ + + +
+ + + + + + + + diff --git a/modules/poll/queries/getPollLog.xml b/modules/poll/queries/getPollLog.xml new file mode 100644 index 000000000..a6e7f38ee --- /dev/null +++ b/modules/poll/queries/getPollLog.xml @@ -0,0 +1,13 @@ + + +
+ + + + + + + + + + diff --git a/modules/poll/queries/getPollTitle.xml b/modules/poll/queries/getPollTitle.xml new file mode 100644 index 000000000..59a21c40c --- /dev/null +++ b/modules/poll/queries/getPollTitle.xml @@ -0,0 +1,11 @@ + + +
+ + + + + + + + diff --git a/modules/poll/tpl/filter/delete_checked.xml b/modules/poll/tpl/filter/delete_checked.xml deleted file mode 100644 index a410c54e6..000000000 --- a/modules/poll/tpl/filter/delete_checked.xml +++ /dev/null @@ -1,12 +0,0 @@ - -
- - - - - - - - - -
diff --git a/modules/poll/tpl/filter/poll.xml b/modules/poll/tpl/filter/poll.xml new file mode 100644 index 000000000..a10f85ecf --- /dev/null +++ b/modules/poll/tpl/filter/poll.xml @@ -0,0 +1,5 @@ + +
+ + +
diff --git a/modules/poll/tpl/form.html b/modules/poll/tpl/form.html new file mode 100644 index 000000000..f04c8c237 --- /dev/null +++ b/modules/poll/tpl/form.html @@ -0,0 +1,2 @@ + +haha diff --git a/modules/poll/tpl/trackback_list.html b/modules/poll/tpl/trackback_list.html deleted file mode 100644 index ebf329a47..000000000 --- a/modules/poll/tpl/trackback_list.html +++ /dev/null @@ -1,83 +0,0 @@ - - - -
- {$lang->total_count} : {number_format($total_count)}, - {$lang->page_count} : {number_format($page)} / {number_format($total_page)} -
- - - - - -
-
- - - - - - - - - - - - - - - - - - - - - - - - -
{$lang->no}{$lang->module}{$lang->blog_name}{$lang->title}{$lang->date}{$lang->ipaddress}{$lang->cmd_move}
{$no}{$module_list[$val->module_srl]->browser_title}{$val->blog_name}{$val->title}{zdate($val->regdate,"Y-m-d")}{$val->ipaddress}{$lang->cmd_move}
{$val->excerpt}
- - - -
- -
- - - - -
-
- - - -
- - - - -
-
-
- - - -
- [{$lang->first_page}] - - - - {$page_no} - - [{$page_no}] - - - - [{$lang->last_page}] -