mirror of
https://github.com/Lastorder-DC/rhymix.git
synced 2026-01-09 03:32:00 +09:00
#468 관련 위젯 group 태그 지원
git-svn-id: http://xe-core.googlecode.com/svn/sandbox@4168 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
parent
9ed3dd3121
commit
e11657427e
3 changed files with 62 additions and 31 deletions
|
|
@ -11,8 +11,6 @@
|
|||
</div>
|
||||
|
||||
<div id="popBody">
|
||||
|
||||
|
||||
<table cellspacing="0" class="adminTable">
|
||||
<col width="100" />
|
||||
<col />
|
||||
|
|
@ -49,7 +47,17 @@
|
|||
<p>{$lang->about_widget_cache}</p>
|
||||
</td>
|
||||
</tr>
|
||||
<!--@foreach($widget_info->extra_var as $id => $var)-->
|
||||
<!--@foreach($widget_info->extra_var as $id => $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->name}
|
||||
|
|
@ -92,6 +100,14 @@
|
|||
</td>
|
||||
</tr>
|
||||
<!--@end-->
|
||||
|
||||
<!--@if($group)-->
|
||||
</table>
|
||||
<table cellspacing="0" class="adminTable">
|
||||
<col width="150" />
|
||||
<col width="*" />
|
||||
<!--@end-->
|
||||
|
||||
<tr>
|
||||
<th>{$lang->widget_code}</th>
|
||||
<td><textarea readonly="true" id="widget_code" class="inputTypeTextArea w100"></textarea></td>
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@
|
|||
</div>
|
||||
|
||||
<div id="popBody">
|
||||
|
||||
<table cellspacing="0" class="adminTable">
|
||||
<col width="150" />
|
||||
<col />
|
||||
|
|
@ -60,7 +59,17 @@
|
|||
<p>{$lang->about_widget_cache}</p>
|
||||
</td>
|
||||
</tr>
|
||||
<!--@foreach($widget_info->extra_var as $id => $var)-->
|
||||
<!--@foreach($widget_info->extra_var as $id => $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->name}
|
||||
|
|
|
|||
|
|
@ -93,36 +93,42 @@
|
|||
$buff .= sprintf('$widget_info->author->description = "%s";', $xml_obj->author->description->body);
|
||||
|
||||
// 추가 변수 (템플릿에서 사용할 제작자 정의 변수)
|
||||
if(!is_array($xml_obj->extra_vars->var)) $extra_vars[] = $xml_obj->extra_vars->var;
|
||||
else $extra_vars = $xml_obj->extra_vars->var;
|
||||
$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);
|
||||
|
||||
if($extra_vars[0]->attrs->id || $extra_vars[0]->attrs->name) {
|
||||
$extra_var_count = count($extra_vars);
|
||||
|
||||
$buff .= sprintf('$widget_info->extra_var_count = "%s";', $extra_var_count);
|
||||
for($i=0;$i<$extra_var_count;$i++) {
|
||||
unset($var);
|
||||
unset($options);
|
||||
$var = $extra_vars[$i];
|
||||
|
||||
if($extra_vars[0]->attrs->id || $extra_vars[0]->attrs->name) {
|
||||
$extra_var_count = count($extra_vars);
|
||||
$id = $var->attrs->id?$var->attrs->id:$var->attrs->name;
|
||||
$name = $var->name->body?$var->name->body:$var->title->body;
|
||||
$type = $var->attrs->type?$var->attrs->type:$var->type->body;
|
||||
|
||||
$buff .= sprintf('$widget_info->extra_var_count = "%s";', $extra_var_count);
|
||||
for($i=0;$i<$extra_var_count;$i++) {
|
||||
unset($var);
|
||||
unset($options);
|
||||
$var = $extra_vars[$i];
|
||||
$buff .= sprintf('$widget_info->extra_var->%s->group = "%s";', $id, $group->title->body);
|
||||
$buff .= sprintf('$widget_info->extra_var->%s->name = "%s";', $id, $name);
|
||||
$buff .= sprintf('$widget_info->extra_var->%s->type = "%s";', $id, $type);
|
||||
$buff .= sprintf('$widget_info->extra_var->%s->value = $vars->%s;', $id, $id);
|
||||
$buff .= sprintf('$widget_info->extra_var->%s->description = "%s";', $id, str_replace('"','\"',$var->description->body));
|
||||
|
||||
$options = $var->options;
|
||||
if(!$options) continue;
|
||||
|
||||
$id = $var->attrs->id?$var->attrs->id:$var->attrs->name;
|
||||
$name = $var->name->body?$var->name->body:$var->title->body;
|
||||
$type = $var->attrs->type?$var->attrs->type:$var->type->body;
|
||||
|
||||
$buff .= sprintf('$widget_info->extra_var->%s->name = "%s";', $id, $name);
|
||||
$buff .= sprintf('$widget_info->extra_var->%s->type = "%s";', $id, $type);
|
||||
$buff .= sprintf('$widget_info->extra_var->%s->value = $vars->%s;', $id, $id);
|
||||
$buff .= sprintf('$widget_info->extra_var->%s->description = "%s";', $id, 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('$widget_info->extra_var->%s->options["%s"] = "%s";', $id, $options[$j]->value->body, $options[$j]->name->body);
|
||||
if(!is_array($options)) $options = array($options);
|
||||
$options_count = count($options);
|
||||
for($j=0;$j<$options_count;$j++) {
|
||||
$buff .= sprintf('$widget_info->extra_var->%s->options["%s"] = "%s";', $id, $options[$j]->value->body, $options[$j]->name->body);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue