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()
{