#495 layout모듈 새 XML 포맷 처리 코드 추가

git-svn-id: http://xe-core.googlecode.com/svn/sandbox@4363 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
bnu 2008-07-15 08:03:06 +00:00
parent ed6b132fe8
commit 5a135acfa6
10 changed files with 159 additions and 25 deletions

View file

@ -10,6 +10,7 @@
$lang->layout_name = 'Layout Name';
$lang->layout_maker = "Layout Developer";
$lang->layout_license = 'License';
$lang->layout_history = "Updates";
$lang->layout_info = "Layout Info";
$lang->layout_list = 'Layout List';

View file

@ -10,6 +10,7 @@
$lang->layout_name = 'Nombre del Diseño';
$lang->layout_maker = "Desarrollador del Diseño";
$lang->layout_license = 'License';
$lang->layout_history = "Actualización";
$lang->layout_info = "Información del Diseño";
$lang->layout_list = 'Lista de los Diseños';

View file

@ -10,6 +10,7 @@
$lang->layout_name = 'Nom du Mise en Page';
$lang->layout_maker = "Développeur du Mise en Page";
$lang->layout_license = 'License';
$lang->layout_history = "Mise à Jour";
$lang->layout_info = "Informations du Mise en Page";
$lang->layout_list = 'Liste des Mises en Page';

View file

@ -10,6 +10,7 @@
$lang->layout_name = 'レイアウト名';
$lang->layout_maker = "レイアウト作者";
$lang->layout_license = 'License';
$lang->layout_history = "変更内容 ";
$lang->layout_info = "レイアウト情報";
$lang->layout_list = 'レイアウトリスト';

View file

@ -10,7 +10,8 @@
$lang->layout_name = '레이아웃 이름';
$lang->layout_maker = "레이아웃 제작자";
$lang->layout_history = "변경 사항 ";
$lang->layout_license = '라이센스';
$lang->layout_history = '변경 이력';
$lang->layout_info = "레이아웃 정보";
$lang->layout_list = '레이아웃 목록';
$lang->menu_count = '메뉴수';

View file

@ -10,6 +10,7 @@
$lang->layout_name = 'Имя лейаута';
$lang->layout_maker = "Разработчик лейаута";
$lang->layout_license = 'License';
$lang->layout_history = "Обновления";
$lang->layout_info = "Информация лейаута";
$lang->layout_list = 'Список лейаутов';

View file

@ -12,6 +12,7 @@
$lang->layout_name = '布局名';
$lang->layout_maker = "布局作者";
$lang->layout_license = 'License';
$lang->layout_history = "更新记录 ";
$lang->layout_info = "布局信息";
$lang->layout_list = '布局目录';

View file

@ -16,7 +16,7 @@
/**
* @brief DB 생성된 레이아웃의 목록을 구함
* 생성되었다는 것은 DB에 등록이 되었다는 것을 의미
* 생성되었다는 것은 DB에 등록이 되었다는 것을 의미
**/
function getLayoutList() {
$output = executeQuery('layout.getLayoutList');
@ -46,7 +46,7 @@
**/
function getLayoutPath($layout_name) {
$class_path = sprintf('./layouts/%s/', $layout_name);
if(is_dir($class_path)) return $class_path;
if(is_dir($class_path)) return $class_path;
return "";
}
@ -76,7 +76,7 @@
/**
* @brief 모듈의 conf/info.xml 읽어서 정보를 구함
* 이것 역시 캐싱을 통해서 xml parsing 시간을 줄인다..
* 이것 역시 캐싱을 통해서 xml parsing 시간을 줄인다..
**/
function getLayoutInfo($layout, $info = null) {
if($info) {
@ -89,7 +89,7 @@
$layout_path = preg_replace('/([a-zA-Z0-9\_\.]+)(\.html)$/','',$info->layout_path);
$xml_file = sprintf('%sskin.xml', $layout_path);
}
}
}
// 요청된 모듈의 경로를 구한다. 없으면 return
if(!$layout_path) $layout_path = $this->getLayoutPath($layout);
@ -131,20 +131,85 @@
$buff = '';
// 레이아웃의 제목, 버전
$buff .= sprintf('$layout_info->layout = "%s";', $layout);
$buff .= sprintf('$layout_info->path = "%s";', $layout_path);
$buff .= sprintf('$layout_info->title = "%s";', $xml_obj->title->body);
$buff .= sprintf('$layout_info->version = "%s";', $xml_obj->attrs->version);
$buff .= sprintf('$layout_info->layout_srl = $layout_srl;');
$buff .= sprintf('$layout_info->layout_title = $layout_title;');
if($xml_obj->version && $xml_obj->attrs->version == '0.2') {
// 레이아웃의 제목, 버전
sscanf($xml_obj->date->body, '%d-%d-%d', $date_obj->y, $date_obj->m, $date_obj->d);
$date = sprintf('%04d%02d%02d', $date_obj->y, $date_obj->m, $date_obj->d);
$buff .= sprintf('$layout_info->layout = "%s";', $layout);
$buff .= sprintf('$layout_info->path = "%s";', $layout_path);
$buff .= sprintf('$layout_info->title = "%s";', $xml_obj->title->body);
$buff .= sprintf('$layout_info->description = "%s";', $xml_obj->description->body);
$buff .= sprintf('$layout_info->version = "%s";', $xml_obj->version->body);
$buff .= sprintf('$layout_info->date = "%s";', $date);
$buff .= sprintf('$layout_info->layout_srl = $layout_srl;');
$buff .= sprintf('$layout_info->layout_title = $layout_title;');
$buff .= sprintf('$layout_info->license = "%s";', $xml_obj->license->body);
$buff .= sprintf('$layout_info->license_link = "%S";', $xml_obj->license->attrs->link);
// 작성자 정보
$buff .= sprintf('$layout_info->author->name = "%s";', $xml_obj->author->name->body);
$buff .= sprintf('$layout_info->author->email_address = "%s";', $xml_obj->author->attrs->email_address);
$buff .= sprintf('$layout_info->author->homepage = "%s";', $xml_obj->author->attrs->link);
$buff .= sprintf('$layout_info->author->date = "%s";', $xml_obj->author->attrs->date);
$buff .= sprintf('$layout_info->author->description = "%s";', $xml_obj->author->description->body);
// 작성자 정보
if(!is_array($xml_obj->author)) $author_list[] = $xml_obj->author;
else $author_list = $xml_obj->author;
for($i=0; $i < count($author_list); $i++) {
$buff .= sprintf('$layout_info->author['.$i.']->name = "%s";', $author_list[$i]->name->body);
$buff .= sprintf('$layout_info->author['.$i.']->email_address = "%s";', $author_list[$i]->attrs->email_address);
$buff .= sprintf('$layout_info->author['.$i.']->homepage = "%s";', $author_list[$i]->attrs->link);
}
// history
if($xml_obj->history) {
if(!is_array($xml_obj->history)) $history_list[] = $xml_obj->history;
else $history_list = $xml_obj->history;
for($i=0; $i < count($history_list); $i++) {
sscanf($history_list[$i]->attrs->date, '%d-%d-%d', $date_obj->y, $date_obj->m, $date_obj->d);
$date = sprintf('%04d%02d%02d', $date_obj->y, $date_obj->m, $date_obj->d);
$buff .= sprintf('$layout_info->history['.$i.']->description = "%s";', $history_list[$i]->description->body);
$buff .= sprintf('$layout_info->history['.$i.']->version = "%s";', $history_list[$i]->attrs->version);
$buff .= sprintf('$layout_info->history['.$i.']->date = "%s";', $date);
if($history_list[$i]->author) {
(!is_array($history_list[$i]->author)) ? $obj->author_list[] = $history_list[$i]->author : $obj->author_list = $history_list[$i]->author;
for($j=0; $j < count($obj->author_list); $j++) {
$buff .= sprintf('$layout_info->history['.$i.']->author['.$j.']->name = "%s";', $obj->author_list[$j]->name->body);
$buff .= sprintf('$layout_info->history['.$i.']->author['.$j.']->email_address = "%s";', $obj->author_list[$j]->attrs->email_address);
$buff .= sprintf('$layout_info->history['.$i.']->author['.$j.']->homepage = "%s";', $obj->author_list[$j]->attrs->link);
}
}
if($history_list[$i]->log) {
(!is_array($history_list[$i]->log)) ? $obj->log_list[] = $history_list[$i]->log : $obj->log_list = $history_list[$i]->log;
for($j=0; $j < count($obj->log_list); $j++) {
$buff .= sprintf('$layout_info->history['.$i.']->logs['.$j.']->text = "%s";', $obj->log_list[$j]->body);
$buff .= sprintf('$layout_info->history['.$i.']->logs['.$j.']->link = "%s";', $obj->log_list[$j]->attrs->link);
}
}
}
}
} else {
// 레이아웃의 제목, 버전
sscanf($xml_obj->author->attrs->date, '%d. %d. %d', $date_obj->y, $date_obj->m, $date_obj->d);
$date = sprintf('%04d%02d%02d', $date_obj->y, $date_obj->m, $date_obj->d);
$buff .= sprintf('$layout_info->layout = "%s";', $layout);
$buff .= sprintf('$layout_info->path = "%s";', $layout_path);
$buff .= sprintf('$layout_info->title = "%s";', $xml_obj->title->body);
$buff .= sprintf('$layout_info->description = "%s";', $xml_obj->author->description->body);
$buff .= sprintf('$layout_info->version = "%s";', $xml_obj->attrs->version);
$buff .= sprintf('$layout_info->date = "%s";', $date);
$buff .= sprintf('$layout_info->layout_srl = $layout_srl;');
$buff .= sprintf('$layout_info->layout_title = $layout_title;');
// 작성자 정보
$buff .= sprintf('$layout_info->author[0]->name = "%s";', $xml_obj->author->name->body);
$buff .= sprintf('$layout_info->author[0]->email_address = "%s";', $xml_obj->author->attrs->email_address);
$buff .= sprintf('$layout_info->author[0]->homepage = "%s";', $xml_obj->author->attrs->link);
}
// 추가 변수 (템플릿에서 사용할 제작자 정의 변수)
$extra_var_groups = $xml_obj->extra_vars->group;

View file

@ -43,15 +43,19 @@
({$val->layout})
</th>
<td class="tahoma">{$val->version}</td>
<td><a href="{$val->author->homepage}" onclick="window.open(this.href);return false;" class="blue">{$val->author->name}</a></td>
<td>
<!--@foreach($val->author as $author)-->
<a href="{$author->homepage}" onclick="window.open(this.href);return false;">{$author->name}</a>
<!--@endforeach-->
</td>
<td class="tahoma">{$val->menu_count}</td>
<td class="tahoma">{$val->author->date}</td>
<td class="tahoma">{zdate($val->date, 'Y-m-d')}</td>
<td class="tahoma">{$val->path}</td>
<td><a href="{getUrl('act','dispLayoutAdminInsert','layout',$val->layout)}" class="button"><span>{$lang->cmd_make}</span></a></td>
</tr>
<tr>
<td colspan="6" class="left">
{nl2br(trim($val->author->description))}
{nl2br(trim($val->description))}
</td>
</tr>
<!-- 레이아웃 정보 파일(conf/info.xml)이 없는 경우 -->

View file

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