]> git.mxchange.org Git - quix0rs-gnu-social.git/blob - plugins/YammerImport/lib/yammerapikeyform.php
More info for a proper, fancy-url lighttpd setup
[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         // TRANS: Form legend for adding details to connect to a remote Yammer API.
57         $this->out->element('legend', null, _m('Yammer API registration'));
58     }
59
60     /**
61      * Data elements of the form
62      *
63      * @return void
64      */
65
66     function formData()
67     {
68         $this->out->hidden('subaction', 'apikey');
69
70         $this->out->elementStart('fieldset');
71
72         $this->out->elementStart('p');
73         // TRANS: Explanation of what needs to be done to connect to a Yammer network.
74         $this->out->text(_m('Before we can connect to your Yammer network, ' .
75                             'you will need to register the importer as an ' .
76                             'application authorized to pull data on your behalf. ' .
77                             'This registration will work only for your own network. ' .
78                             'Follow this link to register the app at Yammer; ' .
79                             'you will be prompted to log in if necessary:'));
80         $this->out->elementEnd('p');
81
82         $this->out->elementStart('p', array('class' => 'magiclink'));
83         $this->out->element('a',
84             array('href' => 'https://www.yammer.com/client_applications/new',
85                   'target' => '_blank'),
86             // TRANS: Link description to a Yammer application registration form.
87             _m('Open Yammer application registration form'));
88         $this->out->elementEnd('p');
89
90         // TRANS: Instructions.
91         $this->out->element('p', array(), _m('Copy the consumer key and secret you are given into the form below:'));
92
93         $this->out->elementStart('ul', array('class' => 'form_data'));
94         $this->out->elementStart('li');
95         // TRANS: Field label for a Yammer consumer key.
96         $this->out->input('consumer_key', _m('Consumer key:'), common_config('yammer', 'consumer_key'));
97         $this->out->elementEnd('li');
98         $this->out->elementStart('li');
99         // TRANS: Field label for a Yammer consumer secret.
100         $this->out->input('consumer_secret', _m('Consumer secret:'), common_config('yammer', 'consumer_secret'));
101         $this->out->elementEnd('li');
102         $this->out->elementEnd('ul');
103
104         // TRANS: Button text for saving a Yammer API registration.
105         $this->out->submit('submit', _m('BUTTON','Save'),
106                            // TRANS: Button title for saving a Yammer API registration.
107                            'submit', null, _m('Save the entered consumer key and consumer secret.'));
108
109         $this->out->elementEnd('fieldset');
110     }
111
112     /**
113      * Action elements
114      *
115      * @return void
116      */
117
118     function formActions()
119     {
120     }
121 }