]> git.mxchange.org Git - quix0rs-gnu-social.git/blob - plugins/FBConnect/FBC_XDReceiver.php
Merge branch '0.8.x' into userdesign
[quix0rs-gnu-social.git] / plugins / FBConnect / FBC_XDReceiver.php
1 <?php
2
3 if (!defined('LACONICA')) {
4     exit(1);
5 }
6
7 /*
8  * Generates the cross domain communication channel file
9  * (xd_receiver.html). By generating it we can add some caching
10  * instructions.
11  *
12  * See: http://wiki.developers.facebook.com/index.php/Cross_Domain_Communication_Channel
13  */
14 class FBC_XDReceiverAction extends Action
15 {
16
17     /**
18      * Do we need to write to the database?
19      *
20      * @return boolean true
21      */
22
23     function isReadonly()
24     {
25         return true;
26     }
27
28     /**
29      * Handle a request
30      *
31      * @param array $args Arguments from $_REQUEST
32      *
33      * @return void
34      */
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                         '-//W3C//DTD XHTML 1.0 Strict//EN',
52                         'http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd');
53
54         $language = $this->getLanguage();
55
56         $this->elementStart('html', array('xmlns' => 'http://www.w3.org/1999/xhtml',
57                                           'xml:lang' => $language,
58                                           'lang' => $language));
59         $this->elementStart('head');
60         $this->element('title', null, 'cross domain receiver page');
61         $this->element('script',
62             array('src' =>
63                 'http://static.ak.connect.facebook.com/js/api_lib/v0.4/XdCommReceiver.debug.js',
64                 'type' => 'text/javascript'), '');
65         $this->elementEnd('head');
66         $this->elementStart('body');
67         $this->elementEnd('body');
68
69         $this->elementEnd('html');
70     }
71
72 }
73