dreditor component의 xml information 변경

git-svn-id: http://xe-core.googlecode.com/svn/sandbox@7245 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
haneul 2010-01-26 09:37:56 +00:00
parent 2661914c07
commit 187e14796e

View file

@ -92,28 +92,28 @@
$oParser = new XmlParser(); $oParser = new XmlParser();
$xml_doc = $oParser->loadXmlFile($xml_file); $xml_doc = $oParser->loadXmlFile($xml_file);
$component_info->component_name = $drComponentName; $drcomponent_info->drcomponent_name = $drComponentName;
$component_info->title = $xml_doc->component->title->body; $drcomponent_info->title = $xml_doc->drcomponent->title->body;
$component_info->description = str_replace('\n', "\n", $xml_doc->component->description->body); $drcomponent_info->description = str_replace('\n', "\n", $xml_doc->drcomponent->description->body);
$component_info->version = $xml_doc->component->version->body; $drcomponent_info->version = $xml_doc->drcomponent->version->body;
$component_info->date = $xml_doc->component->date->body; $drcomponent_info->date = $xml_doc->drcomponent->date->body;
$component_info->homepage = $xml_doc->component->link->body; $drcomponent_info->homepage = $xml_doc->drcomponent->link->body;
$component_info->license = $xml_doc->component->license->body; $drcomponent_info->license = $xml_doc->drcomponent->license->body;
$component_info->license_link = $xml_doc->component->license->attrs->link; $drcomponent_info->license_link = $xml_doc->drcomponent->license->attrs->link;
$buff = '<?php if(!defined("__ZBXE__")) exit(); '; $buff = '<?php if(!defined("__ZBXE__")) exit(); ';
$buff .= sprintf('$xml_info->component_name = "%s";', $component_info->component_name); $buff .= sprintf('$xml_info->drcomponent_name = "%s";', $drcomponent_info->drcomponent_name);
$buff .= sprintf('$xml_info->title = "%s";', $component_info->title); $buff .= sprintf('$xml_info->title = "%s";', $drcomponent_info->title);
$buff .= sprintf('$xml_info->description = "%s";', $component_info->description); $buff .= sprintf('$xml_info->description = "%s";', $drcomponent_info->description);
$buff .= sprintf('$xml_info->version = "%s";', $component_info->version); $buff .= sprintf('$xml_info->version = "%s";', $drcomponent_info->version);
$buff .= sprintf('$xml_info->date = "%s";', $component_info->date); $buff .= sprintf('$xml_info->date = "%s";', $drcomponent_info->date);
$buff .= sprintf('$xml_info->homepage = "%s";', $component_info->homepage); $buff .= sprintf('$xml_info->homepage = "%s";', $drcomponent_info->homepage);
$buff .= sprintf('$xml_info->license = "%s";', $component_info->license); $buff .= sprintf('$xml_info->license = "%s";', $drcomponent_info->license);
$buff .= sprintf('$xml_info->license_link = "%s";', $component_info->license_link); $buff .= sprintf('$xml_info->license_link = "%s";', $drcomponent_info->license_link);
// 작성자 정보 // 작성자 정보
if(!is_array($xml_doc->component->author)) $author_list[] = $xml_doc->component->author; if(!is_array($xml_doc->drcomponent->author)) $author_list[] = $xml_doc->drcomponent->author;
else $author_list = $xml_doc->component->author; else $author_list = $xml_doc->drcomponent->author;
for($i=0; $i < count($author_list); $i++) { for($i=0; $i < count($author_list); $i++) {
$buff .= sprintf('$xml_info->author['.$i.']->name = "%s";', $author_list[$i]->name->body); $buff .= sprintf('$xml_info->author['.$i.']->name = "%s";', $author_list[$i]->name->body);
@ -122,9 +122,9 @@
} }
// history // history
if($xml_doc->component->history) { if($xml_doc->drcomponent->history) {
if(!is_array($xml_doc->component->history)) $history_list[] = $xml_doc->component->history; if(!is_array($xml_doc->drcomponent->history)) $history_list[] = $xml_doc->drcomponent->history;
else $history_list = $xml_doc->component->history; else $history_list = $xml_doc->drcomponent->history;
for($i=0; $i < count($history_list); $i++) { for($i=0; $i < count($history_list); $i++) {
unset($obj); unset($obj);
@ -156,7 +156,7 @@
} }
// 추가 변수 정리 (에디터 컴포넌트에서는 text형만 가능) // 추가 변수 정리 (에디터 컴포넌트에서는 text형만 가능)
$extra_vars = $xml_doc->component->extra_vars->var; $extra_vars = $xml_doc->drcomponent->extra_vars->var;
if($extra_vars) { if($extra_vars) {
if(!is_array($extra_vars)) $extra_vars = array($extra_vars); if(!is_array($extra_vars)) $extra_vars = array($extra_vars);
foreach($extra_vars as $key => $val) { foreach($extra_vars as $key => $val) {