From fd13a7416259e9a63908e1646c8ac7233a77c16f Mon Sep 17 00:00:00 2001 From: Ralf Becker Date: Thu, 16 Jun 2005 21:32:07 +0000 Subject: [PATCH] quitent a warning, which happens if readonly --- etemplate/inc/class.link_widget.inc.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/etemplate/inc/class.link_widget.inc.php b/etemplate/inc/class.link_widget.inc.php index 7d83965ee7..cca133639b 100644 --- a/etemplate/inc/class.link_widget.inc.php +++ b/etemplate/inc/class.link_widget.inc.php @@ -88,8 +88,10 @@ */ function pre_process($name,&$value,&$cell,&$readonlys,&$extension_data,&$tmpl) { + if ($cell['type'] == 'link-to' && ($cell['readonly'] || $readonlys)) { + //echo "

link-to is readonly, cell=".print_r($cell,true).", readonlys=".print_r($readonlys)."

\n"; // readonly ==> omit the whole widget $cell = $tmpl->empty_cell(); return; @@ -121,6 +123,7 @@ } if ($this->debug) { + echo "

link_widget::pre_process($name,$value,".print_r($cell,true).",$readonlys,,)

\n"; echo "

start: $cell[type][$name]::pre_process: value ="; _debug_array($value); echo "extension_data[$cell[type]][$name] ="; _debug_array($extension_data); } @@ -235,6 +238,8 @@ */ function post_process($name,&$value,&$extension_data,&$loop,&$tmpl,$value_in) { + //echo "

link_widget::post_process('$name',value=".print_r($value,true).",ext=".print_r($extension_data,true).",$loop,,value_in=".print_r($value_in,true)."

\n"; + $buttons = array('search','create','new','upload','attach'); while (!$button && list(,$bname) = each($buttons)) { @@ -247,7 +252,7 @@ } unset($value[$button]); - $value = array_merge($extension_data,$value); + $value = array_merge($extension_data,(array) $value); if ($button && $this->debug) { @@ -311,7 +316,7 @@ case 'unlink': if ($this->debug) { - echo "

unlink(link-id=$unlink,$value[to_app],$value[to_id])

\n"; + //echo "

unlink(link-id=$unlink,$value[to_app],$value[to_id])

\n"; if (is_array($value['to_id'])) _debug_array($value['to_id']); } $this->link->unlink2($unlink,$value['to_app'],$value['to_id']);