updated webgui to run with Config::JSON 2.04

This commit is contained in:
JT Smith 2008-01-25 05:10:33 +00:00
parent fb434a8b3a
commit 34fd8c9245
20 changed files with 56 additions and 51 deletions

View file

@ -19,7 +19,7 @@ use base 'WebGUI::Asset::File::Image';
use Carp qw( carp croak );
use Image::ExifTool qw( :Public );
use JSON;
use JSON qw/ to_json from_json /;
use Tie::IxHash;
use WebGUI::DateTime;
@ -439,7 +439,7 @@ sub getTemplateVars {
}
### Format exif vars
my $exif = jsonToObj( delete $var->{exifData} );
my $exif = from_json( delete $var->{exifData} );
$exif = ImageInfo( $self->getStorageLocation->getPath( $self->get("filename") ) );
for my $tag ( keys %$exif ) {
# Hash of exif_tag => value
@ -679,9 +679,8 @@ sub updateExifDataFromFile {
return undef;
my $info = ImageInfo( $storage->getPath( $self->get('filename') ) );
use Data::Dumper; $self->session->errorHandler->info( Dumper $info );
$self->update({
exifData => objToJson( $info ),
exifData => to_json( $info ),
});
}

View file

@ -2,8 +2,6 @@ package WebGUI::Asset::Wobject::Calendar;
use strict;
our $VERSION = "0.0.0";
####################################################################
# WebGUI is Copyright 2001-2007 Plain Black Corporation.
####################################################################
@ -26,7 +24,7 @@ use WebGUI::DateTime;
use base 'WebGUI::Asset::Wobject';
use DateTime;
use JSON;
use JSON qw/to_json/;
=head1 Name
@ -553,7 +551,7 @@ ENDHTML
my $feeds = $self->getFeeds();
$tab->raw('<script type="text/javascript">'."\n");
for my $feedId (keys %$feeds) {
$tab->raw("FeedsManager.addFeed('feeds','".$feedId."',".objToJson($feeds->{$feedId}).");\n");
$tab->raw("FeedsManager.addFeed('feeds','".$feedId."',".to_json($feeds->{$feedId}).");\n");
}
$tab->raw('</script>');

View file

@ -18,7 +18,7 @@ use strict;
use base 'WebGUI::Asset::Wobject';
use Tie::IxHash;
use WebGUI::HTMLForm;
use JSON;
use JSON qw/ to_json /;
use Digest::MD5;
use WebGUI::Workflow::Instance;
use WebGUI::Cache;
@ -952,7 +952,7 @@ sub getBadgeSelector {
};
}
$js = '<script type="text/javascript">
var badges = '.objToJson(\%badgeJS,{autoconv=>0, skipinvalid=>1}).';
var badges = '.to_json(\%badgeJS).';
</script>';
%options = (%options,%{$badges});
$output .= WebGUI::Form::selectBox($self->session,{

View file

@ -192,7 +192,7 @@ sub freezeGraphConfig {
my $self = shift;
my $obj = shift;
return JSON::objToJson($obj);
return JSON::to_json($obj);
}
@ -403,7 +403,7 @@ sub thawGraphConfig {
my $self = shift;
my $string = shift;
return JSON::jsonToObj($string);
return JSON::from_json($string);
}
#-------------------------------------------------------------------