InfoForm.php 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384
  1. <?php
  2. namespace ThurData\Servers\KerioEmail\App\UI\Client\Setting\Forms;
  3. use ThurData\Servers\KerioEmail\core\UI\Traits\Alerts;
  4. use ThurData\Servers\KerioEmail\App\Traits\FormExtendedTrait;
  5. use ThurData\Servers\KerioEmail\Core\UI\Traits\FormDataProvider;
  6. use ThurData\Servers\KerioEmail\App\UI\Admin\Custom\Forms\SortedFieldForm;
  7. use ThurData\Servers\KerioEmail\App\UI\Client\Setting\Providers\InfoSettingDataProvider;
  8. use ThurData\Servers\KerioEmail\Core\UI\Interfaces\ClientArea;
  9. use ThurData\Servers\KerioEmail\Core\UI\Widget\Forms\Fields\Hidden;
  10. use ThurData\Servers\KerioEmail\Core\UI\Widget\Forms\Fields\Select;
  11. use ThurData\Servers\KerioEmail\Core\UI\Widget\Forms\Fields\Text;
  12. use ThurData\Servers\KerioEmail\Core\UI\Widget\Forms\FormConstants;
  13. use ThurData\Servers\KerioEmail\Core\UI\Widget\Forms\BaseForm;
  14. use ThurData\Servers\KerioEmail\Core\UI\Widget\Forms\Sections\InputGroup;
  15. use ThurData\Servers\KerioEmail\Core\UI\Widget\Forms\Fields\InputGroupElements;
  16. use ThurData\Servers\KerioEmail\Core\UI\Widget\Forms\Sections\BoxSection;
  17. use function ThurData\Servers\KerioEmail\Core\Helper\di;
  18. class InfoForm extends BaseForm implements ClientArea
  19. {
  20. use FormExtendedTrait;
  21. use FormDataProvider;
  22. public function initContent()
  23. {
  24. $this->initIds('infoForm');
  25. $this->setFormType('info');
  26. $this->setProvider(new InfoSettingDataProvider());
  27. $this->initFields();
  28. $this->loadDataToForm();
  29. }
  30. public function getAllowedActions()
  31. {
  32. return ['info'];
  33. }
  34. private function initFields()
  35. {
  36. // $message = di('lang')->absoluteT('dnsinfomessage');
  37. $message = 'DNS Information für
  38. <div id="alertmaildomain" class="lu-alert--lg lu-alert__title"></div>
  39. <li>
  40. <ul id="addmxmessage"></ul>
  41. <ul id="addspfmessage"></ul>
  42. <ul id="adddmarcmessage"></ul>
  43. <ul id="adddkimmessage"></ul>
  44. </li>
  45. <div class="lu-form-group">
  46. <label class="lu-form-label">DNS Record Type</label>
  47. <div class="lu-input-group" style="background:#eeeeee">
  48. <input type="text" value="ThurData Vorgabe" readonly="readonly" class="lu-form-control" style="">
  49. <div class="lu-input-group__addon">&hArr;</div>
  50. <input type="text" value="Aktueller Wert" readonly="readonly" class="lu-form-control" style="">
  51. </div>
  52. </div>';
  53. $this->addInternalAlert($message, null, 100);
  54. $row = new InputGroup('MX');
  55. $row->addInputComponent((new InputGroupElements\Text('mxthurdata'))->addHtmlAttribute('readonly','true'));
  56. $row->addInputAddon('', false, '&hArr;');
  57. $row->addInputComponent((new InputGroupElements\Text('mxactive'))->addHtmlAttribute('readonly','true'));
  58. $this->addSection($row);
  59. $row = new InputGroup('SPF');
  60. $row->addInputComponent((new InputGroupElements\Text('spfthurdata'))->addHtmlAttribute('readonly','true'));
  61. $row->addInputAddon('', false, '&hArr;');
  62. $row->addInputComponent((new InputGroupElements\Text('spf'))->addHtmlAttribute('readonly','true'));
  63. $this->addSection($row);
  64. $row = new InputGroup('DMARC');
  65. $row->addInputComponent((new InputGroupElements\Text('dmarcthurdata'))->addHtmlAttribute('readonly','true'));
  66. $row->addInputAddon('', false, '&hArr;');
  67. $row->addInputComponent((new InputGroupElements\Text('dmarc'))->addHtmlAttribute('readonly','true'));
  68. $this->addSection($row);
  69. $row = new InputGroup('DKIM');
  70. $row->addInputComponent((new InputGroupElements\Text('dkimthurdata'))->addHtmlAttribute('readonly','true'));
  71. $row->addInputAddon('', false, '&hArr;');
  72. $row->addInputComponent((new InputGroupElements\Text('dkim'))->addHtmlAttribute('readonly','true'));
  73. $this->addSection($row);
  74. $this->generateDoubleSection([new Hidden('maildomain'), new Hidden('id')]);
  75. }
  76. }