#468 관련 레이아웃 group 태그 지원

git-svn-id: http://xe-core.googlecode.com/svn/sandbox@4164 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
mmx900 2008-05-02 06:26:00 +00:00
parent b67dcb1d3f
commit 4f69690609
2 changed files with 45 additions and 21 deletions

View file

@ -147,31 +147,37 @@
$buff .= sprintf('$layout_info->author->description = "%s";', $xml_obj->author->description->body);
// 추가 변수 (템플릿에서 사용할 제작자 정의 변수)
$extra_vars = $xml_obj->extra_vars->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);
$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;
$extra_var_count = count($extra_vars);
$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_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;
$options = $var->options;
if(!$options) continue;
$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));
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);
$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);
}
}
}
}

View file

@ -52,6 +52,16 @@
</td>
</tr>
<!--@foreach($selected_layout->extra_var as $name => $var)-->
<!--@if($var->group && ((!$group) || $group != $var->group))-->
{@$group = $var->group}
</table>
<table cellspacing="0" class="adminTable">
<col width="150" />
<col width="*" />
<caption>{$group}</caption>
<!--@end-->
<tr>
<th scope="row">{$var->title}</th>
@ -85,6 +95,14 @@
</td>
</tr>
<!--@end-->
<!--@if($var->group)-->
</table>
<table cellspacing="0" class="adminTable">
<col width="150" />
<col width="*" />
<!--@end-->
<!--@foreach($selected_layout->menu as $menu_name => $menu_info)-->
<tr>
<th scope="row">{$menu_info->title}<br />({$menu_name})</th>