]> git.mxchange.org Git - quix0rs-gnu-social.git/blob - plugins/YammerImport/lib/yammerapikeyform.php
Yammer import API keys can now be overridden by the admin.
[quix0rs-gnu-social.git] / plugins / YammerImport / lib / yammerapikeyform.php
1 <?php
2
3 class YammerApikeyForm extends Form
4 {
5     private $runner;
6
7     function __construct($out)
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-apikey-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_apikey form_settings';
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('Yammer API registration'));
57     }
58
59     /**
60      * Data elements of the form
61      *
62      * @return void
63      */
64
65     function formData()
66     {
67         $this->out->hidden('subaction', 'apikey');
68
69         $this->out->elementStart('fieldset');
70
71         $this->out->elementStart('p');
72         $this->out->text(_m('Before we can connect to your Yammer network, ' .
73                             'you will need to register the importer as an ' .
74                             'application authorized to pull data on your behalf. ' .
75                             'This registration will work only for your own network. ' .
76                             'Follow this link to register the app at Yammer; ' .
77                             'you will be prompted to log in if necessary:'));
78         $this->out->elementEnd('p');
79
80         $this->out->elementStart('p', array('class' => 'magiclink'));
81         $this->out->element('a',
82             array('href' => 'https://www.yammer.com/client_applications/new',
83                   'target' => '_blank'),
84             _m('Open Yammer application registration form'));
85         $this->out->elementEnd('p');
86
87         $this->out->element('p', array(), _m('Copy the consumer key and secret you are given into the form below:'));
88
89         $this->out->elementStart('ul', array('class' => 'form_data'));
90         $this->out->elementStart('li');
91         $this->out->input('consumer_key', _m('Consumer key:'), common_config('yammer', 'consumer_key'));
92         $this->out->elementEnd('li');
93         $this->out->elementStart('li');
94         $this->out->input('consumer_secret', _m('Consumer secret:'), common_config('yammer', 'consumer_secret'));
95         $this->out->elementEnd('li');
96         $this->out->elementEnd('ul');
97
98         $this->out->submit('submit', _m('Save'), 'submit', null, _m('Save these consumer keys'));
99
100         $this->out->elementEnd('fieldset');
101     }
102
103     /**
104      * Action elements
105      *
106      * @return void
107      */
108
109     function formActions()
110     {
111     }
112 }