mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-14 00:39:57 +09:00
git-svn-id: http://xe-core.googlecode.com/svn/trunk@440 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
6c66636dc9
commit
b1a8c6406f
8 changed files with 69 additions and 85 deletions
|
|
@ -4,6 +4,6 @@
|
|||
<action name="dispDownloadedPluginList" type="view" standalone="true" admin_index="true" />
|
||||
<action name="dispPluginInfo" type="view" standalone="true" />
|
||||
<action name="dispGenerateCode" type="view" standalone="true" />
|
||||
<action name="dispGeneratedCode" type="view" standalone="true" />
|
||||
<action name="procGenerateCode" type="controller" standalone="true" />
|
||||
</actions>
|
||||
</module>
|
||||
|
|
|
|||
|
|
@ -13,5 +13,20 @@
|
|||
function init() {
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 플러그인의 생성된 코드를 return
|
||||
**/
|
||||
function procGenerateCode() {
|
||||
// 변수 정리
|
||||
//$vars = Context::getRequestVars();
|
||||
unset($vars->module);
|
||||
unset($vars->act);
|
||||
unset($vars->selected_plugin);
|
||||
if($vars) foreach($vars as $key=>$val) $vars->{$key} = str_replace(array('"','\''),array('\"','\\\''),$val);
|
||||
|
||||
// 코드 출력
|
||||
$this->add('plugin_code', 'hahaha');
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
|
|
|
|||
|
|
@ -63,29 +63,5 @@
|
|||
$this->setTemplateFile('plugin_generate_code');
|
||||
}
|
||||
|
||||
/**
|
||||
* @brief 플러그인의 생성된 코드를 출력
|
||||
**/
|
||||
function dispGeneratedCode() {
|
||||
// 선택된 플러그인 정보를 구함
|
||||
$oPluginModel = &getModel('plugin');
|
||||
$plugin_info = $oPluginModel->getPluginInfo(Context::get('selected_plugin'));
|
||||
Context::set('plugin_info', $plugin_info);
|
||||
|
||||
// 변수 정리
|
||||
$vars = Context::getRequestVars();
|
||||
unset($vars->module);
|
||||
unset($vars->act);
|
||||
unset($vars->selected_plugin);
|
||||
if($vars) foreach($vars as $key=>$val) $vars->{$key} = str_replace(array('"','\''),array('\"','\\\''),$val);
|
||||
Context::set('vars', $vars);
|
||||
|
||||
// 플러그인을 팝업으로 지정
|
||||
$this->setLayoutFile('popup_layout');
|
||||
|
||||
// 템플릿 파일 지정
|
||||
$this->setTemplateFile('plugin_generated_code');
|
||||
}
|
||||
|
||||
}
|
||||
?>
|
||||
|
|
|
|||
7
modules/plugin/tpl.admin/filter/generate_code.xml
Normal file
7
modules/plugin/tpl.admin/filter/generate_code.xml
Normal 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>
|
||||
7
modules/plugin/tpl.admin/js/admin.js
Normal file
7
modules/plugin/tpl.admin/js/admin.js
Normal file
|
|
@ -0,0 +1,7 @@
|
|||
/* 생성된 코드를 textarea에 출력 */
|
||||
function completeGenerateCode(ret_obj) {
|
||||
var plugin_code = ret_obj["plugin_code"];
|
||||
|
||||
var zone = xGetElementById("plugin_code");
|
||||
zone.value = plugin_code;
|
||||
}
|
||||
|
|
@ -1,6 +1,7 @@
|
|||
<form action="./" method="post">
|
||||
<input type="hidden" name="module" value="{$module}" />
|
||||
<input type="hidden" name="act" value="dispGeneratedCode" />
|
||||
<!--%import("filter/generate_code.xml")-->
|
||||
<!--%import("js/admin.js")-->
|
||||
|
||||
<form action="./" method="get" onsubmit="return procFilter(this, generate_code);">
|
||||
<input type="hidden" name="selected_plugin" value="{$selected_plugin}" />
|
||||
|
||||
<table border="1" width="400">
|
||||
|
|
@ -13,6 +14,7 @@
|
|||
<th>{$lang->plugin}</th>
|
||||
<td>{$plugin_info->title} ver {$plugin_info->version}</td>
|
||||
</tr>
|
||||
|
||||
<!--@foreach($plugin_info->extra_var as $id => $var)-->
|
||||
<tr>
|
||||
<th rowspan="2">{$var->name}</th>
|
||||
|
|
@ -33,7 +35,7 @@
|
|||
<td>
|
||||
<!--@foreach($mid_list as $key => $val)-->
|
||||
<div>
|
||||
<input type="checkbox" value="{$key}" id="chk_mid_list_{$key}" />
|
||||
<input type="checkbox" value="{$key}" name="{$var->name}" id="chk_mid_list_{$key}" />
|
||||
<label for="chk_mid_list_{$key}">{$key} ({$val->browser_title})</label>
|
||||
</div>
|
||||
<!--@end-->
|
||||
|
|
@ -44,6 +46,9 @@
|
|||
<td>{$var->description}</td>
|
||||
</tr>
|
||||
<!--@end-->
|
||||
<tr>
|
||||
<td colspan="2"><textarea id="plugin_code" style="width:100%;height:100px;"></textarea></td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<a href="#" onclick="self.close()">{$lang->cmd_close}</a>
|
||||
|
|
|
|||
|
|
@ -1,29 +0,0 @@
|
|||
<table border="1" width="400">
|
||||
<col width="100" />
|
||||
<col width="300" />
|
||||
<tr>
|
||||
<th colspan="2">{$lang->cmd_generate_code}</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>{$lang->plugin}</th>
|
||||
<td>{$plugin_info->title} ver {$plugin_info->version}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th rowspan="2">{$lang->plugin_code}</th>
|
||||
<td height="150">
|
||||
<div plugin="{$selected_plugin}"
|
||||
<!--@foreach($vars as $key=>$val)-->
|
||||
{$key}="{$val}"
|
||||
<!--@end-->
|
||||
></div>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>{$lang->about_plugin_code}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="2">
|
||||
<a href="#" onclick="self.close()">{$lang->cmd_close}</a>
|
||||
</td>
|
||||
</tr>
|
||||
</table>
|
||||
|
|
@ -14,6 +14,9 @@
|
|||
* ./plugins/플러그인/conf/info.xml에 선언한 extra_vars를 args로 받는다
|
||||
**/
|
||||
function proc($args) {
|
||||
|
||||
return 12;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue