]> git.mxchange.org Git - quix0rs-gnu-social.git/blob - lib/pluginenableform.php
Cannot use NoticeListemItem as type-hint as NoticeListItemAdapter exists.
[quix0rs-gnu-social.git] / lib / pluginenableform.php
1 <?php
2 /**
3  * StatusNet, the distributed open-source microblogging tool
4  *
5  * Form for enabling/disabling plugins
6  *
7  * PHP version 5
8  *
9  * LICENCE: This program is free software: you can redistribute it and/or modify
10  * it under the terms of the GNU Affero General Public License as published by
11  * the Free Software Foundation, either version 3 of the License, or
12  * (at your option) any later version.
13  *
14  * This program is distributed in the hope that it will be useful,
15  * but WITHOUT ANY WARRANTY; without even the implied warranty of
16  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17  * GNU Affero General Public License for more details.
18  *
19  * You should have received a copy of the GNU Affero General Public License
20  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
21  *
22  * @category  Form
23  * @package   StatusNet
24  * @copyright 2010 StatusNet, Inc.
25  * @license   http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
26  * @link      http://status.net/
27  */
28
29 if (!defined('STATUSNET') && !defined('LACONICA')) {
30     exit(1);
31 }
32
33 require_once INSTALLDIR.'/lib/form.php';
34
35 /**
36  * Form for joining a group
37  *
38  * @category Form
39  * @package  StatusNet
40  * @author   Brion Vibber <brion@status.net>
41  * @license  http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
42  * @link     http://status.net/
43  *
44  * @see      PluginDisableForm
45  */
46
47 class PluginEnableForm extends Form
48 {
49     /**
50      * Plugin to enable/disable
51      */
52
53     var $plugin = null;
54
55     /**
56      * Constructor
57      *
58      * @param HTMLOutputter $out    output channel
59      * @param string        $plugin plugin to enable/disable
60      */
61
62     function __construct($out=null, $plugin=null)
63     {
64         parent::__construct($out);
65
66         $this->plugin = $plugin;
67     }
68
69     /**
70      * ID of the form
71      *
72      * @return string ID of the form
73      */
74
75     function id()
76     {
77         return 'plugin-enable-' . $this->plugin;
78     }
79
80     /**
81      * class of the form
82      *
83      * @return string of the form class
84      */
85
86     function formClass()
87     {
88         return 'form_plugin_enable';
89     }
90
91     /**
92      * Action of the form
93      *
94      * @return string URL of the action
95      */
96
97     function action()
98     {
99         return common_local_url('pluginenable',
100                                 array('plugin' => $this->plugin));
101     }
102
103     /**
104      * Action elements
105      *
106      * @return void
107      */
108
109     function formActions()
110     {
111         // TRANS: Plugin admin panel controls
112         $this->out->submit('submit', _m('plugin', 'Enable'));
113     }
114 }