From 79b302aae5f6475da5b20b8878134ba5a1809160 Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Wed, 27 Sep 2006 13:09:28 +0000 Subject: [PATCH] - empty cells in a box can now be kept (not optimized away) - fixed not used ro-image for buttons, if set via the content-array --- etemplate/doc/reference.html | 5 +++-- etemplate/inc/class.uietemplate.inc.php | 11 ++++++++--- 2 files changed, 11 insertions(+), 5 deletions(-) diff --git a/etemplate/doc/reference.html b/etemplate/doc/reference.html index bdbc7aeb63..fd04d010e9 100644 --- a/etemplate/doc/reference.html +++ b/etemplate/doc/reference.html @@ -692,11 +692,12 @@ implement only a subset of XUL. Here are the main differences:

vertical or horizontal container for child widgets. This is useful if one needs more widgets or widgets outside the column- / row-order of a grid. HBox or VBox is rendered as Grid/html:table - with only one row or colum. Box is rendered as a html:div containing all child-widgets.
+ with only one row or colum. Box is rendered as a html:div containing all child-widgets. Disabled child-cells are completly left out (no empty cells or rows get generated).

Options in the editor: the number of cells in the box (does NOT need to be set in xml).
orient: horizontal, vertical or none (means h/vbox as expected and no table for boxes) - options: cellpadding,cellspacing of the table + cellpadding,cellspacing: known table-options + keepEmpty: if true, empty cells (lines or rows) are kept, otherwise they are completly removed diff --git a/etemplate/inc/class.uietemplate.inc.php b/etemplate/inc/class.uietemplate.inc.php index 04c32591f8..54e4ba7b1e 100644 --- a/etemplate/inc/class.uietemplate.inc.php +++ b/etemplate/inc/class.uietemplate.inc.php @@ -412,6 +412,7 @@ } else { + //echo "

process_exec($this->name): calling $session_data[method]

\n"; return ExecMethod($session_data['method'],$this->complete_array_merge($session_data['preserv'],$content)); } } @@ -792,6 +793,10 @@ if ((int) $cell['tabindex']) $options .= ' tabindex="'.(int)$cell['tabindex'].'"'; if ($cell['accesskey']) $options .= ' accesskey="'.$this->html->htmlspecialchars($cell['accesskey']).'"'; + if (strchr($cell['size'],'$') || $cell['size']{0} == '@') // expand cell['size'] for the button-disabled-check now + { + $cell['size'] = $this->expand_name($cell['size'],$show_c,$show_row,$content['.c'],$content['.row'],$content); + } if ($cell['disabled'] && $readonlys[$name] !== false || $readonly && $cell['type'] == 'button' && !strstr($cell['size'],',')) { if ($this->rows == 1) { @@ -1360,12 +1365,12 @@ $box_row = 1; $box_col = 'A'; $box_anz = 0; - list($num,$orient) = explode(',',$cell_options); + list($num,$orient,,,$keep_empty) = explode(',',$cell_options); if (!$orient) $orient = $type == 'hbox' ? 'horizontal' : ($type == 'box' ? false : 'vertical'); for ($n = 1; $n <= (int) $num; ++$n) { $h = $this->show_cell($cell[$n],$content,$readonlys,$cname,$show_c,$show_row,$nul,$cl,$path.'/'.$n); - if ($h != '' && $h != ' ') + if ($h != '' && $h != ' ' || $keep_empty) { if ($orient != 'horizontal') { @@ -1640,7 +1645,7 @@ { $value = ''; // blur-values is equal to emtpy } - // echo "

process_show($this->name) $type: $form_name = '$value'

\n"; + //echo "

process_show($this->name) loop was {$GLOBALS['egw_info']['etemplate']['loop']}, $type: $form_name = '$value'

\n"; list($type,$sub) = explode('-',$type); switch ($type) {