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

This commit is contained in:
zero 2007-03-30 07:07:59 +00:00
parent 8a4280e93a
commit cfae38adb5
13 changed files with 25 additions and 18 deletions

View file

@ -0,0 +1,79 @@
.plugin_detail_info_window {
width:600px;
clear:both;
}
.plugin_title {
font-weight:bold;
font-size:10pt;
text-align:center;
padding:10px 0px 10px 0px;
color:#EEEEEE;
background-color:#444444;
}
.plugin_description {
margin:5px 2px 10px 2px;
border:1px solid #EEEEEE;
color:#444444;
clear:both;
padding:5px;
}
.plugin_header {
clear:left;
font-weight:bold;
float:left;
width:90px;
margin-left:10px;
padding:5px 0px 5px 0px;
}
.plugin_body {
float:left;
width:490px;
padding:5px 0px 5px 0px;
}
.plugin_var_description {
clear:both;
padding:5px 0px 5px 0px;
margin-left:100px;
color:#AAAAAA;
}
.plugin_button_area {
clear:both;
text-align:center;
padding:5px 0px 5px 0px;
background-color:#EFEFEF;
border-top:1px solid #AAAAAA;
}
.plugin_button {
border:1px solid #AAAAAA;
background-color:#FFFFFF;
font-weight:bold;
height:16px;
}
.plugin_code_area {
clear:both;
padding:4px;
border:1px solid #AAAAAA;
margin:5px;
height:100px;
}
.plugin_code_area textarea {
border:0px;
height:100px;
width:570px;
font-family:tahoma;
font-size:8pt;
}
.plugin_mid_list {
float:left;
margin-right:10px;
}

View file

@ -0,0 +1,33 @@
<!-- 플러그인의 목록 -->
<div>
<table border="1" width="100%">
<tr>
<td>{$lang->plugin_name}</td>
<td>{$lang->version}</td>
<td>{$lang->author}</td>
<td>{$lang->date}</td>
<td>{$lang->path}</td>
<td>{$lang->cmd_generate_code}</td>
<td>{$lang->plugin_info}</td>
</tr>
<!--@foreach($plugin_list as $key => $val)-->
<tr>
<td rowspan="2">
{$val->title} <br />
({$val->plugin})
</td>
<td>{$val->version}</td>
<td><a href="#" onclick="window.open('{$val->author->homepage}')">{$val->author->name}</a></td>
<td>{$val->author->date}</td>
<td>{$val->path}</td>
<td><a href="#" onclick="winopen('{getUrl('','module','plugin','act','dispGenerateCode','selected_plugin',$val->plugin)}','plugin_code_generate','width=10,height=10,toolbars=no,scrollbars=no,resizable=yes,left=10,top=10');return false">{$lang->cmd_generate_code}</a></td>
<td><a href="#" onclick="winopen('{getUrl('','module','plugin','act','dispPluginInfo','selected_plugin',$val->plugin)}','plugin_info','width=10,height=10,toolbars=no,scrollbars=no,resizable=yes,left=10,top=10');return false">{$lang->cmd_view}</a></td>
</tr>
<tr>
<td colspan="6">
{nl2br($val->author->description)}
</td>
</tr>
<!--@end-->
</table>
</div>

View file

@ -0,0 +1,7 @@
<filter name="generate_code" module="plugin" act="procGenerateCode">
<response callback_func="completeGenerateCode">
<tag name="error" />
<tag name="message" />
<tag name="plugin_code" />
</response>
</filter>

View file

@ -0,0 +1,7 @@
<filter name="generate_code_in_page" module="plugin" act="procGenerateCode">
<response callback_func="completeGenerateCodeInPage">
<tag name="error" />
<tag name="message" />
<tag name="plugin_code" />
</response>
</filter>

View file

@ -0,0 +1,122 @@
/* 생성된 코드를 textarea에 출력 */
function completeGenerateCode(ret_obj) {
var plugin_code = ret_obj["plugin_code"];
var zone = xGetElementById("plugin_code");
zone.value = plugin_code;
}
/* 생성된 코드를 에디터에 출력 */
function completeGenerateCodeInPage(ret_obj,response_tags,params,fo_obj) {
var plugin_code = ret_obj["plugin_code"];
var module_srl = fo_obj.module_srl.value;
if(!opener || !plugin_code || !module_srl) {
window.close();
return;
}
opener.editorFocus(module_srl);
var iframe_obj = opener.editorGetIFrame(module_srl);
opener.editorReplaceHTML(iframe_obj, plugin_code);
opener.editorFocus(module_srl);
window.close();
}
/* 플러그인 코드 생성시 스킨을 고르면 컬러셋의 정보를 표시 */
function doDisplaySkinColorset(sel, colorset) {
var skin = sel.options[sel.selectedIndex].value;
if(!skin) {
xGetElementById("colorset_area").style.display = "none";
setFixedPopupSize();
return;
}
var params = new Array();
params["selected_plugin"] = xGetElementById("fo_plugin").selected_plugin.value;
params["skin"] = skin;
params["colorset"] = colorset;
var response_tags = new Array("error","message","colorset_list");
exec_xml("plugin", "procGetColorsetList", params, completeGetSkinColorset, response_tags, params);
}
/* 서버에서 받아온 컬러셋을 표시 */
function completeGetSkinColorset(ret_obj, response_tags, params, fo_obj) {
var sel = xGetElementById("fo_plugin").plugin_colorset;
var length = sel.options.length;
var selected_colorset = params["colorset"];
for(var i=0;i<length;i++) sel.remove(0);
var colorset_list = ret_obj["colorset_list"].split("\n");
var selected_index = 0;
for(var i=0;i<colorset_list.length;i++) {
var tmp = colorset_list[i].split("|@|");
if(selected_colorset && selected_colorset==tmp[0]) selected_index = i;
var opt = new Option(tmp[1], tmp[0], false, false);
sel.options.add(opt);
}
sel.selectedIndex = selected_index;
xGetElementById("colorset_area").style.display = "block";
setFixedPopupSize();
}
/* 페이지 모듈에서 내용의 플러그인을 더블클릭하여 수정하려고 할 경우 */
var selected_node = null;
function doFillPluginVars() {
if(!opener || !opener.editorPrevNode || !opener.editorPrevNode.getAttribute("plugin")) return;
selected_node = opener.editorPrevNode;
// 스킨과 컬러셋은 기본
var skin = selected_node.getAttribute("skin");
var colorset = selected_node.getAttribute("colorset");
var fo_obj = xGetElementById("fo_plugin");
for(var name in fo_obj) {
var node = fo_obj[name];
if(!node || typeof(node)=="undefined") continue;
var length = node.length;
var type = node.type;
if((typeof(type)=='undefined'||!type) && typeof(length)!='undefined' && typeof(node[0])!='undefined' && length>0) type = node[0].type;
else length = 0;
switch(type) {
case "text" :
case "textarea" :
var val = selected_node.getAttribute(name);
node.value = val;
break;
case "checkbox" :
var val = selected_node.getAttribute(name);
for(var i=0;i<fo_obj[name].length;i++) {
var v = fo_obj[name][i].value;
if(val.indexOf(v)!=-1) fo_obj[name][i].checked="true";
}
break;
case "select" :
case "select-one" :
var val = selected_node.getAttribute(name);
var sel = fo_obj[name];
if(!val) break;
for(var i=0;i<sel.options.length;i++) {
if(sel.options[i].value == val) sel.options[i].selected = true;
else sel.options[i].selected = false;
}
break;
}
}
// 컬러셋 설정
if(skin && xGetElementById("plugin_colorset").options.length<1 && colorset) {
doDisplaySkinColorset(xGetElementById("plugin_skin"), colorset);
}
}

View file

@ -0,0 +1,26 @@
<!--%import("css/plugin.css")-->
<div class="plugin_detail_info_window">
<div class="plugin_title">{$lang->plugin_maker}</div>
<div class="plugin_header">{$lang->title}</div>
<div class="plugin_body">{$plugin_info->title} ver {$plugin_info->version}</div>
<div class="plugin_header">{$lang->author}</div>
<div class="plugin_body"><a href="mailto:{$plugin_info->author->email_address}">{$plugin_info->author->name}</a></div>
<div class="plugin_header">{$lang->homepage}</div>
<div class="plugin_body"><a href="#" onclick="window.open('{$plugin_info->author->homepage}');return false;">{$plugin_info->author->homepage}</a></div>
<div class="plugin_header">{$lang->regdate}</div>
<div class="plugin_body">{$plugin_info->author->date}</div>
<div class="plugin_header">{$lang->description}</div>
<div class="plugin_body">{nl2br($plugin_info->author->description)}</div>
<div class="plugin_button_area">
<a href="#" onclick="window.close();">{$lang->cmd_close}</a>
</div>
</div>

View file

@ -0,0 +1,73 @@
<!--%import("filter/generate_code.xml")-->
<!--%import("js/admin.js")-->
<!--%import("css/plugin.css")-->
<form action="./" method="get" onsubmit="return procFilter(this, generate_code);" id="fo_plugin">
<input type="hidden" name="selected_plugin" value="{$selected_plugin}" />
<div class="plugin_detail_info_window">
<div class="plugin_title">{$lang->cmd_generate_code}</div>
<div class="plugin_description">{$lang->about_plugin_code}</div>
<div class="plugin_header">{$lang->plugin}</div>
<div class="plugin_body">{$plugin_info->title} ver {$plugin_info->version}</div>
<div class="plugin_header">{$lang->skin}</div>
<div class="plugin_body">
<select name="skin" onchange="doDisplaySkinColorset(this);return false;">
<option value="">&nbsp;</option>
<!--@foreach($skin_list as $key => $val)-->
<option value="{$key}">{$val->title} ({$key})</option>
<!--@end-->
</select>
</div>
<div id="colorset_area" style="display:none">
<div class="plugin_header">{$lang->colorset}</div>
<div class="plugin_body">
<select name="colorset">
</select>
</div>
</div>
<!--@foreach($plugin_info->extra_var as $id => $var)-->
<div class="plugin_header">{$var->name}</div>
<div class="plugin_body">
<!--@if($var->type == "text")-->
<input type="text" name="{$id}" value="" />
<!--@elseif($var->type == "textarea")-->
<textarea name="{$id}"></textarea>
<!--@elseif($var->type == "select")-->
<select name="{$id}">
<!--@foreach($var->options as $key => $val)-->
<option value="{$key}">{$val}</option>
<!--@end-->
</select>
<!--@elseif($var->type == "mid_list")-->
<!--@foreach($mid_list as $key => $val)-->
<div class="plugin_mid_list">
<input type="checkbox" value="{$key}" name="{$id}" id="chk_mid_list_{$key}" />
<label for="chk_mid_list_{$key}">{$key} ({$val->browser_title})</label>
</div>
<!--@end-->
<!--@end-->
</div>
<div class="plugin_var_description">{$var->description}</div>
<!--@end-->
<div class="plugin_button_area">
<input type="submit" value="{$lang->cmd_generate_code}" class="plugin_button" />
<input type="button" onclick="self.close()" value="{$lang->cmd_close}" class="plugin_button" />
</div>
<div class="plugin_code_area"><textarea readonly="true" id="plugin_code"></textarea></div>
</div>
</form>

View file

@ -0,0 +1,76 @@
<!--%import("filter/generate_code_in_page.xml")-->
<!--%import("js/admin.js")-->
<!--%import("css/plugin.css")-->
<form action="./" method="get" onsubmit="return procFilter(this, generate_code_in_page);" id="fo_plugin">
<input type="hidden" name="selected_plugin" value="{$selected_plugin}" />
<input type="hidden" name="module_srl" value="{$module_srl}" />
<div class="plugin_detail_info_window">
<div class="plugin_title">{$plugin_info->title} ver {$plugin_info->version}</div>
<div class="plugin_description">{$lang->about_plugin_code_in_page}</div>
<div class="plugin_header">{$lang->description}</div>
<div class="plugin_body">{nl2br($plugin_info->author->description)}</div>
<div class="plugin_header">{$lang->skin}</div>
<div class="plugin_body">
<select name="skin" onchange="doDisplaySkinColorset(this,'');return false;" id="plugin_skin">
<option value="">&nbsp;</option>
<!--@foreach($skin_list as $key => $val)-->
<option value="{$key}">{$val->title} ({$key})</option>
<!--@end-->
</select>
</div>
<div id="colorset_area" style="display:none">
<div class="plugin_header">{$lang->colorset}</div>
<div class="plugin_body">
<select name="colorset" id="plugin_colorset">
</select>
</div>
</div>
<!--@foreach($plugin_info->extra_var as $id => $var)-->
<div class="plugin_header">{$var->name}</div>
<div class="plugin_body">
<!--@if($var->type == "text")-->
<input type="text" name="{$id}" value="" />
<!--@elseif($var->type == "textarea")-->
<textarea name="{$id}"></textarea>
<!--@elseif($var->type == "select")-->
<select name="{$id}">
<!--@foreach($var->options as $key => $val)-->
<option value="{$key}">{$val}</option>
<!--@end-->
</select>
<!--@elseif($var->type == "mid_list")-->
<!--@foreach($mid_list as $key => $val)-->
<div class="plugin_mid_list">
<input type="checkbox" value="{$key}" name="{$id}" id="chk_mid_list_{$key}" />
<label for="chk_mid_list_{$key}">{$key} ({$val->browser_title})</label>
</div>
<!--@end-->
<!--@end-->
</div>
<div class="plugin_var_description">{$var->description}</div>
<!--@end-->
<div class="plugin_button_area">
<input type="submit" value="{$lang->cmd_insert}" class="plugin_button" />
<input type="button" onclick="self.close()" value="{$lang->cmd_close}" class="plugin_button" />
</div>
</div>
</form>
<script type="text/javascript">
xAddEventListener(window, "load", doFillPluginVars);
</script>