InfoForm.php 3.7 KB

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