git-svn-id: http://xe-core.googlecode.com/svn/trunk@1743 201d5d3c-b55e-5fd7-737f-ddc643e51545

This commit is contained in:
zero 2007-06-22 08:54:34 +00:00
parent c759503063
commit f4953b1b92
15 changed files with 110 additions and 79 deletions

View file

@ -21,6 +21,8 @@
$vars = Context::getRequestVars();
$widget = $vars->selected_widget;
$blank_img_path = "./common/tpl/images/blank.gif";
unset($vars->module);
unset($vars->act);
unset($vars->selected_widget);
@ -33,8 +35,18 @@
}
}
$blank_img_path = "./common/tpl/images/blank.gif";
$widget_code = sprintf('<img src="%s" class="zbxe_widget_output" widget="%s" %s style="width:100px;height:100px;"/>', $blank_img_path, $widget, implode(' ',$attribute));
if($vars->widget_fix_width == 'Y') {
$style = "";
$vars->widget_width = $vars->widget_width - $vars->widget_margin_left - $vars->widget_margin_right;
$style .= sprintf("%s:%spx;", "width", trim($vars->widget_width));
$style .= sprintf("margin:%dpx %dpx %dpx %dpx;", $vars->widget_margin_top, $vars->widget_margin_right,$vars->widget_margin_bottom,$vars->widget_margin_left);
if($vars->widget_position) $style .= sprintf("%s:%s;", "float", trim($vars->widget_position));
$widget_code = sprintf('<img src="%s" class="zbxe_widget_output" widget="%s" %s style="%s" />', $blank_img_path, $widget, implode(' ',$attribute), $style);
} else {
$widget_code = sprintf('<img width="100" height="100" src="%s" class="zbxe_widget_output" widget="%s" %s />', $blank_img_path, $widget, implode(' ',$attribute));
}
debugPrint($widget_code);
// 코드 출력
$this->add('widget_code', $widget_code);