noalyss-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Noalyss-commit] [noalyss] 64/119: InPlace_Switch : do not echo , return


From: Dany De Bontridder
Subject: [Noalyss-commit] [noalyss] 64/119: InPlace_Switch : do not echo , return a string instead
Date: Mon, 26 Oct 2020 18:27:22 -0400 (EDT)

sparkyx pushed a commit to branch master
in repository noalyss.

commit b6607f89d7f91c8704e631f6fc95bf7b5b814b99
Author: Dany De Bontridder <danydb@noalyss.eu>
AuthorDate: Thu Oct 8 20:07:59 2020 +0200

    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 77d3953..914ca0f 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('<span style="text-decoration: none;color:%s" 
class="inplace_edit icon" id="%s">', $color,$this->name);
-        echo $icon;
-        echo '</span>';
-        echo <<<EOF
+        $r=sprintf('<span style="text-decoration: none;color:%s" 
class="inplace_edit icon" id="%s">', $color,$this->name);
+        $r.=$icon;
+        $r.= '</span>';
+        $r.=<<<EOF
         <script>
 {$this->name}.onclick=function() {new 
Ajax.Updater({$this->name},'{$this->callback}',{method:"get",parameters:{$this->json},evalScripts:true}
 );
    {$this->jscript} 
    }
 </script>
 EOF;
+    return $r;
     }
     public function get_jscript()
     {



reply via email to

[Prev in Thread] Current Thread [Next in Thread]