]> git.mxchange.org Git - quix0rs-gnu-social.git/blob - actions/plugindisable.php
Gah and a 302 in the non-exception-handling redirect too
[quix0rs-gnu-social.git] / actions / plugindisable.php
1 <?php
2 /**
3  * StatusNet - the distributed open-source microblogging tool
4  * Copyright (C) 2010, StatusNet, Inc.
5  *
6  * Plugin enable action.
7  *
8  * This program is free software: you can redistribute it and/or modify
9  * it under the terms of the GNU Affero General Public License as published by
10  * the Free Software Foundation, either version 3 of the License, or
11  * (at your option) any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
16  * GNU Affero General Public License for more details.
17  *
18  * You should have received a copy of the GNU Affero General Public License
19  * along with this program.  If not, see <http://www.gnu.org/licenses/>.
20  *
21  * PHP version 5
22  *
23  * @category  Action
24  * @package   StatusNet
25  * @author    Brion Vibber <brion@status.net>
26  * @copyright 2010 StatusNet, Inc.
27  * @license   http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPLv3
28  * @link      http://status.net/
29  */
30
31 if (!defined('STATUSNET')) {
32     exit(1);
33 }
34
35 /**
36  * Plugin enable action.
37  *
38  * (Re)-enables a plugin from the default plugins list.
39  *
40  * Takes parameters:
41  *
42  *    - plugin: plugin name
43  *    - token: session token to prevent CSRF attacks
44  *    - ajax: boolean; whether to return Ajax or full-browser results
45  *
46  * Only works if the current user is logged in.
47  *
48  * @category  Action
49  * @package   StatusNet
50  * @author    Brion Vibber <brion@status.net>
51  * @copyright 2010 StatusNet, Inc.
52  * @license   http://www.fsf.org/licensing/licenses/agpl-3.0.html AGPLv3
53  * @link      http://status.net/
54  */
55 class PluginDisableAction extends PluginEnableAction
56 {
57     /**
58      * Value to save into $config['plugins']['disable-<name>']
59      */
60     protected function overrideValue()
61     {
62         return 1;
63     }
64
65     protected function successShortTitle()
66     {
67         // TRANS: Page title for AJAX form return when a disabling a plugin.
68         return _m('plugin', 'Disabled');
69     }
70
71     protected function successNextForm()
72     {
73         return new EnablePluginForm($this, $this->plugin);
74     }
75 }