#495 layout모듈 XML 포맷 재정비

git-svn-id: http://xe-core.googlecode.com/svn/sandbox@4392 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
bnu 2008-07-20 04:24:44 +00:00
parent 495dd1155a
commit 195240bb6e
3 changed files with 117 additions and 66 deletions

View file

@ -71,7 +71,7 @@
<description xml:lang="ge">Bitte wählen Sie ein colorset Sie wollen.</description>
<description xml:lang="ru">Выберите colorset хотите.</description>
<description xml:lang="es">Seleccione set de colores que desea.</description>
<options name="blue">
<options value="blue">
<title xml:lang="ko">파란색 (기본)</title>
<title xml:lang="jp">青 (default)</title>
<title xml:lang="zh-CN">蓝色 (default)</title>
@ -79,9 +79,8 @@
<title xml:lang="ge">Blue (Standard)</title>
<title xml:lang="es">Azul (default)</title>
<title xml:lang="ru">Blue (default)</title>
<value>blue</value>
</options>
<options name="gray">
<options value="gray">
<title xml:lang="ko">회색</title>
<title xml:lang="jp">灰色背景</title>
<title xml:lang="zh-CN">灰色背景</title>
@ -89,9 +88,8 @@
<title xml:lang="ge">Gray</title>
<title xml:lang="es">Gray</title>
<title xml:lang="ru">Gray</title>
<value>gray</value>
</options>
<options name="orange">
<options value="orange">
<title xml:lang="ko">오렌지</title>
<title xml:lang="jp">Orange</title>
<title xml:lang="zh-CN">Orange</title>
@ -99,9 +97,8 @@
<title xml:lang="ge">Orange</title>
<title xml:lang="es">Orange</title>
<title xml:lang="ru">Orange</title>
<value>orange</value>
</options>
<options name="violet">
<options value="violet">
<title xml:lang="ko">보라색</title>
<title xml:lang="jp">Violet</title>
<title xml:lang="zh-CN">Violet</title>
@ -109,9 +106,8 @@
<title xml:lang="ge">Violett</title>
<title xml:lang="es">Violet</title>
<title xml:lang="ru">Violet</title>
<value>violet</value>
</options>
<options name="green">
<options value="green">
<title xml:lang="ko">초록색</title>
<title xml:lang="jp"></title>
<title xml:lang="zh-CN">绿色</title>
@ -119,7 +115,6 @@
<title xml:lang="ge">Grün</title>
<title xml:lang="es">Verde</title>
<title xml:lang="ru">Green</title>
<value>green</value>
</options>
</var>
<var name="target_mid" type="text">
@ -188,7 +183,7 @@
</extra_vars>
<menus>
<menu name="top_menu" default="true">
<menu name="top_menu" maxdepth="1" default="true">
<title xml:lang="ko">상단 메뉴</title>
<title xml:lang="jp">上段メニュー</title>
<title xml:lang="zh-CN">菜单</title>
@ -196,7 +191,6 @@
<title xml:lang="ge">Top-Menü</title>
<title xml:lang="es">Menú superior</title>
<title xml:lang="ru">Главное меню</title>
<maxdepth>1</maxdepth>
</menu>
</menus>
</layout>

View file

@ -78,7 +78,7 @@
<description xml:lang="ge">Bitte wählen Sie ein colorset Sie wollen.</description>
<description xml:lang="ru">Выберите colorset хотите.</description>
<description xml:lang="es">Seleccione set de colores que desea.</description>
<options name="default">
<options value="default">
<title xml:lang="ko">기본</title>
<title xml:lang="jp">デフォルト</title>
<title xml:lang="en">Basic</title>
@ -86,9 +86,8 @@
<title xml:lang="ru">Базовые</title>
<title xml:lang="es">Básico</title>
<title xml:lang="zh-CN">默认</title>
<value>default</value>
</options>
<options name="black">
<options value="black">
<title xml:lang="ko">검은색</title>
<title xml:lang="jp"></title>
<title xml:lang="en">Black</title>
@ -96,9 +95,8 @@
<title xml:lang="ru">Черного</title>
<title xml:lang="es">Negro</title>
<title xml:lang="zh-CN">黑色</title>
<value>black</value>
</options>
<options name="white">
<options value="white">
<title xml:lang="ko">하얀색</title>
<title xml:lang="jp"></title>
<title xml:lang="en">white</title>
@ -106,7 +104,6 @@
<title xml:lang="ru">белый</title>
<title xml:lang="es">Blanco</title>
<title xml:lang="zh-CN">白色</title>
<value>white</value>
</options>
</var>
<var name="logo_image" type="image">
@ -160,7 +157,7 @@
</extra_vars>
<menus>
<menu name="main_menu" default="true">
<menu name="main_menu" maxdepth="3" default="true">
<title xml:lang="ko">상단 메뉴</title>
<title xml:lang="jp">上段メニュー</title>
<title xml:lang="zh-CN">主菜单</title>
@ -168,9 +165,8 @@
<title xml:lang="ge">Top Menü</title>
<title xml:lang="ru">Верхнее меню</title>
<title xml:lang="es">Menú Principal</title>
<maxdepth>3</maxdepth>
</menu>
<menu name="bottom_menu">
<menu name="bottom_menu" maxdepth="1">
<title xml:lang="ko">하단 메뉴 </title>
<title xml:lang="jp">下段メニュー</title>
<title xml:lang="zh-CN">底部菜单</title>
@ -178,7 +174,6 @@
<title xml:lang="ge">Bottom-Menü</title>
<title xml:lang="ru">Внизу меню</title>
<title xml:lang="es">Menú Inferior </title>
<maxdepth>1</maxdepth>
</menu>
</menus>
</layout>

View file

@ -141,10 +141,11 @@
$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->homepage = "%s";', $xml_obj->link->body);
$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->license_link = "%s";', $xml_obj->license->attrs->link);
// 작성자 정보
if(!is_array($xml_obj->author)) $author_list[] = $xml_obj->author;
@ -156,6 +157,65 @@
$buff .= sprintf('$layout_info->author['.$i.']->homepage = "%s";', $author_list[$i]->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);
$extra_var_count = count($extra_vars);
$buff .= sprintf('$layout_info->extra_var_count = "%s";', $extra_var_count);
for($i=0;$i<$extra_var_count;$i++) {
unset($var);
unset($options);
$var = $extra_vars[$i];
$name = $var->attrs->name;
$buff .= sprintf('$layout_info->extra_var->%s->group = "%s";', $name, $group->title->body);
$buff .= sprintf('$layout_info->extra_var->%s->title = "%s";', $name, $var->title->body);
$buff .= sprintf('$layout_info->extra_var->%s->type = "%s";', $name, $var->attrs->type);
$buff .= sprintf('$layout_info->extra_var->%s->value = $vars->%s;', $name, $name);
$buff .= sprintf('$layout_info->extra_var->%s->description = "%s";', $name, str_replace('"','\"',$var->description->body));
$options = $var->options;
if(!$options) continue;
if(!is_array($options)) $options = array($options);
$options_count = count($options);
for($j=0;$j<$options_count;$j++) {
$buff .= sprintf('$layout_info->extra_var->%s->options["%s"] = "%s";', $var->attrs->name, $options[$j]->attrs->value, $options[$j]->title->body);
}
}
}
}
// 메뉴
if($xml_obj->menus->menu) {
$menus = $xml_obj->menus->menu;
if(!is_array($menus)) $menus = array($menus);
$menu_count = count($menus);
$buff .= sprintf('$layout_info->menu_count = "%s";', $menu_count);
for($i=0;$i<$menu_count;$i++) {
$name = $menus[$i]->attrs->name;
if($menus[$i]->attrs->default == "true") $buff .= sprintf('$layout_info->default_menu = "%s";', $name);
$buff .= sprintf('$layout_info->menu->%s->name = "%s";',$name, $menus[$i]->attrs->name);
$buff .= sprintf('$layout_info->menu->%s->title = "%s";',$name, $menus[$i]->title->body);
$buff .= sprintf('$layout_info->menu->%s->maxdepth = "%s";',$name, $menus[$i]->attrs->maxdepth);
$buff .= sprintf('$layout_info->menu->%s->menu_srl = $vars->%s;', $name, $name);
$buff .= sprintf('$layout_info->menu->%s->xml_file = "./files/cache/menu/".$vars->%s.".xml.php";',$name, $name);
$buff .= sprintf('$layout_info->menu->%s->php_file = "./files/cache/menu/".$vars->%s.".php";',$name, $name);
}
}
// history
if($xml_obj->history) {
if(!is_array($xml_obj->history)) $history_list[] = $xml_obj->history;
@ -209,64 +269,66 @@
$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;
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);
// 추가 변수 (템플릿에서 사용할 제작자 정의 변수)
$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);
$extra_var_count = count($extra_vars);
$extra_var_count = count($extra_vars);
$buff .= sprintf('$layout_info->extra_var_count = "%s";', $extra_var_count);
for($i=0;$i<$extra_var_count;$i++) {
unset($var);
unset($options);
$var = $extra_vars[$i];
$name = $var->attrs->name;
$buff .= sprintf('$layout_info->extra_var_count = "%s";', $extra_var_count);
for($i=0;$i<$extra_var_count;$i++) {
unset($var);
unset($options);
$var = $extra_vars[$i];
$name = $var->attrs->name;
$buff .= sprintf('$layout_info->extra_var->%s->group = "%s";', $name, $group->title->body);
$buff .= sprintf('$layout_info->extra_var->%s->title = "%s";', $name, $var->title->body);
$buff .= sprintf('$layout_info->extra_var->%s->type = "%s";', $name, $var->attrs->type);
$buff .= sprintf('$layout_info->extra_var->%s->value = $vars->%s;', $name, $name);
$buff .= sprintf('$layout_info->extra_var->%s->description = "%s";', $name, str_replace('"','\"',$var->description->body));
$buff .= sprintf('$layout_info->extra_var->%s->group = "%s";', $name, $group->title->body);
$buff .= sprintf('$layout_info->extra_var->%s->title = "%s";', $name, $var->title->body);
$buff .= sprintf('$layout_info->extra_var->%s->type = "%s";', $name, $var->attrs->type);
$buff .= sprintf('$layout_info->extra_var->%s->value = $vars->%s;', $name, $name);
$buff .= sprintf('$layout_info->extra_var->%s->description = "%s";', $name, str_replace('"','\"',$var->description->body));
$options = $var->options;
if(!$options) continue;
$options = $var->options;
if(!$options) continue;
if(!is_array($options)) $options = array($options);
$options_count = count($options);
for($j=0;$j<$options_count;$j++) {
$buff .= sprintf('$layout_info->extra_var->%s->options["%s"] = "%s";', $var->attrs->name, $options[$j]->value->body, $options[$j]->title->body);
if(!is_array($options)) $options = array($options);
$options_count = count($options);
for($j=0;$j<$options_count;$j++) {
$buff .= sprintf('$layout_info->extra_var->%s->options["%s"] = "%s";', $var->attrs->name, $options[$j]->value->body, $options[$j]->title->body);
}
}
}
}
}
// 메뉴
if($xml_obj->menus->menu) {
$menus = $xml_obj->menus->menu;
if(!is_array($menus)) $menus = array($menus);
// 메뉴
if($xml_obj->menus->menu) {
$menus = $xml_obj->menus->menu;
if(!is_array($menus)) $menus = array($menus);
$menu_count = count($menus);
$buff .= sprintf('$layout_info->menu_count = "%s";', $menu_count);
for($i=0;$i<$menu_count;$i++) {
$name = $menus[$i]->attrs->name;
if($menus[$i]->attrs->default == "true") $buff .= sprintf('$layout_info->default_menu = "%s";', $name);
$buff .= sprintf('$layout_info->menu->%s->name = "%s";',$name, $menus[$i]->attrs->name);
$buff .= sprintf('$layout_info->menu->%s->title = "%s";',$name, $menus[$i]->title->body);
$buff .= sprintf('$layout_info->menu->%s->maxdepth = "%s";',$name, $menus[$i]->maxdepth->body);
$menu_count = count($menus);
$buff .= sprintf('$layout_info->menu_count = "%s";', $menu_count);
for($i=0;$i<$menu_count;$i++) {
$name = $menus[$i]->attrs->name;
if($menus[$i]->attrs->default == "true") $buff .= sprintf('$layout_info->default_menu = "%s";', $name);
$buff .= sprintf('$layout_info->menu->%s->name = "%s";',$name, $menus[$i]->attrs->name);
$buff .= sprintf('$layout_info->menu->%s->title = "%s";',$name, $menus[$i]->title->body);
$buff .= sprintf('$layout_info->menu->%s->maxdepth = "%s";',$name, $menus[$i]->maxdepth->body);
$buff .= sprintf('$layout_info->menu->%s->menu_srl = $vars->%s;', $name, $name);
$buff .= sprintf('$layout_info->menu->%s->xml_file = "./files/cache/menu/".$vars->%s.".xml.php";',$name, $name);
$buff .= sprintf('$layout_info->menu->%s->php_file = "./files/cache/menu/".$vars->%s.".php";',$name, $name);
$buff .= sprintf('$layout_info->menu->%s->menu_srl = $vars->%s;', $name, $name);
$buff .= sprintf('$layout_info->menu->%s->xml_file = "./files/cache/menu/".$vars->%s.".xml.php";',$name, $name);
$buff .= sprintf('$layout_info->menu->%s->php_file = "./files/cache/menu/".$vars->%s.".php";',$name, $name);
}
}
}
// header_script
$oModuleModel = &getModel('module');
$layout_config = $oModuleModel->getModuleConfig('layout');