#495 XML 포맷 정비

* skin.xml 정비
  * 모듈간 HTML 출력 통일

git-svn-id: http://xe-core.googlecode.com/svn/sandbox@4393 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
bnu 2008-07-20 07:42:25 +00:00
parent 195240bb6e
commit 493cad88df
108 changed files with 2799 additions and 2167 deletions

View file

@ -15,6 +15,7 @@
<version>0.1</version>
<date>2007-02-28</date>
<category>base</category>
<link>http://www.zeroboard.com</link>
<author email_address="zero@zeroboard.com" link="http://www.zeroboard.com">
<name xml:lang="ko">제로</name>

View file

@ -21,8 +21,9 @@
$lang->category_title = 'Category Title';
$lang->checked_count = 'Number of Checked Articles';
$lang->skin_default_info = 'Default Skin Info';
$lang->skin_maker = 'Skin Developer';
$lang->skin_maker_homepage = "Skin Developer's Homepage";
$lang->skin_author = 'Skin Developer';
$lang->skin_license = 'License';
$lang->skin_history = 'Update history';
$lang->module_copy = "Duplicate Module";
$lang->header_script = "Header Script";

View file

@ -21,8 +21,9 @@
$lang->category_title = 'Título de categoría';
$lang->checked_count = 'Múmero de los documentos selecionados';
$lang->skin_default_info = 'información del tema predefinido';
$lang->skin_maker = 'Desarrollador de temas';
$lang->skin_maker_homepage = "Página Web del desarrollador de temas";
$lang->skin_author = 'Desarrollador de tema';
$lang->skin_license = 'License';
$lang->skin_history = 'Historia de actualización';
$lang->module_copy = "Copy Module";
$lang->header_script = "헤더 스크립트";

View file

@ -21,8 +21,9 @@
$lang->category_title = 'カテゴリ名';
$lang->checked_count = '選択された書き込み数';
$lang->skin_default_info = 'スキン基本情報';
$lang->skin_maker = 'スキン作者';
$lang->skin_maker_homepage = '作者ホームページ';
$lang->skin_author = 'スキン作者';
$lang->skin_license = 'License';
$lang->skin_history = '変更内容';
$lang->module_copy = "モジュールコピー";
$lang->header_script = "ヘッダースクリプト";

View file

@ -21,8 +21,9 @@
$lang->category_title = '분류명';
$lang->checked_count = '선택된 글 수';
$lang->skin_default_info = '스킨 기본정보';
$lang->skin_maker = '스킨제작자';
$lang->skin_maker_homepage = '제작자 홈페이지';
$lang->skin_author = '스킨 제작자';
$lang->skin_license = '라이선스';
$lang->skin_history = '변경 이력';
$lang->module_copy = "모듈 복사";
$lang->header_script = "헤더 스크립트";

View file

@ -21,8 +21,9 @@
$lang->category_title = 'Название категории';
$lang->checked_count = 'Число выбранных статей'; // translator's note: возможно "checked" следует перевести как "проверенных"
$lang->skin_default_info = 'Информация стандартного скина';
$lang->skin_maker = 'Разработчик скина';
$lang->skin_maker_homepage = "Домашняя страница разработчика";
$lang->skin_author = 'Разработчик скина';
$lang->skin_license = 'License';
$lang->skin_history = 'История обновлений';
$lang->module_copy = "Копировать модуль";
$lang->header_script = "헤더 스크립트";

View file

@ -21,8 +21,9 @@
$lang->category_title = '分类名';
$lang->checked_count = '被选择的主题数';
$lang->skin_default_info = '皮肤默认信息';
$lang->skin_maker = '皮肤作者';
$lang->skin_maker_homepage = '作者主页';
$lang->skin_author = '皮肤作者';
$lang->skin_license = 'License';
$lang->skin_history = '更新事项';
$lang->module_copy = "Copy Module";
$lang->header_script = "文件头部脚本";

View file

@ -236,12 +236,184 @@
// 스킨이름
$skin_info->title = $xml_obj->title->body;
// 작성자 정보
$skin_info->maker->name = $xml_obj->maker->name->body;
$skin_info->maker->email_address = $xml_obj->maker->attrs->email_address;
$skin_info->maker->homepage = $xml_obj->maker->attrs->link;
$skin_info->maker->date = $xml_obj->maker->attrs->date;
$skin_info->maker->description = $xml_obj->maker->description->body;
if($xml_obj->version && $xml_obj->attrs->version == '0.2') {
// skin format v0.2
sscanf($xml_obj->date->body, '%d-%d-%d', $date_obj->y, $date_obj->m, $date_obj->d);
$skin_info->version = $xml_obj->version->body;
$skin_info->date = sprintf('%04d%02d%02d', $date_obj->y, $date_obj->m, $date_obj->d);
$skin_info->homepage = $xml_obj->link->body;
$skin_info->license = $xml_obj->license->body;
$skin_info->license_link = $xml_obj->license->attrs->link;
$skin_info->description = $xml_obj->description->body;
if(!is_array($xml_obj->author)) $author_list[] = $xml_obj->author;
else $author_list = $xml_obj->author;
foreach($author_list as $author) {
unset($author_obj);
$author_obj->name = $author->name->body;
$author_obj->email_address = $author->attrs->email_address;
$author_obj->homepage = $author->attrs->link;
$skin_info->author[] = $author_obj;
}
// 확장변수를 정리
if($xml_obj->extra_vars) {
$extra_var_groups = $xml_obj->extra_vars->group;
if(!$extra_var_groups) $extra_var_groups = $xml_obj->extra_vars;
if(!is_array($extra_var_groups)) $extra_var_groups = array($extra_var_groups);
foreach($extra_var_groups as $group) {
$extra_vars = $group->var;
if(!is_array($group->var)) $extra_vars = array($group->var);
foreach($extra_vars as $key => $val) {
unset($obj);
if(!$val->attrs->type) { $val->attrs->type = 'text'; }
$obj->group = $group->title->body;
$obj->name = $val->attrs->name;
$obj->title = $val->title->body;
$obj->type = $val->attrs->type;
$obj->description = $val->description->body;
$obj->value = $extra_vals->{$obj->name};
$obj->default = $val->attrs->default;
if(strpos($obj->value, '|@|') != false) { $obj->value = explode('|@|', $obj->value); }
if($obj->type == 'mid_list' && !is_array($obj->value)) { $obj->value = array($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]->attrs->value;
}
} else {
$obj->options[0]->title = $val->options[0]->title->body;
$obj->options[0]->value = $val->options[0]->attrs->value;
}
$skin_info->extra_vars[] = $obj;
}
}
}
// history
if($xml_obj->history) {
if(!is_array($xml_obj->history)) $history[] = $xml_obj->history;
else $history = $xml_obj->history;
foreach($history as $item) {
unset($obj);
if($item->author) {
(!is_array($item->author)) ? $obj->author_list[] = $item->author : $obj->author_list = $item->author;
foreach($obj->author_list as $author) {
unset($author_obj);
$author_obj->name = $author->name->body;
$author_obj->email_address = $author->attrs->email_address;
$author_obj->homepage = $author->attrs->link;
$obj->author[] = $author_obj;
}
}
$obj->name = $item->name->body;
$obj->email_address = $item->attrs->email_address;
$obj->homepage = $item->attrs->link;
$obj->version = $item->attrs->version;
$obj->date = $item->attrs->date;
$obj->description = $item->description->body;
if($item->log) {
(!is_array($item->log)) ? $obj->log[] = $item->log : $obj->log = $item->log;
foreach($obj->log as $log) {
unset($log_obj);
$log_obj->text = $log->body;
$log_obj->link = $log->attrs->link;
$obj->logs[] = $log_obj;
}
}
$skin_info->history[] = $obj;
}
}
} else {
// skin format v0.1
sscanf($xml_obj->maker->attrs->date, '%d-%d-%d', $date_obj->y, $date_obj->m, $date_obj->d);
$skin_info->version = $xml_obj->version->body;
$skin_info->date = sprintf('%04d%02d%02d', $date_obj->y, $date_obj->m, $date_obj->d);
$skin_info->homepage = $xml_obj->link->body;
$skin_info->license = $xml_obj->license->body;
$skin_info->license_link = $xml_obj->license->attrs->link;
$skin_info->description = $xml_obj->maker->description->body;
$skin_info->author[0]->name = $xml_obj->maker->name->body;
$skin_info->author[0]->email_address = $xml_obj->maker->attrs->email_address;
$skin_info->author[0]->homepage = $xml_obj->maker->attrs->link;
// 스킨에서 사용되는 변수들
$extra_var_groups = $xml_obj->extra_vars->group;
if(!$extra_var_groups) $extra_var_groups = $xml_obj->extra_vars;
if(!is_array($extra_var_groups)) $extra_var_groups = array($extra_var_groups);
foreach($extra_var_groups as $group){
$extra_vars = $group->var;
if($extra_vars) {
if(!is_array($extra_vars)) $extra_vars = array($extra_vars);
foreach($extra_vars as $var) {
unset($obj);
unset($options);
$group = $group->title->body;
$name = $var->attrs->name;
$type = $var->attrs->type;
$title = $var->title->body;
$description = $var->description->body;
// 'select'type에서 option목록을 구한다.
if(is_array($var->default)) {
$option_count = count($var->default);
for($i = 0; $i < $option_count; $i++) {
$options[$i]->title = $var->default[$i]->body;
$options[$i]->value = $var->default[$i]->body;
}
} else {
$options[0]->title = $var->default->body;
$options[0]->value = $var->default->body;
}
$width = $var->attrs->width;
$height = $var->attrs->height;
unset($obj);
$obj->group = $group;
$obj->title = $title;
$obj->description = $description;
$obj->name = $name;
$obj->type = $type;
$obj->options = $options;
$obj->width = $width;
$obj->height = $height;
$obj->default = $options[0]->value;
$skin_info->extra_vars[] = $obj;
}
}
}
}
// colorset
$colorset = $xml_obj->colorset->color;
@ -265,54 +437,6 @@
}
}
// 스킨에서 사용되는 변수들
$extra_var_groups = $xml_obj->extra_vars->group;
if(!$extra_var_groups) $extra_var_groups = $xml_obj->extra_vars;
if(!is_array($extra_var_groups)) $extra_var_groups = array($extra_var_groups);
foreach($extra_var_groups as $group){
$extra_vars = $group->var;
if($extra_vars) {
if(!is_array($extra_vars)) $extra_vars = array($extra_vars);
foreach($extra_vars as $var) {
unset($obj);
$group = $group->title->body;
$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;$i<count($var->default);$i++) $default[] = $var->default[$i]->body;
} else {
$default = $var->default->body;
}
}
$width = $var->attrs->width;
$height = $var->attrs->height;
unset($obj);
$obj->group = $group;
$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;
}
}
}
// 메뉴 종류 (레이아웃을 위한 설정)
if($xml_obj->menus->menu) {
$menus = $xml_obj->menus->menu;
@ -520,6 +644,49 @@
$module_info->author[] = $author_obj;
}
// history
if($xml_obj->history) {
if(!is_array($xml_obj->history)) $history[] = $xml_obj->history;
else $history = $xml_obj->history;
foreach($history as $item) {
unset($obj);
if($item->author) {
(!is_array($item->author)) ? $obj->author_list[] = $item->author : $obj->author_list = $item->author;
foreach($obj->author_list as $author) {
unset($author_obj);
$author_obj->name = $author->name->body;
$author_obj->email_address = $author->attrs->email_address;
$author_obj->homepage = $author->attrs->link;
$obj->author[] = $author_obj;
}
}
$obj->name = $item->name->body;
$obj->email_address = $item->attrs->email_address;
$obj->homepage = $item->attrs->link;
$obj->version = $item->attrs->version;
$obj->date = $item->attrs->date;
$obj->description = $item->description->body;
if($item->log) {
(!is_array($item->log)) ? $obj->log[] = $item->log : $obj->log = $item->log;
foreach($obj->log as $log) {
unset($logs_obj);
$logs_obj->text = $log->body;
$logs_obj->link = $log->attrs->link;
$obj->logs[] = $logs_obj;
}
}
$module_info->history[] = $obj;
}
}
} else {
// module format 0.1
$module_info->title = $xml_obj->title->body;
@ -535,45 +702,6 @@
$module_info->author[] = $author_obj;
}
// history
if($xml_obj->history) {
if(!is_array($xml_obj->history)) $history[] = $xml_obj->history;
else $history = $xml_obj->history;
foreach($history as $item) {
unset($obj);
if($item->author) {
(!is_array($item->author)) ? $obj->author_list[] = $item->author : $obj->author_list = $item->author;
foreach($obj->author_list as $author) {
unset($author_obj);
$author_obj->name = $author->name->body;
$author_obj->email_address = $author->attrs->email_address;
$author_obj->homepage = $author->attrs->link;
$obj->author[] = $author_obj;
}
}
$obj->name = $item->name->body;
$obj->email_address = $item->attrs->email_address;
$obj->homepage = $item->attrs->link;
$obj->version = $item->attrs->version;
$obj->date = $item->attrs->date;
$obj->description = $item->description->body;
if($item->log) {
(!is_array($item->log)) ? $obj->log[] = $item->log : $obj->log = $item->log;
foreach($obj->log as $log) {
$obj->logs[] = $log->body;
}
}
$module_info->history[] = $obj;
}
}
// action 정보를 얻어서 admin_index를 추가
$action_info = $this->getModuleActionXml($module);
$module_info->admin_index_act = $action_info->admin_index_act;

View file

@ -34,7 +34,7 @@
<th scope="row">{$lang->module_license}</th>
<td>
{nl2br(trim($module_info->license))}
<!--@if($addon_info->license_link)-->
<!--@if($module_info->license_link)-->
<p><a href="{$module_info->license_link}" onclick="window.close(); return false;">{$module_info->license_link}</a></p>
<!--@end-->
</td>
@ -73,7 +73,13 @@
<!--@endif-->
<!--@if($history->logs)-->
<ul>
<!--@foreach($history->logs as $log)--><li>{$log}</li><!--@endforeach-->
<!--@foreach($history->logs as $log)-->
<!--@if($log->link)-->
<li><a href="{$log->text}" onclick="window.open(this.href);return false;">{$log->text}</a></li>
<!--@else-->
<li>{$log->text}</li>
<!--@endif-->
<!--@endforeach-->
</ul>
<!--@endif-->
</td>

View file

@ -13,23 +13,81 @@
</tr>
<tr>
<th scope="row"><label for="textfield2">{$lang->author}</label></th>
<td class="blue"><a href="mailto:{$skin_info->maker->email_address}">{$skin_info->maker->name}</a></td>
<td class="blue">
<!--@foreach($skin_info->author as $author)-->
{$author->name} (<a href="{$author->homepage}" onclick="window.open(this.href);return false;">{$author->homepage}</a>, <a href="mailto:{$author->email_address}">{$author->email_address}</a>)<br />
<!--@endforeach-->
</td>
</tr>
<!--@if($skin_info->homepage)-->
<tr>
<th scope="row"><label for="textfield2">{$lang->homepage}</label></th>
<td class="blue"><a href="{$skin_info->maker->homepage}" onclick="window.open(this.href);return false;">{$skin_info->maker->homepage}</a></td>
<td class="blue"><a href="{$skin_info->homepage}" onclick="window.open(this.href);return false;">{$skin_info->homepage}</a></td>
</tr>
<!--@endif-->
<tr>
<th scope="row"><label for="textfield2">{$lang->regdate}</label></th>
<td>{$skin_info->maker->date}</td>
<td>{zdate($skin_info->date, 'Y-m-d')}</td>
</tr>
<!--@if($skin_info->license || $skin_info->license_link)-->
<tr>
<th scope="row">{$lang->skin_license}</th>
<td>
{nl2br(trim($skin_info->license))}
<!--@if($skin_info->license_link)-->
<p><a href="{$skin_info->license_link}" onclick="window.close(); return false;">{$skin_info->license_link}</a></p>
<!--@end-->
</td>
</tr>
<!--@end-->
<tr>
<th scope="row" class="borderBottomNone">{$lang->description}</th>
<td class="borderBottomNone">{nl2br(trim($skin_info->maker->description))}</td>
<td class="borderBottomNone">{nl2br(trim($skin_info->description))}</td>
</tr>
</table>
</div>
<!--@if($skin_info->history)-->
<div id="popHistoryHeadder">
<h3>{$lang->skin_history}</h3>
</div>
<div id="popHistoryBody">
<table cellspacing="0" class="adminTable">
<col width="100" />
<col />
<!--@foreach($skin_info->history as $history)-->
<tr>
<th scope="row">
{$history->version}<br />
{$history->date}
</th>
<td>
<!--@foreach($history->author as $author)-->
<p>{$author->name} (<a href="{$author->homepage}" onclick="window.open(this.href);return false;">{$author->homepage}</a> / <a href="mailto:{$author->email_address}">{$author->email_address}</a>)</p>
<!--@endforeach-->
<!--@if($history->description)-->
<p>{nl2br(trim($history->description))}</p>
<!--@endif-->
<!--@if($history->logs)-->
<ul>
<!--@foreach($history->logs as $log)-->
<!--@if($log->link)-->
<li><a href="{$log->link}">{$log->text}</a></li>
<!--@else-->
<li>{$log->text}</li>
<!--@endif-->
<!--@endforeach-->
</ul>
<!--@endif-->
</td>
</tr>
<!--@endforeach-->
</table>
</div>
<!--@endif-->
<div id="popFooter" class="tCenter">
<a href="#" onclick="window.close(); return false;" class="button"><span>{$lang->cmd_close}</span></a>
</div>