fixed 10640, 10639, 10625: Map point save HTML/JS

This commit is contained in:
Doug Bell 2009-08-20 18:51:39 +00:00
parent 2bbf81417b
commit a0d3eeaac8
7 changed files with 26 additions and 6 deletions

View file

@ -296,6 +296,10 @@ sub getTemplateVarsEditForm {
;
$var->{ form_footer } = WebGUI::Form::formFooter( $session );
$var->{ form_save } = WebGUI::Form::submit( $session, {
name => "save",
} );
# Stuff from this class's definition
my $definition = __PACKAGE__->definition($session)->[0]->{properties};
for my $key ( keys %{$definition} ) {

View file

@ -16,6 +16,7 @@ use strict;
use Tie::IxHash;
use WebGUI::International;
use WebGUI::Utility;
use HTML::Entities qw(encode_entities);
use base 'WebGUI::Asset::Wobject';
# To get an installer for your wobject, add the Installable AssetAspect
@ -520,6 +521,8 @@ sub www_ajaxEditPointSave {
my $form = $self->session->form;
my $i18n = WebGUI::International->new( $session, 'Asset_Map' );
# We're returning as HTML because application/json causes download pop-up
# and text/plain causes <pre>...</pre> in firefox
$session->http->setMimeType("text/html");
$session->log->preventDebugOutput;
@ -547,7 +550,8 @@ sub www_ajaxEditPointSave {
$asset->requestAutoCommit;
}
return JSON->new->encode($asset->getMapInfo);
# Encode entities because we're returning as HTML
return encode_entities( JSON->new->encode($asset->getMapInfo) );
}
#-------------------------------------------------------------------