DeleteForm.php 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. <?php
  2. /* * ********************************************************************
  3. * Wordpress_Manager Product developed. (Dec 11, 2017)
  4. * *
  5. *
  6. * CREATED BY MODULESGARDEN -> http://modulesgarden.com
  7. * CONTACT -> contact@modulesgarden.com
  8. *
  9. *
  10. * This software is furnished under a license and may be used and copied
  11. * only in accordance with the terms of such license and with the
  12. * inclusion of the above copyright notice. This software or any other
  13. * copies thereof may not be provided or otherwise made available to any
  14. * other person. No title to and ownership of the software is hereby
  15. * transferred.
  16. *
  17. *
  18. * ******************************************************************** */
  19. namespace ModulesGarden\ProxmoxAddon\App\UI\ServerGroup\Forms;
  20. use ModulesGarden\ProxmoxAddon\App\UI\ServerGroup\Providers\ServerGroupProvider;
  21. use ModulesGarden\ProxmoxAddon\Core\UI\Interfaces\AdminArea;
  22. use ModulesGarden\ProxmoxAddon\Core\UI\Widget\Forms\BaseForm;
  23. use ModulesGarden\ProxmoxAddon\Core\UI\Widget\Forms\Fields;
  24. /**
  25. * Description of CreateForm
  26. *
  27. * @author Pawel Kopec <pawelk@modulesgarden.com>
  28. */
  29. class DeleteForm extends BaseForm implements AdminArea
  30. {
  31. public function initContent()
  32. {
  33. $this->initIds('deleteForm');
  34. $this->setFormType('delete');
  35. $this->setProvider(new ServerGroupProvider);
  36. $this->initFields();
  37. }
  38. protected function initFields()
  39. {
  40. $this->addField(new Fields\Hidden('id'));
  41. $this->addField(new Fields\Hidden('name'));
  42. $this->addField(new Fields\Hidden('server_id'));
  43. $this->setConfirmMessage('confirmDelete', ["name" => null]);
  44. $this->loadDataToForm();
  45. }
  46. protected function getDefaultActions()
  47. {
  48. return ['delete'];
  49. }
  50. }