diff --git a/addons/openid_delegation_id/conf/info.xml b/addons/openid_delegation_id/conf/info.xml new file mode 100644 index 000000000..fc456ba09 --- /dev/null +++ b/addons/openid_delegation_id/conf/info.xml @@ -0,0 +1,25 @@ + + + OpenID delegation ID + + 제로 + + 본인의 도메인을 사용하여 오픈아이디로 활용할 수 있도록 합니다. + 꼭 설정을 통해서 openid provider관련 값을 입력후 사용해주세요. + + + + + server + openid.server 값을 입력해 주세요. + + + delegate + openid.delegate값을 입력해주세요. + + + xrds + X-XRDS-Location값을 입력해주세요. + + + diff --git a/addons/openid_delegation_id/openid_delegation_id.addon.php b/addons/openid_delegation_id/openid_delegation_id.addon.php new file mode 100644 index 000000000..ee53bc75a --- /dev/null +++ b/addons/openid_delegation_id/openid_delegation_id.addon.php @@ -0,0 +1,29 @@ +server||!$addon_info->delegate||!$addon_info->xrds) return; + + $header_script = sprintf( + ''."\n". + ''."\n". + '', + $addon_info->server, + $addon_info->delegate, + $addon_info->xrds + ); + + Context::addHtmlHeader($header_script); +?> diff --git a/modules/addon/addon.admin.controller.php b/modules/addon/addon.admin.controller.php index ac8607f9a..3f1b326b9 100644 --- a/modules/addon/addon.admin.controller.php +++ b/modules/addon/addon.admin.controller.php @@ -31,13 +31,16 @@ // 모듈에서 애드온을 사용하기 위한 캐시 파일 생성 $buff = ""; - $addon_list = $oAddonModel->getActivatedAddons(); - $addon_count = count($addon_list); - for($i=0;$i<$addon_count;$i++) { - $addon = trim($addon_list[$i]); - if(!$addon) continue; + $addon_list = $oAddonModel->getInsertedAddons(); + foreach($addon_list as $addon=> $val) { + if($val->is_used != 'Y') continue; - $buff .= sprintf(' if(file_exists("./addons/%s/%s.addon.php")) { $addon_path = "./addons/%s/"; @include("./addons/%s/%s.addon.php"); }', $addon, $addon, $addon, $addon, $addon); + if($val->extra_vars) { + unset($extra_vars); + $extra_vars = base64_encode($val->extra_vars); + } + + $buff .= sprintf(' if(file_exists("./addons/%s/%s.addon.php")) { unset($addon_info); $addon_info = unserialize(base64_decode("%s")); $addon_path = "./addons/%s/"; @include("./addons/%s/%s.addon.php"); }', $addon, $addon, $extra_vars, $addon, $addon, $addon); } $buff = sprintf('', $buff); @@ -45,6 +48,19 @@ FileHandler::writeFile($this->cache_file, $buff); } + /** + * @brief 애드온 설정 정보 입력 + **/ + function procAddonAdminSetupAddon() { + $args = Context::getRequestVars(); + $addon_name = $args->addon_name; + unset($args->module); + unset($args->act); + unset($args->addon_name); + + $this->doSetup($addon_name, $args); + } + /** * @brief 애드온 추가 * DB에 애드온을 추가함 diff --git a/modules/addon/addon.admin.model.php b/modules/addon/addon.admin.model.php index 05b966023..c16e9440c 100644 --- a/modules/addon/addon.admin.model.php +++ b/modules/addon/addon.admin.model.php @@ -27,7 +27,7 @@ **/ function getAddonList() { // activated된 애드온 목록을 구함 - $inserted_addons = $this->getInsertedAddon(); + $inserted_addons = $this->getInsertedAddons(); // 다운받은 애드온과 설치된 애드온의 목록을 구함 $searched_list = FileHandler::readDir('./addons'); @@ -86,6 +86,7 @@ $info->title = $xml_obj->title->body; // 작성자 정보 + $addon_info->addon_name = $addon; $addon_info->title = $xml_obj->title->body; $addon_info->version = $xml_obj->attrs->version; $addon_info->author->name = $xml_obj->author->name->body; @@ -110,6 +111,13 @@ // 확장변수 if($xml_obj->extra_vars) { + + // DB에 설정된 내역을 가져온다 + $db_args->addon = $addon; + $output = executeQuery('addon.getAddonInfo',$db_args); + $extra_vals = unserialize($output->data->extra_vars); + + // 확장변수를 정리 if(!is_array($xml_obj->extra_vars->var)) $extra_vars[] = $xml_obj->extra_vars->var; else $extra_vars = $xml_obj->extra_vars->var; @@ -118,6 +126,7 @@ $obj->name = $val->attrs->name; $obj->title = $val->title->body; $obj->description = $val->description->body; + $obj->value = $extra_vals->{$obj->name}; $addon_info->extra_vars[] = $obj; } } @@ -128,7 +137,7 @@ /** * @brief 활성화된 애드온 목록을 구해옴 **/ - function getInsertedAddon() { + function getInsertedAddons() { $args->list_order = 'addon'; $output = executeQuery('addon.getAddons', $args); if(!$output->data) return array(); diff --git a/modules/addon/addon.admin.view.php b/modules/addon/addon.admin.view.php index 2dc32c9bf..e3d89f110 100644 --- a/modules/addon/addon.admin.view.php +++ b/modules/addon/addon.admin.view.php @@ -27,6 +27,25 @@ $this->setTemplateFile('addon_list'); } + /** + * @biref 애드온 세부 설정 팝업 출력 + **/ + function dispAddonAdminSetup() { + // 요청된 애드온을 구함 + $selected_addon = Context::get('selected_addon'); + + // 요청된 애드온의 정보를 구함 + $oAddonModel = &getAdminModel('addon'); + $addon_info = $oAddonModel->getAddonInfoXml($selected_addon); + Context::set('addon_info', $addon_info); + + // 레이아웃을 팝업으로 지정 + $this->setLayoutFile('popup_layout'); + + // 템플릿 패스 및 파일을 지정 + $this->setTemplateFile('setup_addon'); + } + /** * @brief 애드온의 상세 정보(conf/info.xml)를 팝업 출력 **/ diff --git a/modules/addon/conf/module.xml b/modules/addon/conf/module.xml index 29b95edb6..6ab0ac336 100644 --- a/modules/addon/conf/module.xml +++ b/modules/addon/conf/module.xml @@ -3,6 +3,8 @@ + + diff --git a/modules/addon/queries/getAddonInfo.xml b/modules/addon/queries/getAddonInfo.xml new file mode 100644 index 000000000..e2401fb0c --- /dev/null +++ b/modules/addon/queries/getAddonInfo.xml @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/modules/addon/tpl/filter/setup_addon.xml b/modules/addon/tpl/filter/setup_addon.xml new file mode 100644 index 000000000..234dbb35a --- /dev/null +++ b/modules/addon/tpl/filter/setup_addon.xml @@ -0,0 +1,8 @@ + +
+ + + + + +
diff --git a/modules/addon/tpl/setup_addon.html b/modules/addon/tpl/setup_addon.html new file mode 100644 index 000000000..d247ae67b --- /dev/null +++ b/modules/addon/tpl/setup_addon.html @@ -0,0 +1,41 @@ + + +
+ + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
{$lang->title}{$addon_info->title} ver. {$addon_info->version}
{$lang->author}{$addon_info->author->name}
{$lang->homepage}{$addon_info->author->homepage}
{$lang->extra_vars}
{$val->title}
{$val->description}
+ + +
+ +