]> git.mxchange.org Git - quix0rs-gnu-social.git/blob - plugins/YammerImport/lib/yammerauthverifyform.php
Ok, got the AJAX clicky-throughs working for yammer auth (if app is already registere...
[quix0rs-gnu-social.git] / plugins / YammerImport / lib / yammerauthverifyform.php
1 <?php
2
3 class YammerAuthVerifyForm extends Form
4 {
5     private $runner;
6
7     function __construct($out, YammerRunner $runner)
8     {
9         parent::__construct($out);
10         $this->runner = $runner;
11     }
12
13     /**
14      * ID of the form
15      *
16      * @return int ID of the form
17      */
18
19     function id()
20     {
21         return 'yammer-auth-verify-form';
22     }
23
24
25     /**
26      * class of the form
27      *
28      * @return string of the form class
29      */
30
31     function formClass()
32     {
33         return 'form_yammer_auth_verify';
34     }
35
36
37     /**
38      * Action of the form
39      *
40      * @return string URL of the action
41      */
42
43     function action()
44     {
45         return common_local_url('yammeradminpanel');
46     }
47
48
49     /**
50      * Legend of the Form
51      *
52      * @return void
53      */
54     function formLegend()
55     {
56         $this->out->element('legend', null, _m('Connect to Yammer'));
57     }
58
59     /**
60      * Data elements of the form
61      *
62      * @return void
63      */
64
65     function formData()
66     {
67         $this->out->input('verify_token', _m('Verification code:'), '', _m("Click through and paste the code it gives you below..."));
68         
69         // iframe would be nice to avoid leaving -- since they don't seem to have callback url O_O
70         /*
71         $this->out->element('iframe', array('id' => 'yammer-oauth',
72                                             'src' => $this->runner->getAuthUrl()));
73         */
74         // yeah, it ignores the callback_url
75         $this->out->element('a',
76             array('href' => $this->runner->getAuthUrl(),
77                   'target' => '_blank'),
78             'clicky click');
79     }
80
81     /**
82      * Action elements
83      *
84      * @return void
85      */
86
87     function formActions()
88     {
89         $this->out->submit('submit', _m('Verify code'), 'submit', null, _m('Verification code'));
90     }
91 }