[Jifty-commit] r1777 - in jifty/trunk:
share/web/templates/__jifty/webservices
jifty-commit at lists.jifty.org
jifty-commit at lists.jifty.org
Tue Aug 8 00:34:30 EDT 2006
Author: jesse
Date: Tue Aug 8 00:34:30 2006
New Revision: 1777
Modified:
jifty/trunk/ (props changed)
jifty/trunk/share/web/templates/__jifty/webservices/xml
Log:
r15077 at pinglin: jesse | 2006-08-08 00:33:44 -0400
* Closer to stripping data from our base xml webservices
Modified: jifty/trunk/share/web/templates/__jifty/webservices/xml
==============================================================================
--- jifty/trunk/share/web/templates/__jifty/webservices/xml (original)
+++ jifty/trunk/share/web/templates/__jifty/webservices/xml Tue Aug 8 00:34:30 2006
@@ -68,12 +68,30 @@
# current_user->user_object is itself)
use Scalar::Util qw(blessed);
my $content = $results{$_}->content;
- blessed $content->{$_}
- and ( $content->{$_}->isa("Jifty::DBI::Record")
- or $content->{$_}->isa("Jifty::DBI::Collection") )
- and delete $content->{$_}
- for keys %{$content};
+ sub stripkids {
+ my $top = shift;
+ if ( not ref $top ) { return $top }
+ elsif (
+ blessed($top)
+ and ( $top->isa("Jifty::DBI::Record")
+ or $top->isa("Jifty::DBI::Collection") )
+ )
+ {
+ return undef;
+ } elsif ( ref $top eq 'HASH' ) {
+ foreach my $item ( keys %$top ) {
+ $top->{$item} = stripkids( $top->{$item} );
+ }
+ } elsif ( ref $top eq 'ARRAY' ) {
+ for ( 0 .. $#{$top} ) {
+ $top->[$_] = stripkids( $top->[$_] );
+ }
+ }
+ return $top;
+ }
+
+ $content = stripkids($content);
use XML::Simple;
$writer->raw(XML::Simple::XMLout($content, NoAttr => 1, RootName => "content", NoIndent => 1))
if keys %{$content};
More information about the Jifty-commit
mailing list