diff --git a/docs/changelog/7.x.x.txt b/docs/changelog/7.x.x.txt index 70f7932d5..44a96566d 100644 --- a/docs/changelog/7.x.x.txt +++ b/docs/changelog/7.x.x.txt @@ -23,7 +23,8 @@ - Survey editor now keeps survey objects in a scrollable panel to keep buttons always in view. - fixed #10198: Cannot drag assets to new positions on page - fixed #10190: Matrix 2.0 - Strange characters in "Show Ratings" box - - rfe: #10002: User Manager, view User's Account + - rfe: #10002: User Manager, view User's Profile (perlDreamer Consulting) + - rfe: #10073: Account system to be able to return XML/JSON (perlDreamer Consulting) 7.7.3 - fixed #10094: double explanation in thread help diff --git a/lib/WebGUI/Account.pm b/lib/WebGUI/Account.pm index e20cb08ea..73bebe508 100644 --- a/lib/WebGUI/Account.pm +++ b/lib/WebGUI/Account.pm @@ -75,6 +75,22 @@ public uid => my %uid; #------------------------------------------------------------------- +=head2 bare ( [ flag ] ) + +Returns whether or not the Account system should return a method's content +without the layout and style templates. This would normally be used for +returning JSON or XML data out of the account system. + +=head3 flag + +Optionally set bare to be true, or false. + +=cut + +public bare => my %bare; + +#------------------------------------------------------------------- + =head2 store ( [ hashRef ] ) Returns a hash reference attached to this account object that contains arbitrary data. @@ -192,6 +208,9 @@ sub displayContent { my $noStyle = shift; my $session = $self->session; + ##Don't do any templating if we're sending back data like JSON or XML. + return $content if $self->bare; + #Wrap content into the layout my $var = {}; $var->{content} = $content;