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

View file

@ -0,0 +1,8 @@
@charset "utf-8";
.widget_mid_list { margin-bottom:.3em; }
#colorset_area { margin-top:.5em; }
#colorset_area .header { float:left; margin-right:.5em; padding-top:.2em;}
#colorset_area .footer { float:left; }

View file

@ -0,0 +1,38 @@
<h3>{$lang->widget} <span class="gray">{$lang->cmd_management}</span></h3>
<!-- 설명 -->
<div class="infoText">{nl2br($lang->about_addon)}</div>
<!-- 위젯의 목록 -->
<table cellspacing="0" class="tableType3">
<thead>
<tr>
<th scope="col">{$lang->widget_name}</th>
<th scope="col">{$lang->version}</th>
<th scope="col">{$lang->author}</th>
<th scope="col">{$lang->date}</th>
<th scope="col">{$lang->path}</th>
<th scope="col">{$lang->cmd_generate_code}</th>
</tr>
</thead>
<tbody>
<!--@foreach($widget_list as $key => $val)-->
<tr>
<th scope="row" rowspan="2">
<a href="{getUrl('','module','widget','act','dispWidgetInfo','selected_widget',$val->widget)}" onclick="popopen(this.href,'widget_info');return false" class="blue">{$val->title}</a><br />
({$val->widget})
</th>
<td class="tahoma">{$val->version}</td>
<td class="blue"><a href="{$val->author->homepage}" onclick="window.open(this.href);return false;">{$val->author->name}</a></td>
<td class="tahoma">{$val->author->date}</td>
<td class="tahoma left">{$val->path}</td>
<td class="blue"><a href="{getUrl('','module','widget','act','dispWidgetGenerateCode','selected_widget',$val->widget)}" onclick="popopen(this.href,'widget_code_generate');return false">{$lang->cmd_generate_code}</a></td>
</tr>
<tr>
<td colspan="5" class="left">
{nl2br($val->author->description)}
</td>
</tr>
<!--@end-->
</tbody>
</table>

View file

@ -0,0 +1,7 @@
<filter name="generate_code" module="widget" act="procWidgetGenerateCode">
<response callback_func="completeGenerateCode">
<tag name="error" />
<tag name="message" />
<tag name="widget_code" />
</response>
</filter>

View file

@ -0,0 +1,7 @@
<filter name="generate_code_in_page" module="widget" act="procWidgetGenerateCode">
<response callback_func="completeGenerateCodeInPage">
<tag name="error" />
<tag name="message" />
<tag name="widget_code" />
</response>
</filter>

View file

@ -0,0 +1,165 @@
/**
* @file modules/widget/js/widget_admin.js
* @author zero (zero@nzeo.com)
* @brief widget 모듈의 관리자용 javascript
**/
/* 생성된 코드를 textarea에 출력 */
function completeGenerateCode(ret_obj) {
var widget_code = ret_obj["widget_code"];
var zone = xGetElementById("widget_code");
zone.value = widget_code;
}
/* 생성된 코드를 에디터에 출력 */
function completeGenerateCodeInPage(ret_obj,response_tags,params,fo_obj) {
var widget_code = ret_obj["widget_code"];
var module_srl = fo_obj.module_srl.value;
if(!opener || !widget_code || !module_srl) {
window.close();
return;
}
// 부모창에 에디터가 있으면 에디터에 추가
if(opener.editorGetIFrame) {
var iframe_obj = opener.editorGetIFrame(module_srl);
if(iframe_obj) {
opener.editorFocus(module_srl);
opener.editorReplaceHTML(iframe_obj, widget_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_widget"] = xGetElementById("fo_widget").selected_widget.value;
params["skin"] = skin;
params["colorset"] = colorset;
var response_tags = new Array("error","message","colorset_list");
exec_xml("widget", "procWidgetGetColorsetList", params, completeGetSkinColorset, response_tags, params);
}
/* 서버에서 받아온 컬러셋을 표시 */
function completeGetSkinColorset(ret_obj, response_tags, params, fo_obj) {
var sel = xGetElementById("fo_widget").widget_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 doFillWidgetVars() {
if(!opener || !opener.editorPrevNode || !opener.editorPrevNode.getAttribute("widget")) return;
selected_node = opener.editorPrevNode;
// 스킨과 컬러셋은 기본
var skin = selected_node.getAttribute("skin");
var colorset = selected_node.getAttribute("colorset");
var widget_sequence = parseInt(selected_node.getAttribute("widget_sequence"),10);
var fo_obj = xGetElementById("fo_widget");
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).split(',');
if(fo_obj[name].length) {
for(var i=0;i<fo_obj[name].length;i++) {
var v = fo_obj[name][i].value;
for(var j=0;j<val.length;j++) {
if(v == val[j]) {
fo_obj[name][i].checked=true;
break;
}
}
}
} else {
if(fo_obj[name].value == val) fo_obj[name].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;
}
}
/*
var marginLeft = 0;
if(selected_node.style.marginLeft) marginLeft = parseInt(selected_node.style.marginLeft.replace(/px$/,''),10);
var marginRight = 0;
if(selected_node.style.marginRight) marginRight = parseInt(selected_node.style.marginRight.replace(/px$/,''),10);
var border = 0;
if(selected_node.style.border) border= parseInt(selected_node.style.boarder.replace(/px$/,''),10);
*/
var width_type = "px";
if(selected_node.getAttribute("widget_width_type")=="%") width_type = "%";
else fo_obj.widget_width.value = xWidth(selected_node);
// 컬러셋 설정
if(skin && xGetElementById("widget_colorset").options.length<1 && colorset) {
doDisplaySkinColorset(xGetElementById("widget_skin"), colorset);
}
// widget sequence 설정
fo_obj.widget_sequence.value = widget_sequence;
}
function checkFixType(obj) {
var val = obj.options[obj.selectedIndex].value;
if(val != "px") {
var fo_obj = xGetElementById("fo_widget");
var width = fo_obj.widget_width.value;
if(width>100) fo_obj.widget_width.value = 100;
}
}

View file

@ -0,0 +1,37 @@
<!--%import("css/widget.css")-->
<!--%import("../../admin/tpl/css/admin.css")-->
<div id="popHeadder">
<h1>{$lang->widget_maker}</h1>
</div>
<div id="popBody">
<table cellspacing="0" class="tableType5">
<col width="100" />
<col />
<tr>
<th scope="row">{$lang->title}</th>
<td>{$widget_info->title} ver {$widget_info->version}</td>
</tr>
<tr>
<th scope="row">{$lang->author}</th>
<td><a href="mailto:{$widget_info->author->email_address}">{$widget_info->author->name}</a></td>
</tr>
<tr>
<th scope="row">{$lang->homepage}</th>
<td><a href="{$widget_info->author->homepage}" onclick="window.open(this.href);return false;">{$widget_info->author->homepage}</a></td>
</tr>
<tr>
<th scope="row">{$lang->regdate}</th>
<td>{$widget_info->author->date}</td>
</tr>
<tr>
<th scope="row">{$lang->description}</th>
<td>{nl2br($widget_info->author->description)}</td>
</tr>
</table>
</div>
<div id="popFooter" class="tCenter gap1">
<a href="#" onclick="window.close(); return false;" class="button"><span>{$lang->cmd_close}</span></a>
</div>

View file

@ -0,0 +1,137 @@
<!--%import("filter/generate_code.xml")-->
<!--%import("js/widget_admin.js")-->
<!--%import("css/widget.css")-->
<!--%import("../../admin/tpl/css/admin.css")-->
<form action="./" method="get" onsubmit="return procFilter(this, generate_code);" id="fo_widget">
<input type="hidden" name="selected_widget" value="{$selected_widget}" />
<div id="popHeadder">
<h1>{$lang->cmd_generate_code}</h1>
</div>
<div id="popBody">
<div class="infoText">{nl2br($lang->about_widget_code)}</div>
<table cellspacing="0" class="tableType5">
<col width="100" />
<col />
<tr>
<th scope="row">{$lang->widget}</th>
<td>{$widget_info->title} ver {$widget_info->version}</td>
</tr>
<tr>
<th scope="row">{$lang->skin}</th>
<td>
<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 id="colorset_area" style="display:none">
<div class="header">{$lang->colorset}</div>
<div class="footer">
<select name="colorset" id="widget_colorset">
</select>
</div>
</div>
</td>
</tr>
<tr>
<th scope="row">{$lang->widget_cache}</th>
<td>
<input type="text" name="widget_cache" value="0" class="inputTypeText" size="2" />{$lang->unit_min}
<p>{$lang->about_widget_cache}</p>
</td>
</tr>
<!--@foreach($widget_info->extra_var as $id => $var)-->
<tr>
<th scope="row">{$var->name}</th>
<td>
<!--@if($var->type == "text")-->
<input type="text" name="{$id}" value="" class="inputTypeText" />
<!--@elseif($var->type == "textarea")-->
<textarea name="{$id}" class="inputTypeTextArea w100"></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="widget_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-->
<p class="clear">{$var->description}</p>
</td>
</tr>
<!--@end-->
<tr>
<th scope="row">{$lang->widget_margin}</th>
<td>
<table border="0" cellspacing="1">
<tr>
<td colspan="2" align="center">{$lang->widget_margin_top} <input type="text" name="widget_margin_top" value="0" size="2" class="inputTypeText" />px</td>
</tr>
<tr>
<td>{$lang->widget_margin_left} <input type="text" name="widget_margin_left" value="0" size="2" class="inputTypeText"/>px</td>
<td align="right">{$lang->widget_margin_right} <input type="text" name="widget_margin_right" value="0" size="2" class="inputTypeText" />px</td>
</tr>
<tr>
<td colspan="2" align="center">{$lang->widget_margin_bottom} <input type="text" name="widget_margin_bottom" value="0" size="2" class="inputTypeText" />px</td>
</tr>
</table>
<p>{$lang->about_widget_margin}</p>
</td>
</tr>
<tr>
<th scope="row">{$lang->widget_fix_width}</th>
<td>
<input type="checkbox" value="Y" name="widget_fix_width" /> {$lang->about_widget_fix_width}
</td>
</tr>
<tr>
<th scope="row">{$lang->widget_width}</th>
<td>
<input type="text" value="50" name="widget_width" size="3" class="inputTypeText" />
<select name="widget_width_type" onchange="checkFixType(this)">
<option value="%">%</option>
<option value="px">px</option>
</select>
<p>{$lang->about_widget_width}</p>
</td>
</tr>
<tr>
<th scope="row">{$lang->widget_position}</th>
<td>
<select name="widget_position">
<option value="">{$lang->widget_position_none}</option>
<option value="left">{$lang->widget_position_left}</option>
<option value="right">{$lang->widget_position_right}</option>
</select>
<p>{$lang->about_widget_position}</p>
</td>
</tr>
<tr>
<th>{$lang->widget_code}</th>
<td><textarea readonly="true" id="widget_code" class="inputTypeTextArea w100"></textarea></td>
</tr>
</table>
</div>
<div id="popFooter" class="tCenter gap1">
<span class="button"><input type="submit" value="{$lang->cmd_generate_code}" /></span>
<a href="#" onclick="window.close(); return false;" class="button"><span>{$lang->cmd_close}</span></a>
</div>
</form>

View file

@ -0,0 +1,142 @@
<!--%import("filter/generate_code_in_page.xml")-->
<!--%import("js/widget_admin.js")-->
<!--%import("css/widget.css")-->
<!--%import("../../admin/tpl/css/admin.css")-->
<form action="./" method="get" onsubmit="return procFilter(this, generate_code_in_page);" id="fo_widget">
<input type="hidden" name="selected_widget" value="{$selected_widget}" />
<input type="hidden" name="module_srl" value="{$module_srl}" />
<input type="hidden" name="widget_sequence" value="" />
<div id="popHeadder">
<h1>{$lang->cmd_generate_code}</h1>
</div>
<div id="popBody">
<div class="infoText">{nl2br($lang->about_widget_code_in_page)}</div>
<table cellspacing="0" class="tableType5">
<col width="100" />
<col />
<tr>
<th scope="row">{$lang->widget}</th>
<td>{$widget_info->title} ver {$widget_info->version}</td>
</tr>
<tr>
<th scope="row">{$lang->skin}</th>
<td>
<select name="skin" onchange="doDisplaySkinColorset(this);return false;" id="widget_skin">
<option value="">&nbsp;</option>
<!--@foreach($skin_list as $key => $val)-->
<option value="{$key}">{$val->title} ({$key})</option>
<!--@end-->
</select>
<div id="colorset_area" style="display:none">
<div class="header">{$lang->colorset}</div>
<div class="footer">
<select name="colorset" id="widget_colorset">
</select>
</div>
</div>
</td>
</tr>
<tr>
<th scope="row">{$lang->widget_cache}</th>
<td>
<input type="text" name="widget_cache" value="0" class="inputTypeText" size="2" />{$lang->unit_min}
<p>{$lang->about_widget_cache}</p>
</td>
</tr>
<!--@foreach($widget_info->extra_var as $id => $var)-->
<tr>
<th scope="row">{$var->name}</th>
<td>
<!--@if($var->type == "text")-->
<input type="text" name="{$id}" value="" class="inputTypeText" />
<!--@elseif($var->type == "textarea")-->
<textarea name="{$id}" class="inputTypeTextArea w100"></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="widget_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-->
<p class="clear">{$var->description}</p>
</td>
</tr>
<!--@end-->
<tr>
<th scope="row">{$lang->widget_margin}</th>
<td>
<table border="0" cellspacing="1">
<tr>
<td colspan="2" align="center">{$lang->widget_margin_top} <input type="text" name="widget_margin_top" value="0" size="2" class="inputTypeText" />px</td>
</tr>
<tr>
<td>{$lang->widget_margin_left} <input type="text" name="widget_margin_left" value="0" size="2" class="inputTypeText"/>px</td>
<td align="right">{$lang->widget_margin_right} <input type="text" name="widget_margin_right" value="0" size="2" class="inputTypeText" />px</td>
</tr>
<tr>
<td colspan="2" align="center">{$lang->widget_margin_bottom} <input type="text" name="widget_margin_bottom" value="0" size="2" class="inputTypeText" />px</td>
</tr>
</table>
<p>{$lang->about_widget_margin}</p>
</td>
</tr>
</table>
<table cellspacing="0" class="tableType5 gap1">
<col width="100" />
<col />
<tr>
<th scope="row">{$lang->widget_fix_width}</th>
<td>
<input type="checkbox" value="Y" name="widget_fix_width" /> {$lang->about_widget_fix_width}
</td>
</tr>
<tr>
<th scope="row">{$lang->widget_width}</th>
<td>
<input type="text" value="50" name="widget_width" size="3" class="inputTypeText" />
<select name="widget_width_type" onchange="checkFixType(this)">
<option value="%">%</option>
<option value="px">px</option>
</select>
<p>{$lang->about_widget_width}</p>
</td>
</tr>
<tr>
<th scope="row">{$lang->widget_position}</th>
<td>
<select name="widget_position">
<option value="">{$lang->widget_position_none}</option>
<option value="left">{$lang->widget_position_left}</option>
<option value="right">{$lang->widget_position_right}</option>
</select>
<p>{$lang->about_widget_position}</p>
</td>
</tr>
</table>
</div>
<div id="popFooter" class="tCenter gap1">
<span class="button"><input type="submit" value="{$lang->cmd_generate_code}" /></span>
<a href="#" onclick="window.close(); return false;" class="button"><span>{$lang->cmd_close}</span></a>
</div>
</form>
<script type="text/javascript">
xAddEventListener(window, "load", doFillWidgetVars);
</script>