From 25377a0679c2efd0e191c095cb5acaea1c69370e Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Wed, 18 Sep 2002 14:15:04 +0000 Subject: [PATCH] set_cell_attributes searches now in sub-templates, which get automaticall loaded --- etemplate/inc/class.boetemplate.inc.php | 33 ++++++------------------- 1 file changed, 8 insertions(+), 25 deletions(-) diff --git a/etemplate/inc/class.boetemplate.inc.php b/etemplate/inc/class.boetemplate.inc.php index 66da2d4660..3c76e0293a 100644 --- a/etemplate/inc/class.boetemplate.inc.php +++ b/etemplate/inc/class.boetemplate.inc.php @@ -250,6 +250,8 @@ */ function set_cell_attribute($name,$attr,$val) { + //echo "

set_cell_attribute(tpl->name=$this->name, name='$name', attr='$attr',val='$val')

\n"; + reset($this->data); $n = 0; while(list($row,$cols) = each($this->data)) @@ -261,32 +263,13 @@ $this->data[$row][$col][$attr] = $val; ++$n; } - } - } - reset($this->data); - - return $n; - } - - /*! - @function set_cell_attribute - @syntax set_cell_attribute( $name,$attr,$val ) - @author ralfbecker - @abstract set an attribute in a named cell - @result the number of changed cells - */ - function set_cell_attribute($name,$attr,$val) - { - reset($this->data); - $n = 0; - while(list($row,$cols) = each($this->data)) - { - while(list($col,$cell) = each($cols)) - { - if ($cell['name'] == $name) + if ($cell['type'] == 'template' && (is_object($cell['name']) || $cell['name'][0] != '@')) { - $this->data[$row][$col][$attr] = $val; - ++$n; + if (!is_object($cell['name'])) + { + $this->data[$row][$col]['name'] = CreateObject('etemplate.etemplate',$cell['name']); + } + $n += $this->data[$row][$col]['name']->set_cell_attribute($name,$attr,$val); } } }