]> git.mxchange.org Git - quix0rs-gnu-social.git/blob - plugins/Facebook/FBC_XDReceiver.php
Merge branch '1.0.x' into schema-x
[quix0rs-gnu-social.git] / plugins / Facebook / FBC_XDReceiver.php
1 <?php
2 /**
3  * @todo Add header and documentation
4  */
5
6 if (!defined('STATUSNET') && !defined('LACONICA')) {
7     exit(1);
8 }
9
10 /*
11  * Generates the cross domain communication channel file
12  * (xd_receiver.html). By generating it we can add some caching
13  * instructions.
14  *
15  * See: http://wiki.developers.facebook.com/index.php/Cross_Domain_Communication_Channel
16  */
17 class FBC_XDReceiverAction extends Action
18 {
19     /**
20      * Do we need to write to the database?
21      *
22      * @return boolean true
23      */
24     function isReadonly()
25     {
26         return true;
27     }
28
29     /**
30      * Handle a request
31      *
32      * @param array $args Arguments from $_REQUEST
33      *
34      * @return void
35      */
36     function handle($args)
37     {
38         // Parent handling, including cache check
39         parent::handle($args);
40         $this->showPage();
41     }
42
43     function showPage()
44     {
45         // cache the xd_receiver
46         header('Cache-Control: max-age=225065900');
47         header('Expires:');
48         header('Pragma:');
49
50         $this->startXML('html');
51
52         $language = $this->getLanguage();
53
54         $this->elementStart('html', array('xmlns' => 'http://www.w3.org/1999/xhtml',
55                                           'xml:lang' => $language,
56                                           'lang' => $language));
57         $this->elementStart('head');
58         $this->element('title', null, 'cross domain receiver page');
59         $this->script('http://static.ak.connect.facebook.com/js/api_lib/v0.4/XdCommReceiver.debug.js');
60         $this->elementEnd('head');
61         $this->elementStart('body');
62         $this->elementEnd('body');
63
64         $this->elementEnd('html');
65     }
66 }