plugindisableform.php 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677
  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. * Form for disabling a plugin
  19. *
  20. * @category Form
  21. * @package StatusNet
  22. * @author Brion Vibber <brion@status.net>
  23. * @license http://www.fsf.org/licensing/licenses/agpl-3.0.html GNU Affero General Public License version 3.0
  24. * @link http://status.net/
  25. *
  26. * @see PluginEnableForm
  27. */
  28. class PluginDisableForm extends PluginEnableForm
  29. {
  30. /**
  31. * ID of the form
  32. *
  33. * @return string ID of the form
  34. */
  35. public function id()
  36. {
  37. return 'plugin-disable-' . $this->plugin;
  38. }
  39. /**
  40. * class of the form
  41. *
  42. * @return string of the form class
  43. */
  44. public function formClass()
  45. {
  46. return 'form_plugin_disable';
  47. }
  48. /**
  49. * Action of the form
  50. *
  51. * @return string URL of the action
  52. */
  53. public function action()
  54. {
  55. return common_local_url(
  56. 'plugindisable',
  57. ['plugin' => $this->plugin]
  58. );
  59. }
  60. /**
  61. * Action elements
  62. *
  63. * @return void
  64. * @throws Exception
  65. */
  66. public function formActions()
  67. {
  68. // TRANS: Plugin admin panel controls
  69. $this->out->submit('submit', _m('plugin', 'Disable'));
  70. }
  71. }