issue 160, if layout files not exists, delete layout instance. fixed a bug for return wrong info data when layout info.xml`s version is less than 0.2

git-svn-id: http://xe-core.googlecode.com/svn/branches/1.5.0@9342 201d5d3c-b55e-5fd7-737f-ddc643e51545
This commit is contained in:
flyskyko 2011-09-26 08:16:42 +00:00
parent 3e6e1d68d6
commit 68f31cb209
3 changed files with 13 additions and 3 deletions

View file

@ -66,7 +66,16 @@
if(!$output->data) return;
// Return xml file informaton after listing up the layout and extra_vars
$layout_info = $this->getLayoutInfo($layout, $output->data, $output->data->layout_type);
//insert in cache
// If deleted layout files, delete layout instance
if (!$layout_info) {
$oLayoutController = &getAdminController('layout');
$oLayoutController->deleteLayout($layout_srl);
debugPrint('delete');
return;
}
//insert in cache
if($oCacheHandler->isSupport()) $oCacheHandler->put($cache_key,$layout_info);
}
return $layout_info;
@ -405,7 +414,7 @@
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);
$buff .= sprintf('$layout_info->extra_var->%s->options["%s"]->val = "%s";', $var->attrs->name, $options[$j]->value->body, $options[$j]->title->body);
}
}
}

View file

@ -68,7 +68,7 @@
</block>
<select cond="$var->type == 'select'" name="{$name}">
<option loop="$var->options => $key, $val" value="{$key}" selected="selected"|cond="$key == $var->value">{$val}</option>
<option loop="$var->options => $key, $val" value="{$key}" selected="selected"|cond="$key == $var->value">{$val->val}</option>
</select>
<block cond="$var->type == 'radio'">