GeneralSection.php 2.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. <?php
  2. namespace ThurData\Servers\KerioEmail\App\UI\Client\Ressource\Sections;
  3. use ThurData\Servers\KerioEmail\App\Libs\Product\ProductManager;
  4. use ThurData\Servers\KerioEmail\App\Libs\Kerio\Components\Api\Soap\Repository\ClassOfServices;
  5. use ThurData\Servers\KerioEmail\App\Traits\FormExtendedTrait;
  6. use ThurData\Servers\KerioEmail\App\UI\Admin\Custom\Sections\FreeFieldsSection;
  7. use ThurData\Servers\KerioEmail\App\Validators\PasswordsValidator;
  8. use ThurData\Servers\KerioEmail\App\Validators\RepeatPasswordValidator;
  9. use ThurData\Servers\KerioEmail\Core\UI\Widget\Forms\Fields\Hidden;
  10. use ThurData\Servers\KerioEmail\Core\UI\Widget\Forms\Fields\Password;
  11. use ThurData\Servers\KerioEmail\Core\UI\Widget\Forms\Fields\Select;
  12. use ThurData\Servers\KerioEmail\Core\UI\Widget\Forms\Fields\Text;
  13. use ThurData\Servers\KerioEmail\Core\UI\Widget\Forms\Fields\Switcher;
  14. use ThurData\Servers\KerioEmail\Core\UI\Widget\Forms\Fields\Number;
  15. use ThurData\Servers\KerioEmail\Core\UI\Widget\Forms\Sections\InputGroup;
  16. use ThurData\Servers\KerioEmail\Core\UI\Widget\Forms\Fields\InputGroupElements;
  17. /**
  18. *
  19. * Created by PhpStorm.
  20. * User: ThurData
  21. * Date: 12.11.19
  22. * Time: 13:39
  23. * Class GeneralSection
  24. */
  25. class GeneralSection extends FreeFieldsSection
  26. {
  27. protected $id = 'generalSection';
  28. protected $name = 'generalSection';
  29. use FormExtendedTrait;
  30. public function initContent()
  31. {
  32. /**
  33. * hosting id
  34. */
  35. $hid = $this->getRequestValue('id');
  36. /**
  37. * product manager allow to check product settings
  38. */
  39. $productManager = new ProductManager();
  40. $productManager->loadByHostingId($hid);
  41. $email = new InputGroup('usernameGroup');
  42. $email->addTextField('name', false, true);
  43. $email->addInputAddon('emailSign', false, '@');
  44. $email->addInputComponent((new InputGroupElements\Text('domain'))->addHtmlAttribute('readonly','true'));
  45. $this->addSection($email);
  46. $this->generateDoubleSection([new Text('description'), new Select('type')]);
  47. $this->generateDoubleSection([new Select('manager'), new Select('status')]);
  48. }
  49. }