AdminNotificationSection.php 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. <?php
  2. namespace ModulesGarden\Servers\ProxmoxVps\App\UI\Admin\Product\Sections;
  3. use ModulesGarden\Servers\ProxmoxVps\Core\UI\Interfaces\AdminArea;
  4. use ModulesGarden\Servers\ProxmoxVps\Core\UI\Widget\Forms\Fields\Select;
  5. use ModulesGarden\Servers\ProxmoxVps\Core\UI\Widget\Forms\Fields\Switcher;
  6. use ModulesGarden\Servers\ProxmoxVps\Core\UI\Widget\Forms\Sections\BoxSection;
  7. use ModulesGarden\Servers\ProxmoxVps\Core\UI\Widget\Forms\Sections\HalfPageSection;
  8. class AdminNotificationSection extends BoxSection implements AdminArea
  9. {
  10. protected $id = 'adminNotificationSection';
  11. protected $name = 'adminNotificationSection';
  12. protected $title = 'adminNotificationSection';
  13. /**
  14. * @var HalfPageSection
  15. */
  16. private $leftSection;
  17. /**
  18. * @var HalfPageSection
  19. */
  20. private $rightSection;
  21. public function initContent()
  22. {
  23. $this->leftSection = new HalfPageSection('leftSection');
  24. $this->rightSection = new HalfPageSection('rightSection');
  25. $this->addSection($this->leftSection)
  26. ->addSection($this->rightSection);
  27. $this->initFields();
  28. }
  29. private function initFields()
  30. {
  31. //Service Creation Failed
  32. $field = new Select('customconfigoption[serviceCreationFailedTemplateId]');
  33. $field->setDescription('tip');
  34. $this->leftSection->addField($field);
  35. //To-Do List
  36. $field = new Switcher('customconfigoption[toDoList]');
  37. $field->setDescription('tip');
  38. $this->rightSection->addField($field);
  39. //Upgrade
  40. $field = new Select('customconfigoption[upgradeNotificationTemplateId]');
  41. $field->setDescription('tip');
  42. $this->leftSection->addField($field);
  43. }
  44. }