AdditionalComment.php 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Analytics\Block\Adminhtml\System\Config;
  7. /**
  8. * Provides field with additional information
  9. */
  10. class AdditionalComment extends \Magento\Config\Block\System\Config\Form\Field
  11. {
  12. /**
  13. * @param \Magento\Framework\Data\Form\Element\AbstractElement $element
  14. * @return string
  15. */
  16. public function render(\Magento\Framework\Data\Form\Element\AbstractElement $element)
  17. {
  18. $html = '<div class="config-additional-comment-title">' . $element->getLabel() . '</div>';
  19. $html .= '<div class="config-additional-comment-content">' . $element->getComment() . '</div>';
  20. return $this->decorateRowHtml($element, $html);
  21. }
  22. /**
  23. * @param \Magento\Framework\Data\Form\Element\AbstractElement $element
  24. * @param string $html
  25. * @return string
  26. */
  27. private function decorateRowHtml(\Magento\Framework\Data\Form\Element\AbstractElement $element, $html)
  28. {
  29. return sprintf(
  30. '<tr id="row_%s"><td colspan="3"><div class="config-additional-comment">%s</div></td></tr>',
  31. $element->getHtmlId(),
  32. $html
  33. );
  34. }
  35. }