]> git.mxchange.org Git - quix0rs-gnu-social.git/blob - plugins/YammerImport/lib/yammerauthverifyform.php
Work in progress on fixing auth... looks like the iframe doesn't work though. Sigh.
[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         $this->out->element('iframe', array('id' => 'yammer-oauth',
69                                             'src' => $this->runner->getAuthUrl()));
70     }
71
72     /**
73      * Action elements
74      *
75      * @return void
76      */
77
78     function formActions()
79     {
80         $this->out->submit('submit', _m('Verify code'), 'submit', null, _m('Verification code'));
81     }
82 }