From 5c87020ebb81ff4df930598fd8a985e695599303 Mon Sep 17 00:00:00 2001 From: erickson Date: Wed, 21 Sep 2005 19:29:10 +0000 Subject: [PATCH] moved JSON code here git-svn-id: svn://svn.open-ils.org/ILS/trunk@1850 dcc99617-32d9-48b4-a31d-7c20da2025e4 --- .../OpenILS/Template/Plugin/WebUtils.pm | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/Open-ILS/src/perlmods/OpenILS/Template/Plugin/WebUtils.pm b/Open-ILS/src/perlmods/OpenILS/Template/Plugin/WebUtils.pm index 6637e55a6d..2fe9b0813a 100644 --- a/Open-ILS/src/perlmods/OpenILS/Template/Plugin/WebUtils.pm +++ b/Open-ILS/src/perlmods/OpenILS/Template/Plugin/WebUtils.pm @@ -8,6 +8,7 @@ use OpenSRF::AppSession; use OpenSRF::System; use XML::LibXML; use OpenSRF::Utils::SettingsParser; +use JSON; sub new { my ($class) = @_; @@ -23,5 +24,21 @@ sub XML2perl { } +sub perl2JSON { + my( $self, $perl ) = @_; + return JSON->perl2JSON($perl); +} + +sub JSON2perl { + my( $self, $perl ) = @_; + return JSON->JSON2perl($perl); +} + +sub perl2prettyJSON { + my( $self, $perl ) = @_; + return JSON->perl2prettyJSON($perl); +} + + 1; -- 2.43.2