mirror of
https://github.com/EGroupware/egroupware.git
synced 2024-12-23 07:09:20 +01:00
set_cell_attributes searches now in sub-templates, which get automaticall loaded
This commit is contained in:
parent
0b958e08e3
commit
25377a0679
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user