fixed Call-time pass-by-reference

This commit is contained in:
Ralf Becker 2004-03-09 21:46:25 +00:00
parent 34124b2845
commit 917c0aada9
5 changed files with 25 additions and 15 deletions

View File

@ -524,7 +524,7 @@
{ {
$this->etemplate->xul_io = CreateObject('etemplate.xul_io'); $this->etemplate->xul_io = CreateObject('etemplate.xul_io');
} }
$xul = $this->etemplate->xul_io->export(&$this->etemplate); $xul = $this->etemplate->xul_io->export($this->etemplate);
fwrite($f,$xul); fwrite($f,$xul);
fclose($f); fclose($f);
@ -545,7 +545,7 @@
{ {
$this->etemplate->xul_io = CreateObject('etemplate.xul_io'); $this->etemplate->xul_io = CreateObject('etemplate.xul_io');
} }
$imported = $this->etemplate->xul_io->import(&$this->etemplate,$xul); $imported = $this->etemplate->xul_io->import($this->etemplate,$xul);
$this->etemplate->modified = @filemtime($f); $this->etemplate->modified = @filemtime($f);
$this->etemplate->modified_set = 'xul-import'; $this->etemplate->modified_set = 'xul-import';

View File

@ -234,7 +234,7 @@
echo "<p>unlink(link-id=$unlink,$value[to_app],$value[to_id])</p>\n"; echo "<p>unlink(link-id=$unlink,$value[to_app],$value[to_id])</p>\n";
if (is_array($value['to_id'])) _debug_array($value['to_id']); if (is_array($value['to_id'])) _debug_array($value['to_id']);
} }
$this->link->unlink($unlink,$value['to_app'],&$value['to_id']); $this->link->unlink2($unlink,$value['to_app'],$value['to_id']);
if (is_array($value['to_id'])) if (is_array($value['to_id']))
{ {
$extension_data['to_id'] = $value['to_id']; // else changes from unlink get lost $extension_data['to_id'] = $value['to_id']; // else changes from unlink get lost

View File

@ -370,7 +370,7 @@
{ {
$this->xul_io = CreateObject('etemplate.xul_io'); $this->xul_io = CreateObject('etemplate.xul_io');
} }
$loaded = $this->xul_io->import(&$this,$xml); $loaded = $this->xul_io->import($this,$xml);
if (!is_array($loaded)) if (!is_array($loaded))
{ {

View File

@ -96,7 +96,12 @@
); );
} }
function set_attributes(&$widget,$attr,$val,$spanned='') function set_attributes(&$widget,$attr,$val)
{
$this->set_attributes2($widget,$attr,$val,$dummy);
}
function set_attributes2(&$widget,$attr,$val,&$spanned)
{ {
if ($attr != '') if ($attr != '')
{ {
@ -162,7 +167,7 @@
$embeded = new etemplate($tpl,$etempl->as_array()); $embeded = new etemplate($tpl,$etempl->as_array());
if ($embeded_too) if ($embeded_too)
{ {
$this->etempl2grid($embeded,&$root,$embeded_too); $this->etempl2grid($embeded,$root,$embeded_too);
} }
$cell['size'] = $embeded->name; $cell['size'] = $embeded->name;
unset($embeded); unset($embeded);
@ -181,7 +186,7 @@
$embeded = new etemplate($names[$n],$etempl->as_array()); $embeded = new etemplate($names[$n],$etempl->as_array());
if ($embeded_too) if ($embeded_too)
{ {
$this->etempl2grid($embeded,&$root,$embeded_too); $this->etempl2grid($embeded,$root,$embeded_too);
} }
$grid = new xmlnode('grid'); $grid = new xmlnode('grid');
$grid->set_attribute('id',$embeded->name); $grid->set_attribute('id',$embeded->name);
@ -219,7 +224,7 @@
$embeded = new etemplate(); $embeded = new etemplate();
if ($embeded->read($name=$embeded->expand_name($cell['name'],0,0),'default','default',0,'',$etempl->as_array())) if ($embeded->read($name=$embeded->expand_name($cell['name'],0,0),'default','default',0,'',$etempl->as_array()))
{ {
$this->etempl2grid($embeded,&$root,$embeded_too); $this->etempl2grid($embeded,$root,$embeded_too);
} }
$cell['name'] = $embeded->name; $cell['name'] = $embeded->name;
unset($embeded); unset($embeded);
@ -240,7 +245,7 @@
{ {
$attr = $this->attr2xul[$attr]; $attr = $this->attr2xul[$attr];
} }
$this->set_attributes($attr_widget,$attr,$val,&$spanned); $this->set_attributes2($attr_widget,$attr,$val,$spanned);
} }
if ($child) if ($child)
{ {
@ -331,7 +336,7 @@
$xul_overlay = new xmlnode('overlay'); $xul_overlay = new xmlnode('overlay');
$embeded_too = True; $embeded_too = True;
$this->etempl2grid($etempl,&$xul_overlay,$embeded_too); $this->etempl2grid($etempl,$xul_overlay,$embeded_too);
$doc->add_root($xul_overlay); $doc->add_root($xul_overlay);
$xml = $doc->export_xml(); $xml = $doc->export_xml();
@ -492,7 +497,7 @@
$tab_attr['span'] .= $tab_attr['class'] ? ','.$tab_attr['class'] : ''; $tab_attr['span'] .= $tab_attr['class'] ? ','.$tab_attr['class'] : '';
unset($tab_attr['class']); unset($tab_attr['class']);
$this->add_cell($etempl,$tab_attr,&$box,&$col,$node['level']); $this->add_cell($etempl,$tab_attr,$box,$col,$node['level']);
unset($tab_attr); unset($tab_attr);
} }
break; break;
@ -521,7 +526,7 @@
} }
else else
{ {
$this->add_cell($etempl,$menulist_attr,&$box,&$col,$node['level']); $this->add_cell($etempl,$menulist_attr,$box,$col,$node['level']);
unset($menulist_attr); unset($menulist_attr);
} }
break; break;
@ -536,7 +541,7 @@
$cell = &$box[$node['level']]; $cell = &$box[$node['level']];
$cell['size'] = $cell['anz'] . ($cell['size'] != '' ? ','.$cell['size'] : ''); $cell['size'] = $cell['anz'] . ($cell['size'] != '' ? ','.$cell['size'] : '');
unset($cell['anz']); unset($cell['anz']);
$this->add_cell($etempl,$cell,&$box,&$col,$node['level']); $this->add_cell($etempl,$cell,$box,$col,$node['level']);
unset($box[$node['level']]); unset($box[$node['level']]);
} }
break; break;
@ -595,7 +600,7 @@
{ {
break; break;
} }
$this->add_cell($etempl,$attr,&$box,&$col,$node['level']); $this->add_cell($etempl,$attr,$box,$col,$node['level']);
break; break;
} }
} }

View File

@ -311,10 +311,15 @@
@param $link_id link-id to remove if > 0 @param $link_id link-id to remove if > 0
@param $app,$id,$owner,$app2,$id2 if $link_id <= 0: removes all links matching the non-empty params @param $app,$id,$owner,$app2,$id2 if $link_id <= 0: removes all links matching the non-empty params
@discussion Note: if $link_id != '' and $id is an array: unlink removes links from that array only @discussion Note: if $link_id != '' and $id is an array: unlink removes links from that array only
unlink has to be called with &$id so see the result !!! unlink has to be called with &$id to see the result (depricated) or unlink2 has to be used !!!
@result the number of links deleted @result the number of links deleted
*/ */
function unlink($link_id,$app='',$id='',$owner='',$app2='',$id2='') function unlink($link_id,$app='',$id='',$owner='',$app2='',$id2='')
{
return unlink2($link_id,$app,$id,$owner,$app2,$id2);
}
function unlink2($link_id,$app,&$id,$owner='',$app2='',$id2='')
{ {
if ($link_id < 0) // vfs-link? if ($link_id < 0) // vfs-link?
{ {