set_cell_attributes searches now in sub-templates, which get automaticall loaded

This commit is contained in:
Ralf Becker 2002-09-18 14:15:04 +00:00
parent 0b958e08e3
commit 25377a0679

View File

@ -250,6 +250,8 @@
*/
function set_cell_attribute($name,$attr,$val)
{
//echo "<p>set_cell_attribute(tpl->name=$this->name, name='$name', attr='$attr',val='$val')</p>\n";
reset($this->data);
$n = 0;
while(list($row,$cols) = each($this->data))
@ -261,32 +263,13 @@
$this->data[$row][$col][$attr] = $val;
++$n;
}
if ($cell['type'] == 'template' && (is_object($cell['name']) || $cell['name'][0] != '@'))
{
if (!is_object($cell['name']))
{
$this->data[$row][$col]['name'] = CreateObject('etemplate.etemplate',$cell['name']);
}
}
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)
{
$this->data[$row][$col][$attr] = $val;
++$n;
$n += $this->data[$row][$col]['name']->set_cell_attribute($name,$attr,$val);
}
}
}