plugindisable.php 1.8 KB

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