git-svn-id: http://xe-core.googlecode.com/svn/trunk@1004 201d5d3c-b55e-5fd7-737f-ddc643e51545

This commit is contained in:
zero 2007-04-06 06:01:02 +00:00
parent cf46548046
commit c2209ea9b0
12 changed files with 99 additions and 102 deletions

View file

@ -1,11 +1,11 @@
<?php
/**
* @class poll
* @class poll_maker
* @author zero (zero@nzeo.com)
* @brief 에디터에서 url링크하는 기능 제공.
**/
class poll extends EditorHandler {
class poll_maker extends EditorHandler {
// upload_target_srl 는 에디터에서 필수로 달고 다녀야 함....
var $upload_target_srl = 0;
@ -14,7 +14,7 @@
/**
* @brief upload_target_srl과 컴포넌트의 경로를 받음
**/
function poll($upload_target_srl, $component_path) {
function poll_maker($upload_target_srl, $component_path) {
$this->upload_target_srl = $upload_target_srl;
$this->component_path = $component_path;
}

View file

@ -27,7 +27,7 @@ function completeInsertPoll(ret_obj) {
var poll_srl = ret_obj["poll_srl"];
if(!poll_srl) return null;
var text = "<img src=\"./common/tpl/images/blank.gif\" poll_srl=\""+poll_srl+"\" editor_component=\"poll\" class=\"editor_component_output\" style=\"width:400px;height:300px;\" />";
var text = "<img src=\"./common/tpl/images/blank.gif\" poll_srl=\""+poll_srl+"\" editor_component=\"poll_maker\" class=\"editor_component_output\" style=\"width:400px;height:300px;\" />";
alert(ret_obj['message']);

View file

@ -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);

View file

@ -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);
}
}
?>

View file

@ -0,0 +1,11 @@
<query id="getPoll" action="select">
<tables>
<table name="poll" />
</tables>
<columns>
<column name="*" />
</columns>
<conditions>
<condition operation="equal" column="poll_srl" var="poll_srl" />
</conditions>
</query>

View file

@ -0,0 +1,11 @@
<query id="getPollItem" action="select">
<tables>
<table name="poll_title" />
</tables>
<columns>
<column name="*" />
</columns>
<conditions>
<condition operation="equal" column="poll_srl" var="poll_srl" />
</conditions>
</query>

View file

@ -0,0 +1,13 @@
<query id="getPollLog" action="select">
<tables>
<table name="poll_log" />
</tables>
<columns>
<column name="regdate" />
</columns>
<conditions>
<condition operation="equal" column="poll_srl" var="poll_srl" />
<condition operation="equal" column="member_srl" var="memer_srl" pipe="and" />
<condition operation="equal" column="ipaddress" var="ipaddress" default="ipaddress()" pipe="and" />
</conditions>
</query>

View file

@ -0,0 +1,11 @@
<query id="getPollTitle" action="select">
<tables>
<table name="poll_title" />
</tables>
<columns>
<column name="*" />
</columns>
<conditions>
<condition operation="equal" column="poll_srl" var="poll_srl" />
</conditions>
</query>

View file

@ -1,12 +0,0 @@
<filter name="delete_checked" module="trackback" act="procTrackbackAdminDeleteChecked" confirm_msg_code="confirm_delete">
<form>
<node target="cart" required="true" />
</form>
<parameter>
<param name="cart" target="cart" />
</parameter>
<response>
<tag name="error" />
<tag name="message" />
</response>
</filter>

View file

@ -0,0 +1,5 @@
<filter name="poll" module="poll" act="procPoll" confirm_msg_code="confirm_submit">
<form />
<parameter />
<response />
</filter>

View file

@ -0,0 +1,2 @@
<!--%import("filter/poll.xml")-->
haha

View file

@ -1,83 +0,0 @@
<!--%import("filter/delete_checked.xml")-->
<!-- 정보 -->
<div>
{$lang->total_count} : {number_format($total_count)},
{$lang->page_count} : {number_format($page)} / {number_format($total_page)}
</div>
<form action="./" method="get" onsubmit="return procFilter(this, delete_checked)">
<input type="hidden" name="page" value="{$page}" />
<!-- 목록 -->
<div>
<table>
<tr>
<th colspan="2">{$lang->no}</th>
<th>{$lang->module}</th>
<th>{$lang->blog_name}</th>
<th>{$lang->title}</th>
<th>{$lang->date}</th>
<th>{$lang->ipaddress}</th>
<th>{$lang->cmd_move}</th>
</tr>
<!--@foreach($trackback_list as $no => $val)-->
<tr>
<td rowspan="2">{$no}</td>
<td rowspan="2"><input type="checkbox" name="cart" value="{$val->trackback_srl}" /></td>
<td><a href="#" onclick="window.open('./?mid={$val->mid}');return false">{$module_list[$val->module_srl]->browser_title}</a></td>
<td><a href="#" onclick="window.open('{$val->url}');return false;">{$val->blog_name}</a></td>
<td>{$val->title}</td>
<td>{zdate($val->regdate,"Y-m-d")}</td>
<td>{$val->ipaddress}</td>
<td rowspan="2"><a href="#" onclick="window.open('./?document_srl={$val->document_srl}&amp;#trackback_{$val->trackback_srl}');return false">{$lang->cmd_move}</a></td>
</tr>
<tr>
<td colspan="5">{$val->excerpt}</td>
</tr>
<!--@end-->
</table>
</div>
<!-- 버튼 -->
<div>
<input type="submit" value="{$lang->cmd_delete_checked_trackback}" />
</div>
</form>
<!-- 검색 -->
<div>
<form action="./" method="get">
<input type="hidden" name="module" value="{$module}" />
<input type="hidden" name="act" value="{$act}" />
<div>
<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="true"<!--@end-->>{$val}</option>
<!--@end-->
</select>
<input type="text" name="search_keyword" value="{htmlspecialchars($search_keyword)}" />
<input type="submit" value="{$lang->cmd_search}" />
<input type="button" value="{$lang->cmd_cancel}" onclick="location.href='{getUrl('','module',$module,'act',$act)}'"/>
</div>
</form>
</div>
<!-- 페이지 네비게이션 -->
<div>
<a href="{getUrl('page','','trackback_srl','')}">[{$lang->first_page}]</a>
<!--@while($page_no = $page_navigation->getNextPage())-->
<!--@if($page == $page_no)-->
{$page_no}
<!--@else-->
<a href="{getUrl('page',$page_no,'trackback_srl','')}">[{$page_no}]</a>
<!--@end-->
<!--@end-->
<a href="{getUrl('page',$page_navigation->last_page,'trackback_srl','')}">[{$lang->last_page}]</a>
</div>