Hint.php 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. namespace Magento\Paypal\Block\Adminhtml\System\Config\Fieldset;
  7. use Magento\Backend\Block\Template;
  8. use Magento\Framework\Data\Form\Element\AbstractElement;
  9. use Magento\Framework\Data\Form\Element\Renderer\RendererInterface;
  10. /**
  11. * Class Hint adds "Configuration Details" link to payment configuration.
  12. * `<comment>` node must be defined in `<group>` node and contain some link.
  13. */
  14. class Hint extends Template implements RendererInterface
  15. {
  16. /**
  17. * @var string
  18. * @deprecated 100.1.0
  19. */
  20. protected $_template = 'Magento_Paypal::system/config/fieldset/hint.phtml';
  21. /**
  22. * @param AbstractElement $element
  23. * @return string
  24. */
  25. public function render(AbstractElement $element)
  26. {
  27. $html = '';
  28. if ($element->getComment()) {
  29. $html .= sprintf('<tr id="row_%s">', $element->getHtmlId());
  30. $html .= '<td colspan="1"><p class="note"><span>';
  31. $html .= sprintf(
  32. '<a href="%s" target="_blank">Configuration Details</a>',
  33. $element->getComment()
  34. );
  35. $html .= '</span></p></td></tr>';
  36. }
  37. return $html;
  38. }
  39. }