diff --git a/modules/plugin/conf/module.xml b/modules/plugin/conf/module.xml index cc847fbe7..30870178e 100644 --- a/modules/plugin/conf/module.xml +++ b/modules/plugin/conf/module.xml @@ -4,6 +4,6 @@ - + diff --git a/modules/plugin/plugin.controller.php b/modules/plugin/plugin.controller.php index 77085bde2..7da9a5c36 100644 --- a/modules/plugin/plugin.controller.php +++ b/modules/plugin/plugin.controller.php @@ -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'); + } + } ?> diff --git a/modules/plugin/plugin.view.php b/modules/plugin/plugin.view.php index 26985351c..5631af224 100644 --- a/modules/plugin/plugin.view.php +++ b/modules/plugin/plugin.view.php @@ -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'); - } - } ?> diff --git a/modules/plugin/tpl.admin/filter/generate_code.xml b/modules/plugin/tpl.admin/filter/generate_code.xml new file mode 100644 index 000000000..5d8984f14 --- /dev/null +++ b/modules/plugin/tpl.admin/filter/generate_code.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/modules/plugin/tpl.admin/js/admin.js b/modules/plugin/tpl.admin/js/admin.js new file mode 100644 index 000000000..1e63797bb --- /dev/null +++ b/modules/plugin/tpl.admin/js/admin.js @@ -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; +} diff --git a/modules/plugin/tpl.admin/plugin_generate_code.html b/modules/plugin/tpl.admin/plugin_generate_code.html index 94339b107..df312df27 100644 --- a/modules/plugin/tpl.admin/plugin_generate_code.html +++ b/modules/plugin/tpl.admin/plugin_generate_code.html @@ -1,6 +1,7 @@ -
- - + + + + @@ -13,37 +14,41 @@ - - - - - - - - - - - + + + + + + + + + + - - - + + + + + + + + + + + +
{$lang->plugin} {$plugin_info->title} ver {$plugin_info->version}
{$var->name} - - - -
- - -
- -
{$var->name} +
{$var->description}
+ +
+ + +
+ +
{$var->description}
{$lang->cmd_close} diff --git a/modules/plugin/tpl.admin/plugin_generated_code.html b/modules/plugin/tpl.admin/plugin_generated_code.html deleted file mode 100644 index 81a3e244a..000000000 --- a/modules/plugin/tpl.admin/plugin_generated_code.html +++ /dev/null @@ -1,29 +0,0 @@ - --- - - - - - - - - - - - - - - - - -
{$lang->cmd_generate_code}
{$lang->plugin}{$plugin_info->title} ver {$plugin_info->version}
{$lang->plugin_code} - <div plugin="{$selected_plugin}" - - {$key}="{$val}"  - - ></div> -
{$lang->about_plugin_code}
- {$lang->cmd_close} -
diff --git a/plugins/newest_document/newest_document.class.php b/plugins/newest_document/newest_document.class.php index 1c8c2f3ba..5e181e137 100644 --- a/plugins/newest_document/newest_document.class.php +++ b/plugins/newest_document/newest_document.class.php @@ -14,6 +14,9 @@ * ./plugins/플러그인/conf/info.xml에 선언한 extra_vars를 args로 받는다 **/ function proc($args) { + + return 12; + }