From 7cc61c1ba44f4ae6ecbabe25285a66cde12669db Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Sat, 21 May 2005 07:41:09 +0000 Subject: [PATCH] for embeded templates propagate the CSS class to the template, helps the extension a lot, as one can specify a class for the extension and the extension automatic use it in the template used to render the extension --- etemplate/inc/class.uietemplate.inc.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/etemplate/inc/class.uietemplate.inc.php b/etemplate/inc/class.uietemplate.inc.php index 4f2427e543..791761f33c 100644 --- a/etemplate/inc/class.uietemplate.inc.php +++ b/etemplate/inc/class.uietemplate.inc.php @@ -584,7 +584,7 @@ { $options[1] = ''; // set height in div only } - $html = $this->html->table($rows,$this->html->formatOptions(/*$grid['size']*/$options,'width,height,border,class,cellspacing,cellpadding'). + $html = $this->html->table($rows,$this->html->formatOptions($options,'width,height,border,class,cellspacing,cellpadding'). $this->html->formatOptions($grid['span'],',class')/*TEST-RB,$no_table_tr*/); if (!empty($overflow)) { @@ -1009,6 +1009,13 @@ { $cell['obj']->onclick_proxy = $this->onclick_proxy ? $this->onclick_proxy : $this->name.':'.$this->version.':'.$path; } + // propagate the CSS class to the template + if ($class) + { + $grid_size = array_pad(explode(',',$cell['obj']->size),4,''); + $grid_size[3] = ($grid_size[3] ? $grid_size[3].' ' : '') . $class; + $cell['obj']->size = implode(',',$grid_size); + } $html = $cell['obj']->show($content,$this->sel_options,$readonlys,$cname,$show_c,$show_row); break; case 'select': // size:[linesOnMultiselect|emptyLabel]