git-svn-id: http://xe-core.googlecode.com/svn/sandbox@2327 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
zero 2007-08-12 03:59:52 +00:00
commit 8326004cb2
2773 changed files with 91485 additions and 0 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

View file

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<component version="0.1">
<title xml:lang="ko">설문조사 컴포넌트</title>
<title xml:lang="jp">アンケート調査</title>
<title xml:lang="zh-CN">投票调查</title>
<title xml:lang="en">Poll Component</title>
<author email_address="zero@zeroboard.com" link="http://www.zeroboard.com" date="2007. 2. 28">
<name xml:lang="ko">제로</name>
<name xml:lang="jp">Zero</name>
<name xml:lang="zh-CN">zero</name>
<name xml:lang="en">zero</name>
<description xml:lang="ko">글 작성시에 설문조사를 첨부하실 수 있습니다. 설문조사 컴포넌트는 설문조사 모듈의 설정에 영향을 받습니다.</description>
<description xml:lang="jp">書き込みにアンケート調査を追加して作成することができます。アンケートモジュールの影響を受けます。</description>
<description xml:lang="zh-CN">发表主题时可以附加投票调查。投票调查组件受投票调查模块设置的影响。</description>
<description xml:lang="en">You can attach a poll on writing articles. Poll component is affected by setting of poll module.</description>
</author>
</component>

View file

@ -0,0 +1,18 @@
<?php
/**
* @file /modules/editor/components/poll_maker/lang/en.lang.php
* @author zero <zero@nzeo.com>
* @brief editor module > language pack of poll_maker component
**/
$lang->poll_title = "Title";
$lang->poll_item = "Items";
$lang->poll_stop_date = "Expiration Date";
$lang->poll_chk_count = "Number of Checking Item";
$lang->cmd_add_poll = "Add Poll";
$lang->cmd_del_poll = "Delete Poll";
$lang->cmd_add_item = "Add Item";
$lang->msg_poll_cannot_modify = "You cannot modify the poll. It should be deleted to create a new poll";
?>

View file

@ -0,0 +1,18 @@
<?php
/**
* @file /modules/editor/components/urllink/lang/jp.lang.php
* @author zero <zero@nzeo.com> 翻訳RisaPapa
* @brief ウィジウィグエディターeditorモジュール > アンケート調査言語パッケージ
**/
$lang->poll_title = "タイトル";
$lang->poll_item = "項目";
$lang->poll_stop_date = "終了日";
$lang->poll_chk_count = "選択項目数";
$lang->cmd_add_poll = "アンケート追加";
$lang->cmd_del_poll = "アンケート削除";
$lang->cmd_add_item = "項目追加";
$lang->msg_poll_cannot_modify = 'アンケート調査を修正することはできません。削除後、新しく作成しなければなりません。';
?>

View file

@ -0,0 +1,18 @@
<?php
/**
* @file /modules/editor/components/urllink/lang/ko.lang.php
* @author zero <zero@nzeo.com>
* @brief 위지윅에디터(editor) 모듈 > 설문조사 컴포넌트의 언어팩
**/
$lang->poll_title = "제목";
$lang->poll_item = "항목";
$lang->poll_stop_date = "종료 일자";
$lang->poll_chk_count = "선택항목 수";
$lang->cmd_add_poll = "설문 추가";
$lang->cmd_del_poll = "설문 제거";
$lang->cmd_add_item = "항목 추가";
$lang->msg_poll_cannot_modify = '설문조사는 수정하실 수 없습니다. 삭제후 다시 생성하셔야 합니다';
?>

View file

@ -0,0 +1,18 @@
<?php
/**
* @file /modules/editor/components/urllink/lang/zh-CN.lang.php
* @author zero <zero@nzeo.com>
* @brief 网页编辑器(editor) 模块 > 投票调查组件语言包
**/
$lang->poll_title = "标题";
$lang->poll_item = "项目";
$lang->poll_stop_date = "结束日期";
$lang->poll_chk_count = "选择项目数";
$lang->cmd_add_poll = "添加投票";
$lang->cmd_del_poll = "解除投票";
$lang->cmd_add_item = "添加项目";
$lang->msg_poll_cannot_modify = '投票调查不提供修改功能。必须删除后再生成';
?>

View file

@ -0,0 +1,53 @@
<?php
/**
* @class poll_maker
* @author zero (zero@nzeo.com)
* @brief 에디터에서 url링크하는 기능 제공.
**/
class poll_maker extends EditorHandler {
// upload_target_srl 는 에디터에서 필수로 달고 다녀야 함....
var $upload_target_srl = 0;
var $component_path = '';
/**
* @brief upload_target_srl과 컴포넌트의 경로를 받음
**/
function poll_maker($upload_target_srl, $component_path) {
$this->upload_target_srl = $upload_target_srl;
$this->component_path = $component_path;
}
/**
* @brief popup window요청시 popup window에 출력할 내용을 추가하면 된다
**/
function getPopupContent() {
// 템플릿을 미리 컴파일해서 컴파일된 소스를 return
$tpl_path = $this->component_path.'tpl';
$tpl_file = 'popup.html';
$oTemplate = &TemplateHandler::getInstance();
return $oTemplate->compile($tpl_path, $tpl_file);
}
/**
* @brief 에디터 컴포넌트가 별도의 고유 코드를 이용한다면 코드를 html로 변경하여 주는 method
*
* 이미지나 멀티미디어, 설문등 고유 코드가 필요한 에디터 컴포넌트는 고유코드를 내용에 추가하고 나서
* DocumentModule::transContent() 에서 해당 컴포넌트의 transHtml() method를 호출하여 고유코드를 html로 변경
**/
function transHTML($xml_obj) {
$poll_srl = $xml_obj->attrs->poll_srl;
preg_match('/width([^[:digit:]]+)([0-9]+)/i',$xml_obj->attrs->style,$matches);
$width = $matches[2];
if(!$width) $width = 400;
$style = sprintf('width:%dpx', $width);
// poll model 객체 생성해서 html 얻어와서 return
$oPollModel = &getModel('poll');
return $oPollModel->getPollHtml($poll_srl, $style);
}
}
?>

View file

@ -0,0 +1,9 @@
<filter name="insert_poll" module="poll" act="procInsert" confirm_msg_code="confirm_submit">
<form />
<parameter />
<response callback_func="completeInsertPoll">
<tag name="error" />
<tag name="message" />
<tag name="poll_srl" />
</response>
</filter>

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.1 KiB

View file

@ -0,0 +1,8 @@
@charset "utf-8";
@import url(../../../../../../modules/admin/tpl/css/admin.css);
.pollButton { clear:both; margin:.5em 0 0 0; height:20px; }
.pollButton label { vertical-align:middle; color:#888888; }
li { list-style:none; margin-right:5px; float:left; color:#666666}
li a { text-decoration:none; color:#666666;}

View file

@ -0,0 +1,101 @@
<!--%import("popup.js")-->
<!--%import("popup.css")-->
<!--%import("filter/insert_poll.xml")-->
<!--%import("../lang")-->
<script type="text/javascript">
var msg_poll_cannot_modify = "{$lang->msg_poll_cannot_modify}";
</script>
<div id="popHeadder">
<h1>{$component_info->title} ver. {$component_info->version}</h1>
</div>
<form action="./" method="post" id="fo_component" onSubmit="procFilter(this, insert_poll); return false;">
<input type="hidden" name="component" value="{$component_info->component_name}" />
<input type="hidden" name="method" value="insertPoll" />
<input type="hidden" name="poll_srl" value="" />
<input type="hidden" name="upload_target_srl" value="{$upload_target_srl}" />
<div id="popBody">
<table cellspacing="0" class="tableType5">
<col width="100" />
<col />
<tr>
<th scope="row">{$lang->poll_stop_date}</th>
<td>
<ul class="buttonLeft nospace">
<li>
<select name="stop_year">
<!--@for($i=date("Y");$i<date("Y")+10;$i++)-->
<option value="{$i}">{$i}</option>
<!--@end-->
</select>
</li>
<li>
<select name="stop_month">
<!--@for($i=1;$i<=12;$i++)-->
<option value="{$i}" <!--@if($i==date("m", time()+60*60*24*30))-->selected="selected"<!--@end-->>{$i}</option>
<!--@end-->
</select>
</li>
<li>
<select name="stop_day">
<!--@for($i=1;$i<=31;$i++)-->
<option value="{$i}" <!--@if($i==date("d", time()+60*60*24*30))-->selected="selected"<!--@end-->>{$i}</option>
<!--@end-->
</select>
</li>
<li><a href="#" onclick="doPollAdd(); return false;"><span>{$lang->cmd_add_poll}</span></a></li>
</ul>
</td>
</tr>
</table>
<div id="poll_source" class="clear" style="display:none">
<table cellspacing="0" class="tableType5 gap1 clear">
<col width="100" />
<col />
<tr>
<th scope="row">{$lang->poll_title}</th>
<td><input type="text" name="title_tidx" class="inputTypeText w100" /></td>
</tr>
<tr>
<th scope="row">{$lang->poll_item} 1</th>
<td><input type="text" name="item_tidx_1" class="inputTypeText w100" /></td>
</tr>
<tr>
<th scope="row">{$lang->poll_item} 2</th>
<td><input type="text" name="item_tidx_2" class="inputTypeText w100" /></td>
</tr>
</table>
<div class="pollButton clear">
<ul class="fl">
<li><a href="#" onclick="doPollAddItem(this); return false;" >{$lang->cmd_add_item}</a></li>
</ul>
<ul class="fr">
<li><a href="#" onclick="doPollDelete(this); return false;" >{$lang->cmd_del_poll}</a></li>
</ul>
<ul class="fr">
<li><label>{$lang->poll_chk_count}</label></li>
<li><input type="text" name="checkcount_tidx" value="1" size="1" class="inputTypeText" /></li>
</ul>
</div>
</div>
</div>
<div id="popFooter" class="tCenter">
<span class="button"><input type="submit" value="{$lang->cmd_submit}" /></span>
<a href="#" onclick="window.close(); return false;" class="button"><span>{$lang->cmd_close}</span></a>
<a href="#" onclick="winopen('./?module=editor&amp;act=dispEditorComponentInfo&amp;component_name={$component_info->component_name}','ComponentInfo','left=10,top=10,width=10,height=10,resizable=no,scrollbars=no,toolbars=no');return false;" class="button"><span>{$lang->about_component}</span></a>
</div>
</form>

View file

@ -0,0 +1,140 @@
/**
* popup으로 열렸을 경우 부모창의 위지윅에디터에 select된 block이 있는지 체크하여
* 있으면 가져와서 원하는 곳에 삽입
**/
var poll_index = 1;
function setPoll() {
var node = opener.editorPrevNode;
if(node && node.getAttribute('editor_component')=='poll_maker') {
alert(msg_poll_cannot_modify);
window.close();
return;
}
var obj = xCreateElement("div");
var source = xGetElementById("poll_source");
var html = xInnerHtml(source);
html = html.replace(/tidx/g, poll_index);
xInnerHtml(obj, html);
obj.id = "poll_"+poll_index;
obj.className = "poll_box";
obj.style.display = "block";
source.parentNode.insertBefore(obj, source);
setFixedPopupSize();
}
/**
* 부모창의 위지윅에디터에 데이터를 삽입
**/
function completeInsertPoll(ret_obj) {
if(typeof(opener)=="undefined") return null;
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_maker\" style=\"width:400px;height:300px;border:2px dotted #4371B9;background:url(./modules/editor/components/poll_maker/tpl/poll_maker_component.gif) no-repeat center;\" />";
alert(ret_obj['message']);
var iframe_obj = opener.editorGetIFrame(opener.editorPrevSrl)
opener.editorReplaceHTML(iframe_obj, text);
opener.focus();
window.close();
return null;
}
xAddEventListener(window, "load", setPoll);
/**
* 설문 추가
**/
function doPollAdd() {
var obj = xCreateElement("div");
var source = xGetElementById("poll_source");
if(poll_index+1>8) return null;
poll_index++;
var html = xInnerHtml(source);
html = html.replace(/tidx/g, poll_index);
xInnerHtml(obj, html);
obj.id = "poll_"+poll_index;
obj.className = "poll_box";
obj.style.display = "block";
source.parentNode.insertBefore(obj, source);
setFixedPopupSize();
return null;
}
/**
* 항목 삭제
**/
function doPollDelete(obj) {
var pobj = obj.parentNode.parentNode.parentNode.parentNode;
var tmp_arr = pobj.id.split('_');
var index = tmp_arr[1];
if(index==1) return;
pobj.parentNode.removeChild(pobj);
var obj_list = xGetElementsByClassName('poll_box');
for(var i=0;i<obj_list.length;i++) {
var nobj = obj_list[i];
if(nobj.id == 'poll_source') continue;
var tmp_arr = nobj.id.split('_');
var index = tmp_arr[1];
nobj.id = 'poll_'+(i+1);
}
poll_index = i-1;
setFixedPopupSize();
}
/**
* 항목 추가
**/
function doPollAddItem(obj) {
var tbl = xPrevSib(obj.parentNode.parentNode.parentNode);
var tbody = tbl.lastChild;
var tmp = tbody.firstChild;
var source = null;
while(tmp.nextSibling) {
tmp = tmp.nextSibling;
if(tmp.nodeName == "TR") source = tmp;
}
var new_obj = source.cloneNode(true);
new_obj.className = source.className;
source.parentNode.appendChild(new_obj);
var html = xInnerHtml(new_obj);
var idx_match = html.match(/ ([0-9]+)</i);
var idx = parseInt(idx_match[1],10);
var tmp = new_obj.firstChild;
while(tmp) {
if(tmp.nodeName == "TH") {
var html = xInnerHtml(tmp);
html = html.replace(/ ([0-9]+)/, ' '+(idx+1));
xInnerHtml(tmp, html);
} else if(tmp.nodeName == "TD") {
var html = xInnerHtml(tmp);
html = html.replace(/item_([0-9]+)_([0-9]+)/, 'item_$1_'+(idx+1));
xInnerHtml(tmp, html);
}
tmp = tmp.nextSibling;
}
setFixedPopupSize();
return null;
}