diff options
author | Robin Millette <millette@controlyourself.ca> | 2009-06-09 15:19:19 -0400 |
---|---|---|
committer | Robin Millette <millette@controlyourself.ca> | 2009-06-09 15:19:19 -0400 |
commit | 207750e75774c823328889cb4102aad6a0b12281 (patch) | |
tree | 51335c05e93194217c90a46b21e5477bba47c378 /plugins/FBConnect/FBC_XDReceiver.php | |
parent | 27af3c67a2a9ea856aa2de041a986d452cce3025 (diff) | |
parent | 388677a6a684754a7dbde13551ab1bffff4d1164 (diff) |
Merge branch '0.8.x' of git@gitorious.org:+laconica-developers/laconica/dev into 0.8.x
Diffstat (limited to 'plugins/FBConnect/FBC_XDReceiver.php')
-rw-r--r-- | plugins/FBConnect/FBC_XDReceiver.php | 73 |
1 files changed, 73 insertions, 0 deletions
diff --git a/plugins/FBConnect/FBC_XDReceiver.php b/plugins/FBConnect/FBC_XDReceiver.php new file mode 100644 index 000000000..57c98b4f1 --- /dev/null +++ b/plugins/FBConnect/FBC_XDReceiver.php @@ -0,0 +1,73 @@ +<?php + +if (!defined('LACONICA')) { + exit(1); +} + +/* + * Generates the cross domain communication channel file + * (xd_receiver.html). By generating it we can add some caching + * instructions. + * + * See: http://wiki.developers.facebook.com/index.php/Cross_Domain_Communication_Channel + */ +class FBC_XDReceiverAction extends Action +{ + + /** + * Do we need to write to the database? + * + * @return boolean true + */ + + function isReadonly() + { + return true; + } + + /** + * Handle a request + * + * @param array $args Arguments from $_REQUEST + * + * @return void + */ + + function handle($args) + { + // Parent handling, including cache check + parent::handle($args); + $this->showPage(); + } + + function showPage() + { + // cache the xd_receiver + header('Cache-Control: max-age=225065900'); + header('Expires:'); + header('Pragma:'); + + $this->startXML('html', + '-//W3C//DTD XHTML 1.0 Strict//EN', + 'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd'); + + $language = $this->getLanguage(); + + $this->elementStart('html', array('xmlns' => 'http://www.w3.org/1999/xhtml', + 'xml:lang' => $language, + 'lang' => $language)); + $this->elementStart('head'); + $this->element('title', null, 'cross domain receiver page'); + $this->element('script', + array('src' => + 'http://static.ak.connect.facebook.com/js/api_lib/v0.4/XdCommReceiver.debug.js', + 'type' => 'text/javascript'), ''); + $this->elementEnd('head'); + $this->elementStart('body'); + $this->elementEnd('body'); + + $this->elementEnd('html'); + } + +} + |