diff --git a/common/lang/ko.lang.php b/common/lang/ko.lang.php index b380d398c..d66782afa 100644 --- a/common/lang/ko.lang.php +++ b/common/lang/ko.lang.php @@ -109,6 +109,7 @@ $lang->is_default = "기본"; $lang->skin = "스킨"; + $lang->colorset = "컬러셋"; $lang->board_manager = '게시판 관리'; $lang->member_manager = '회원 관리'; diff --git a/modules/module/module.model.php b/modules/module/module.model.php index b6b4d7dd0..7a2d79e9c 100644 --- a/modules/module/module.model.php +++ b/modules/module/module.model.php @@ -196,51 +196,55 @@ if(!is_array($xml_obj->colorset->color)) $colorset[] = $xml_obj->colorset->color; else $colorset = $xml_obj->colorset->color; - foreach($colorset as $color) { - $name = $color->attrs->name; - $title = $color->title->body; - $screenshot = $color->attrs->src; - if($screenshot && file_exists($screenshot)) $screenshot = sprintf("%sskins/%s/%s", $path, $skin, $screenshot); - else $screenshot = ""; + if($colorset[0]->attrs->name) { + foreach($colorset as $color) { + $name = $color->attrs->name; + $title = $color->title->body; + $screenshot = $color->attrs->src; + if($screenshot && file_exists($screenshot)) $screenshot = sprintf("%sskins/%s/%s", $path, $skin, $screenshot); + else $screenshot = ""; - unset($obj); - $obj->name = $name; - $obj->title = $title; - $obj->screenshot = $screenshot; - $skin_info->colorset[] = $obj; + unset($obj); + $obj->name = $name; + $obj->title = $title; + $obj->screenshot = $screenshot; + $skin_info->colorset[] = $obj; + } } // 스킨에서 사용되는 변수들 if(!is_array($xml_obj->extra_vars->var)) $extra_vars[] = $xml_obj->extra_vars->var; else $extra_vars = $xml_obj->extra_vars->var; - foreach($extra_vars as $var) { - $name = $var->attrs->name; - $type = $var->attrs->type; - $title = $var->title->body; - $description = $var->description->body; - if($var->default) { - unset($default); - if(is_array($var->default)) { - for($i=0;$idefault);$i++) $default[] = $var->default[$i]->body; - } else { - $default = $var->default->body; + if($extra_vars[0]->attrs->name) { + foreach($extra_vars as $var) { + $name = $var->attrs->name; + $type = $var->attrs->type; + $title = $var->title->body; + $description = $var->description->body; + if($var->default) { + unset($default); + if(is_array($var->default)) { + for($i=0;$idefault);$i++) $default[] = $var->default[$i]->body; + } else { + $default = $var->default->body; + } } + + $width = $var->attrs->width; + $height = $var->attrs->height; + + unset($obj); + $obj->title = $title; + $obj->description = $description; + $obj->name = $name; + $obj->type = $type; + $obj->default = $default; + $obj->width = $width; + $obj->height = $height; + + $skin_info->extra_vars[] = $obj; } - - $width = $var->attrs->width; - $height = $var->attrs->height; - - unset($obj); - $obj->title = $title; - $obj->description = $description; - $obj->name = $name; - $obj->type = $type; - $obj->default = $default; - $obj->width = $width; - $obj->height = $height; - - $skin_info->extra_vars[] = $obj; } return $skin_info; diff --git a/modules/plugin/conf/module.xml b/modules/plugin/conf/module.xml index 990fb9d75..875f476eb 100644 --- a/modules/plugin/conf/module.xml +++ b/modules/plugin/conf/module.xml @@ -7,5 +7,6 @@ + diff --git a/modules/plugin/plugin.controller.php b/modules/plugin/plugin.controller.php index 002476b39..bd38299f8 100644 --- a/modules/plugin/plugin.controller.php +++ b/modules/plugin/plugin.controller.php @@ -40,5 +40,25 @@ $this->add('plugin_code', $plugin_code); } + /** + * @brief 선택된 플러그인 - 스킨의 컬러셋을 return + **/ + function procGetColorsetList() { + $plugin = Context::get('selected_plugin'); + $skin = Context::get('skin'); + + $path = sprintf('./plugins/%s/', $plugin); + $oModuleModel = &getModel('module'); + $skin_info = $oModuleModel->loadSkinInfo($path, $skin); + + for($i=0;$icolorset);$i++) { + $colorset = sprintf('%s|@|%s', $skin_info->colorset[$i]->name, $skin_info->colorset[$i]->title); + $colorset_list[] = $colorset; + } + + if(count($colorset_list)) $colorsets = implode("\n", $colorset_list); + $this->add('colorset_list', $colorsets); + } + } ?> diff --git a/modules/plugin/plugin.view.php b/modules/plugin/plugin.view.php index 2b30e0844..d50aee327 100644 --- a/modules/plugin/plugin.view.php +++ b/modules/plugin/plugin.view.php @@ -56,6 +56,10 @@ $mid_list = $oModuleModel->getMidList(); Context::set('mid_list', $mid_list); + // 스킨의 정보를 구함 + $skin_list = $oModuleModel->getSkins($plugin_info->path); + Context::set('skin_list', $skin_list); + // 플러그인을 팝업으로 지정 $this->setLayoutFile('popup_layout'); diff --git a/modules/plugin/tpl.admin/js/admin.js b/modules/plugin/tpl.admin/js/admin.js index 4808af6cf..61636f651 100644 --- a/modules/plugin/tpl.admin/js/admin.js +++ b/modules/plugin/tpl.admin/js/admin.js @@ -23,3 +23,36 @@ function completeGenerateCodeInPage(ret_obj,response_tags,params,fo_obj) { window.close(); } + +/* 플러그인 코드 생성시 스킨을 고르면 컬러셋의 정보를 표시 */ +function doDisplaySkinColorset(sel) { + var skin = sel.options[sel.selectedIndex].value; + if(!skin) { + xGetElementById("colorset_area").style.display = "none"; + return; + } + + var params = new Array(); + params["selected_plugin"] = xGetElementById("fo_plugin").selected_plugin.value; + params["skin"] = skin; + + var response_tags = new Array("error","message","colorset_list"); + + exec_xml("plugin", "procGetColorsetList", params, completeGetSkinColorset, response_tags); +} + +// 서버에서 받아온 컬러셋을 표시 +function completeGetSkinColorset(ret_obj) { + var sel = xGetElementById("fo_plugin").colorset; + var length = sel.options.length; + for(var i=0;i -
+
@@ -14,6 +14,24 @@
{$lang->plugin}
{$plugin_info->title} ver {$plugin_info->version}
+
{$lang->skin}
+
+ +
+ + +
{$var->name}
diff --git a/modules/plugin/tpl.admin/plugin_generate_code_in_page.html b/modules/plugin/tpl.admin/plugin_generate_code_in_page.html index 0afab3fdd..d3449cb11 100644 --- a/modules/plugin/tpl.admin/plugin_generate_code_in_page.html +++ b/modules/plugin/tpl.admin/plugin_generate_code_in_page.html @@ -15,6 +15,24 @@
{$lang->description}
{nl2br($plugin_info->author->description)}
+
{$lang->skin}
+
+ +
+ + +
{$var->name}