Initial commit
This commit is contained in:
35
Block/System/Config/TestConnection.php
Normal file
35
Block/System/Config/TestConnection.php
Normal file
@@ -0,0 +1,35 @@
|
||||
<?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();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user