Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

All other Modules /

Discuss all other Modules here.

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

JSON <-> Flash Integration with JSONDataFormatter


Reply


2 Posts   1119 Views

Avatar
joninjas

Community Member, 32 Posts

14 December 2010 at 8:43am

Edited: 14/12/2010 8:43am

Thanks for your help! I can now pass a JSON object to the flash.swf, really handy.

But a problem still exists:
[url]http://www.depot43.ch/silverflash/flashinhalte/textfelder/textfeld1/jsonausgabe[/url] only displays with the variables from the TextFeldangabe table when I'm logged in the backend. Would there be a possibility to log in a readonly user automatically in the controller or something like that??

class TextFeldPage_Controller extends Page_Controller {

public function jsonausgabe() {
$data1 = DataObject::get("TextFeldangabe","TextFeldangabe.Titel='$this->URLSegment'");
$f1 = new JSONDataFormatter();
return $f1->convertDataObjectSet($data1);
}

}

Thanks for your help mates!!!
JoNinjas

Avatar
spierala

Community Member, 80 Posts

18 January 2013 at 3:54am

Edited: 18/01/2013 3:56am

hey!
old post, but still I just came to the solution and maybe someone else wants to know it :)
make sure your dataobjects can be viewed for non-admins like this:

public function canView($member = null) {
return true;
}