GeneralSection.php 4.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495
  1. <?php
  2. namespace ThurData\Servers\KerioEmail\App\UI\Client\Setting\Sections;
  3. use ThurData\Servers\KerioEmail\App\Traits\FormExtendedTrait;
  4. use ThurData\Servers\KerioEmail\App\UI\Admin\Custom\Sections\FreeFieldsSection;
  5. use ThurData\Servers\KerioEmail\Core\UI\Widget\Forms\Fields\Select;
  6. use ThurData\Servers\KerioEmail\Core\UI\Widget\Forms\Fields\Text;
  7. use ThurData\Servers\KerioEmail\Core\UI\Widget\Forms\Sections\InputGroup;
  8. use ThurData\Servers\KerioEmail\Core\UI\Widget\Forms\Fields\InputGroupElements;
  9. use ThurData\Servers\KerioEmail\Core\UI\Widget\Forms\Fields\Hidden;
  10. use function ThurData\Servers\KerioEmail\Core\Helper\di;
  11. /**
  12. *
  13. * Created by PhpStorm.
  14. * User: ThurData
  15. * Date: 12.11.19
  16. * Time: 13:39
  17. * Class GeneralSection
  18. */
  19. class GeneralSection extends FreeFieldsSection
  20. {
  21. protected $id = 'generalSection';
  22. protected $name = 'generalSection';
  23. use FormExtendedTrait;
  24. public function initContent()
  25. {
  26. $this->generateDoubleSection([new Text('firstname'), new Text('lastname')]);
  27. $email = new InputGroup('usernameGroup');
  28. $email->addTextField('username', false, true);
  29. $email->addInputAddon('emailSign', false, '@');
  30. $email->addInputComponent((new InputGroupElements\Text('domain'))->addHtmlAttribute('readonly','true'));
  31. $this->addSection($email);
  32. $this->generateDoubleSection([new Text('display_name'), new Select('status')]);
  33. $quota = new Text('quota');
  34. $quota->setDescription('description');
  35. $quota->addValidator(new Decimal(0));
  36. $this->generateDoubleSection([$quota, new Select('unit')]);
  37. $passwd = new Password('password');
  38. $passwd->setDescription('description');
  39. $passwd->addValidator(new PasswordsValidator());
  40. $passwd->notEmpty();
  41. $repPasswd = (new Password('repeat_password'))->addValidator(new RepeatPasswordValidator());
  42. $repPasswd->notEmpty();
  43. $this->generateDoubleSection([$passwd, $repPasswd]);
  44. /* di('lang')->absoluteT('dnsinfomessage') ? $message = di('lang')->absoluteT('dnsinfomessage') :
  45. $message = 'DNS Informations for <b id="infoalertmaildomain" class="lu-alert--lg"></b>
  46. <div id="addalertheader" class="lu-alert--lg"></div>
  47. <div id="addmxmessage"></div>
  48. <div id="addspfmessage"></div>
  49. <div id="adddmarcmessage"></div>
  50. <div id="adddkimmessage"></div><br><br>
  51. <div id="addalertfooter"></div>
  52. <div class="lu-form-group">
  53. <label class="lu-form-label">DNS Record Type</label>
  54. <div class="lu-input-group" style="background:#eeeeee">
  55. <input type="text" value="ThurData Recommended" readonly="readonly" class="lu-form-control" style="">
  56. <div class="lu-input-group__addon">&hArr;</div>
  57. <input type="text" value="Current Value" readonly="readonly" class="lu-form-control" style="">
  58. </div>
  59. </div>';
  60. $this->addInternalAlert($message, null, 100);
  61. $row = new InputGroup('MX');
  62. $row->addInputComponent((new InputGroupElements\Text('mxthurdata'))->addHtmlAttribute('readonly','true'));
  63. $row->addInputAddon('', false, '&hArr;');
  64. $row->addInputComponent((new InputGroupElements\Text('mxactive'))->addHtmlAttribute('readonly','true'));
  65. $this->addSection($row);
  66. $row = new InputGroup('SPF');
  67. $row->addInputComponent((new InputGroupElements\Text('spfthurdata'))->addHtmlAttribute('readonly','true'));
  68. $row->addInputAddon('', false, '&hArr;');
  69. $row->addInputComponent((new InputGroupElements\Text('spf'))->addHtmlAttribute('readonly','true'));
  70. $this->addSection($row);
  71. $row = new InputGroup('DMARC');
  72. $row->addInputComponent((new InputGroupElements\Text('dmarcthurdata'))->addHtmlAttribute('readonly','true'));
  73. $row->addInputAddon('', false, '&hArr;');
  74. $row->addInputComponent((new InputGroupElements\Text('dmarc'))->addHtmlAttribute('readonly','true'));
  75. $this->addSection($row);
  76. $row = new InputGroup('DKIM');
  77. $row->addInputComponent((new InputGroupElements\Text('dkimthurdata'))->addHtmlAttribute('readonly','true'));
  78. $row->addInputAddon('', false, '&hArr;');
  79. $row->addInputComponent((new InputGroupElements\Text('dkim'))->addHtmlAttribute('readonly','true'));
  80. $this->addSection($row);
  81. $this->generateDoubleSection([new Hidden('infomaildomain'), new Hidden('id')]);
  82. $this->generateDoubleSection([new Hidden('selfdns'), new Hidden('dnsok')]); */
  83. }
  84. }