From b6607f89d7f91c8704e631f6fc95bf7b5b814b99 Mon Sep 17 00:00:00 2001 From: Dany De Bontridder Date: Thu, 8 Oct 2020 20:07:59 +0200 Subject: [PATCH] InPlace_Switch : do not echo , return a string instead --- include/lib/inplace_switch.class.php | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/include/lib/inplace_switch.class.php b/include/lib/inplace_switch.class.php index 77d395331..914ca0fe2 100644 --- a/include/lib/inplace_switch.class.php +++ b/include/lib/inplace_switch.class.php @@ -70,16 +70,17 @@ class Inplace_Switch throw new Exception(_("Invalide value")); } - printf('', $color,$this->name); - echo $icon; - echo ''; - echo <<', $color,$this->name); + $r.=$icon; + $r.= ''; + $r.=<< {$this->name}.onclick=function() {new Ajax.Updater({$this->name},'{$this->callback}',{method:"get",parameters:{$this->json},evalScripts:true} ); {$this->jscript} } EOF; + return $r; } public function get_jscript() {