btcPayService = $btcPayService; $this->helper = $helper; } /** * Render form element as HTML * * @param \Magento\Framework\Data\Form\Element\AbstractElement $element * @return string */ public function render(\Magento\Framework\Data\Form\Element\AbstractElement $element) { $html = $this->getConnectionStatusPerStore(); $r = '' . $html . '

'; return $r; } public function getErrorHtml(int $magentoStoreId): string { $lines = $this->helper->getInstallationErrors($magentoStoreId, false); if (count($lines) > 0) { $r = ''; } else { $r = 'OK'; } return $r; } public function getConnectionStatusPerStore() { $html = ''; $magentoStores = $this->helper->getAllMagentoStoreViews(); foreach ($magentoStores as $magentoStore) { $storeId = (int)$magentoStore->getId(); $html = $html . ' '; } return $html . '
' . __('Store') . ' ' . __('Feedback') . '
' . $magentoStore->getName() . ' ' . $this->getErrorHtml($storeId) . '
'; } }