plugindisableform.php 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980
  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. public $widgetOpts;
  31. public $scoped;
  32. /**
  33. * ID of the form
  34. *
  35. * @return string ID of the form
  36. */
  37. public function id()
  38. {
  39. return 'plugin-disable-' . $this->plugin;
  40. }
  41. /**
  42. * class of the form
  43. *
  44. * @return string of the form class
  45. */
  46. public function formClass()
  47. {
  48. return 'form_plugin_disable';
  49. }
  50. /**
  51. * Action of the form
  52. *
  53. * @return string URL of the action
  54. */
  55. public function action()
  56. {
  57. return common_local_url(
  58. 'plugindisable',
  59. ['plugin' => $this->plugin]
  60. );
  61. }
  62. /**
  63. * Action elements
  64. *
  65. * @return void
  66. * @throws Exception
  67. */
  68. public function formActions()
  69. {
  70. // TRANS: Plugin admin panel controls
  71. $this->out->submit('submit', _m('plugin', 'Disable'));
  72. }
  73. }