35 lines
1.1 KiB
PHP
35 lines
1.1 KiB
PHP
<?php
|
|
namespace SoundPress\WHIOrders\Block\System\Config;
|
|
use Magento\Config\Block\System\Config\Form\Field;
|
|
use Magento\Backend\Block\Template\Context;
|
|
use Magento\Framework\Data\Form\Element\AbstractElement;
|
|
class TestConnection extends Field
|
|
{
|
|
protected $_template = 'SoundPress_WHIOrders::system/config/test_connection.phtml';
|
|
public function __construct(Context $context, array $data = [])
|
|
{
|
|
parent::__construct($context, $data);
|
|
}
|
|
|
|
public function render(AbstractElement $element)
|
|
{
|
|
$element->unsScope()->unsCanUseWebsiteValue()->unsCanUseDefaultValue();
|
|
return parent::render($element);
|
|
}
|
|
|
|
protected function _getElementHtml(AbstractElement $element)
|
|
{
|
|
return $this->_toHtml();
|
|
}
|
|
|
|
public function getCustomUrl()
|
|
{
|
|
return $this->getUrl('whiorders/connection/index');
|
|
}
|
|
|
|
public function getButtonHtml()
|
|
{
|
|
$button = $this->getLayout()->createBlock('Magento\Backend\Block\Widget\Button')->setData(['id' => 'whi_test_connection', 'label' => 'Test Connection',]);
|
|
return $button->toHtml();
|
|
}
|
|
}
|