#275 addon모듈의 확장변수 입력 방식 다양화

- mid_list, select, textarea 타입 추가.
- 기존 호환성을 위해 type이 설정되어 있지 않을 경우 기본 값 'text'

git-svn-id: http://xe-core.googlecode.com/svn/sandbox@3261 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
bnu 2007-12-07 18:25:40 +00:00
parent f3e6d2843a
commit 364f7acef0
3 changed files with 51 additions and 6 deletions

View file

@ -18,7 +18,7 @@
**/
function getAddonPath($addon_name) {
$class_path = sprintf('./addons/%s/', $addon_name);
if(is_dir($class_path)) return $class_path;
if(is_dir($class_path)) return $class_path;
return "";
}
@ -95,7 +95,7 @@
$addon_info->author->date = $xml_obj->author->attrs->date;
$addon_info->author->description = trim($xml_obj->author->description->body);
// history
// history
if(!is_array($xml_obj->history->author)) $history[] = $xml_obj->history->author;
else $history = $xml_obj->history->author;
@ -123,10 +123,25 @@
foreach($extra_vars as $key => $val) {
unset($obj);
if(!$val->type->body) { $val->type->body = 'text'; }
$obj->name = $val->attrs->name;
$obj->title = $val->title->body;
$obj->type = $val->type->body;
$obj->description = $val->description->body;
$obj->value = $extra_vals->{$obj->name};
if(strpos($obj->value, '|@|') != 0) { $obj->value = explode('|@|', $obj->value); }
// 'select'type에서 option목록을 구한다.
if(is_array($val->options)) {
$option_count = count($val->options);
for($i = 0; $i < $option_count; $i++) {
$obj->options[$i]->title = $val->options[$i]->title->body;
$obj->options[$i]->value = $val->options[$i]->value->body;
}
}
$addon_info->extra_vars[] = $obj;
}
}