move jsencode to trait
authorAlan <alan@roojs.com>
Thu, 29 Feb 2024 05:24:02 +0000 (13:24 +0800)
committerAlan <alan@roojs.com>
Thu, 29 Feb 2024 05:24:02 +0000 (13:24 +0800)
Pman.php

index b3f43df..97b7513 100644 (file)
--- a/Pman.php
+++ b/Pman.php
@@ -382,27 +382,7 @@ class Pman extends HTML_FlexyFramework_Page
         }
         return true;
     }
-    
      
-    
-    function jsencode($v, $header = false)
-    {
-        if ($header) {
-            header("Content-type: text/javascript");
-        }
-        if (function_exists("json_encode")) {
-            $ret=  json_encode($v);
-            if ($ret !== false) {
-                return $ret;
-            }
-        }
-        require_once 'Services/JSON.php';
-        $js = new Services_JSON();
-        return $js->encodeUnsafe($v);
-        
-        
-        
-    }