]> git.mxchange.org Git - quix0rs-gnu-social.git/blob - plugins/Blacklist/forms/blacklistadminpanel.php
Avoid excessive remote requests on oEmbed lookups
[quix0rs-gnu-social.git] / plugins / Blacklist / forms / blacklistadminpanel.php
1 <?php
2
3 if (!defined('GNUSOCIAL')) { exit(1); }
4
5 /**
6  * Admin panel form for blacklist panel
7  *
8  * @category Admin
9  * @package  StatusNet
10  * @author   Evan Prodromou <evan@status.net>
11  * @license  http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPLv3
12  * @link     http://status.net/
13  */
14 class BlacklistAdminPanelForm extends Form
15 {
16     /**
17      * ID of the form
18      *
19      * @return string ID
20      */
21     function id()
22     {
23         return 'blacklistadminpanel';
24     }
25
26     /**
27      * Class of the form
28      *
29      * @return string class
30      */
31     function formClass()
32     {
33         return 'form_settings';
34     }
35
36     /**
37      * Action we post to
38      *
39      * @return string action URL
40      */
41     function action()
42     {
43         return common_local_url('blacklistadminpanel');
44     }
45
46     /**
47      * Show the form controls
48      *
49      * @return void
50      */
51     function formData()
52     {
53         $this->out->elementStart('ul', 'form_data');
54
55         $this->out->elementStart('li');
56
57         $nickPatterns = Nickname_blacklist::getPatterns();
58
59         // TRANS: Field label in blacklist plugin administration panel.
60         $this->out->textarea('blacklist-nicknames', _m('Nicknames'),
61                              implode("\r\n", $nickPatterns),
62                              // TRANS: Field title in blacklist plugin administration panel.
63                              _m('Patterns of nicknames to block, one per line.'));
64         $this->out->elementEnd('li');
65
66         $urlPatterns = Homepage_blacklist::getPatterns();
67
68         $this->out->elementStart('li');
69         // TRANS: Field label in blacklist plugin administration panel.
70         $this->out->textarea('blacklist-urls', _m('URLs'),
71                              implode("\r\n", $urlPatterns),
72                              // TRANS: Field title in blacklist plugin administration panel.
73                              _m('Patterns of URLs to block, one per line.'));
74         $this->out->elementEnd('li');
75
76         $this->out->elementEnd('ul');
77     }
78
79     /**
80      * Buttons for submitting
81      *
82      * @return void
83      */
84     function formActions()
85     {
86         $this->out->submit('submit',
87                            // TRANS: Button text in blacklist plugin administration panel to save settings.
88                            _m('BUTTON','Save'),
89                            'submit',
90                            null,
91                            // TRANS: Button title in blacklist plugin administration panel to save settings.
92                            _m('Save site settings.'));
93     }
94 }